/* =========================================================
   JERALD.ATLAS — Master System & Authentication CSS
   Mobile-First / Fully Responsive / Figma-Inspired Theme
   ========================================================= */

:root {
    --atlas-bg: #1E1E1E;
    --atlas-surface: #2C2C2C;
    --atlas-text: #FFFFFF;
    --atlas-muted: #8C8C8C;
    --atlas-border: #3F3F3F;
    --atlas-accent: #0ACF83;
    --atlas-accent-hover: #08B170;
    --atlas-warning: #FFB020;
    --atlas-success: #1ABCFE;
    --atlas-danger: #F24822;
    --atlas-meta-blue: #1877F2; /* Mark Zuckerberg / Meta Facebook Blue */
    --font-serif: Georgia, Cambria, "Times New Roman", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* =========================================================
   CORE & RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

html, body {
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--atlas-bg);
    color: var(--atlas-text);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background-color: var(--atlas-accent);
    color: #1E1E1E;
}

a {
    color: var(--atlas-accent);
    text-decoration: none;
    transition: color 0.15s ease, text-decoration 0.15s ease;
}

a:hover {
    text-decoration: underline;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

/* =========================================================
   CONTAINERS & STRUCTURE
   ========================================================= */

.wrapper {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px;
}

.content {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 18px 90px;
}

/* Dedicated Centered Container for Login / Register Pages */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px 14px;
}

/* Card Containers for Auth Forms & Figma Notebook Paper Theme (No Holes) */
.login,
.register,
.block,
.card {
    width: 100%;
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    padding: 32px 28px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    margin: auto;

    /* Figma Notebook Paper Style Overlays (Lines only, holes removed) */
    background-color: var(--atlas-surface);
    background-image: 
        linear-gradient(90deg, transparent 48px, rgba(242, 72, 34, 0.4) 48px, rgba(242, 72, 34, 0.4) 49px, transparent 49px),
        linear-gradient(to bottom, rgba(10, 207, 131, 0.08) 1px, transparent 1px);
    
    background-position: 
        0 0,         
        0 0;         
        
    background-size: 
        100% 100%,
        100% 28px;   
        
    padding-left: 64px !important;
}

.login,
.register {
    max-width: 440px;
}

.card + .card {
    margin-top: 12px;
}

/* Card Header Icon Wrapper (Meta Blue Accent) */
.login .icon,
.register .icon {
    width: 48px;
    height: 48px;
    background: rgba(24, 119, 242, 0.15);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.login .icon svg,
.register .icon svg {
    fill: var(--atlas-meta-blue);
}

/* Form Headings */
.login h1,
.register h1 {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: var(--atlas-text);
    margin: 0 0 24px;
    letter-spacing: -0.4px;
}

/* =========================================================
   HEADER & NAVIGATION
   ========================================================= */

.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(30, 30, 30, 0.92);
    border-bottom: 1px solid var(--atlas-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header .wrapper {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header h1 {
    margin: 0;
    color: var(--atlas-text);
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.brand {
    display: flex;
    align-items: center;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
}

.brand-name {
    display: inline-block;
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--atlas-text);
}

#menu {
    display: none;
}

.header label {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    position: relative;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.header label:hover {
    background: var(--atlas-bg);
}

.header label:before,
.header label:after {
    content: "";
    position: absolute;
    left: 11px;
    width: 16px;
    height: 2px;
    background: var(--atlas-text);
    border-radius: 1px;
}

.header label:before { top: 15px; }
.header label:after { top: 21px; }

.menu {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    display: none;
    padding: 12px 18px;
    background: var(--atlas-surface);
    border-bottom: 1px solid var(--atlas-border);
}

.menu a {
    display: block;
    padding: 10px 12px;
    margin: 2px 0;
    color: var(--atlas-muted);
    font-weight: 500;
    font-size: 14px;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.menu a:hover,
.menu a.active {
    color: var(--atlas-accent);
    background: rgba(10, 207, 131, 0.08);
    text-decoration: none;
}

#menu:checked ~ .menu {
    display: block;
}

/* =========================================================
   PAGE TITLES & BLOCKS
   ========================================================= */

.page-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.page-title .icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(24, 119, 242, 0.15);
    color: var(--atlas-meta-blue);
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.page-title h2 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.page-title p {
    margin: 4px 0 0;
    color: var(--atlas-muted);
    font-size: 14px;
}

.block {
    width: 100%;
    padding: 20px;
    margin-bottom: 20px;
}

.block h3 {
    margin: 0 0 8px;
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--atlas-text);
}

.block p {
    margin: 0 0 14px;
    color: var(--atlas-muted);
    font-size: 14px;
    line-height: 1.6;
}

.card {
    padding: 16px;
}

/* =========================================================
   FORMS & INPUT CONTROLS
   ========================================================= */

.form {
    width: 100%;
    margin: 0;
}

.form-small {
    width: 100%;
    max-width: 720px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--atlas-text);
    margin-bottom: 6px;
}

.form-group {
    position: relative;
    margin-bottom: 18px;
}

.form-group.mar-bot-5 {
    margin-bottom: 24px;
}

/* Checkbox & Forgot Password Row (Login) */
.form-group.pad-y-5 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -4px;
    margin-bottom: 22px;
}

#remember_me {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--atlas-muted);
    cursor: pointer;
    user-select: none;
}

#remember_me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--atlas-accent);
    cursor: pointer;
    margin: 0;
}

.form-input {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--atlas-border);
    border-radius: 6px;
    background: var(--atlas-bg);
    color: var(--atlas-text);
    font-size: 15px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Input with left icon inside a .form-group */
.form-group .form-input {
    padding-left: 40px;
}

.form-input:hover {
    border-color: var(--atlas-muted);
}

.form-input:focus {
    border-color: var(--atlas-accent);
    box-shadow: 0 0 0 4px rgba(10, 207, 131, 0.2);
}

.form-input::placeholder {
    color: var(--atlas-muted);
    opacity: 0.7;
}

/* Left Icon Alignment (Meta Blue when focused) */
.form-icon-left {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    fill: var(--atlas-muted);
    pointer-events: none;
    transition: fill 0.15s ease;
}

.form-group:focus-within .form-icon-left {
    fill: var(--atlas-meta-blue);
}

textarea.form-input {
    min-height: 120px;
    padding-left: 14px;
    resize: vertical;
}

select.form-input {
    cursor: pointer;
    padding-left: 14px;
    padding-right: 36px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--atlas-muted) 50%),
        linear-gradient(135deg, var(--atlas-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 16px) 18px,
        calc(100% - 11px) 18px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

input[type="date"].form-input,
input[type="datetime-local"].form-input,
input[type="time"].form-input {
    min-height: 46px;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--atlas-accent);
}

.form-help {
    display: block;
    margin-top: 6px;
    color: var(--atlas-muted);
    font-size: 13px;
}

.required {
    color: var(--atlas-danger);
}

/* Links inside forms & footers */
.form-link {
    color: var(--atlas-accent);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.form-link:hover {
    text-decoration: underline;
}

.register-link {
    text-align: center;
    font-size: 14px;
    color: var(--atlas-muted);
    margin-top: 20px;
    margin-bottom: 0;
}

.register-link .form-link {
    font-size: 14px;
}

/* =========================================================
   BUTTONS (Enhanced 3D Look)
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--atlas-border);
    border-radius: 6px;
    background: linear-gradient(to bottom, #383838, #282828);
    color: var(--atlas-text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(0);
    transition: all 0.1s ease;
}

.btn:hover {
    background: linear-gradient(to bottom, #424242, #303030);
    border-color: var(--atlas-muted);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    text-decoration: none;
}

.btn:active {
    background: linear-gradient(to bottom, #242424, #1E1E1E);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(0, 0, 0, 0.5);
    transform: translateY(1px);
}

/* Auth submit buttons */
.login .btn,
.register .btn {
    width: 100%;
    min-height: 46px;
    font-size: 15px;
}

/* Primary / Accent Button (3D) */
.btn.blue,
.btn.accent {
    background: linear-gradient(to bottom, #0de090, #08B170);
    border-color: #069c61;
    color: #1E1E1E;
    box-shadow: 0 6px 15px rgba(10, 207, 131, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn.blue:hover,
.btn.accent:hover {
    background: linear-gradient(to bottom, #0fe999, #09c47b);
    border-color: #08B170;
    box-shadow: 0 8px 20px rgba(10, 207, 131, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    color: #1E1E1E;
}

.btn.blue:active,
.btn.accent:active {
    background: linear-gradient(to bottom, #079c62, #068051);
    box-shadow: 0 2px 4px rgba(10, 207, 131, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateY(1px);
}

/* Success Button (3D Cyan) */
.btn.green {
    background: linear-gradient(to bottom, #30c7ff, #1ABCFE);
    border-color: #0ca6e4;
    color: #1E1E1E;
    box-shadow: 0 6px 15px rgba(26, 188, 254, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn.green:hover {
    background: linear-gradient(to bottom, #4ad1ff, #2bc3ff);
    border-color: #1ABCFE;
    box-shadow: 0 8px 20px rgba(26, 188, 254, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    color: #1E1E1E;
}

.btn.green:active {
    background: linear-gradient(to bottom, #119ee3, #0c8ec8);
    box-shadow: 0 2px 4px rgba(26, 188, 254, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateY(1px);
}

/* Alt Button (3D) */
.btn.alt {
    background: linear-gradient(to bottom, #363636, #242424);
    border-color: var(--atlas-border);
    color: var(--atlas-text);
}

.btn.alt:hover {
    background: linear-gradient(to bottom, #424242, #2c2c2c);
}

.atlas-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

/* =========================================================
   MESSAGES & BADGES
   ========================================================= */

.msg {
    display: none;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.45;
}

.msg.error {
    display: block;
    border: 1px solid rgba(242, 72, 34, 0.3);
    background: rgba(242, 72, 34, 0.12);
    color: var(--atlas-danger);
}

.msg.success {
    display: block;
    border: 1px solid rgba(26, 188, 254, 0.3);
    background: rgba(26, 188, 254, 0.12);
    color: var(--atlas-success);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    font-family: var(--font-mono);
}

.badge.blue,
.badge.accent {
    background: rgba(10, 207, 131, 0.15);
    color: var(--atlas-accent);
}

.badge.green {
    background: rgba(26, 188, 254, 0.15);
    color: var(--atlas-success);
}

.badge.yellow {
    background: rgba(255, 176, 32, 0.15);
    color: #ffb020;
}

.badge.red {
    background: rgba(242, 72, 34, 0.15);
    color: var(--atlas-danger);
}

.badge.gray {
    background: var(--atlas-bg);
    border: 1px solid var(--atlas-border);
    color: var(--atlas-muted);
}

/* =========================================================
   TABLES & DATA DISPLAY
   ========================================================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--atlas-border);
    border-radius: 6px;
    background: var(--atlas-surface);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--atlas-border);
    text-align: left;
    font-size: 14px;
}

th {
    background: var(--atlas-bg);
    color: var(--atlas-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

td {
    color: var(--atlas-text);
}

tr:last-child td {
    border-bottom: 0;
}

.empty-state {
    padding: 36px 20px;
    text-align: center;
    color: var(--atlas-muted);
}

.empty-state h3 {
    margin: 0 0 6px;
    font-family: var(--font-serif);
    color: var(--atlas-text);
    font-size: 18px;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* =========================================================
   DOCUMENTATION LINK CARD
   ========================================================= */

.documentation-link {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 620px;
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px solid var(--atlas-border);
    border-radius: 6px;
    background: var(--atlas-surface);
    color: var(--atlas-text);
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.documentation-link:hover {
    border-color: var(--atlas-accent);
    background: var(--atlas-surface);
    text-decoration: none;
}

.documentation-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 6px;
    background: var(--atlas-meta-blue);
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
}

.documentation-link strong {
    display: block;
    margin-bottom: 2px;
    font-family: var(--font-serif);
    color: var(--atlas-text);
    font-size: 15px;
    font-weight: 700;
}

.documentation-link small {
    display: block;
    color: var(--atlas-muted);
    font-size: 13px;
}

/* =========================================================
   SPACING UTILITIES
   ========================================================= */

.mar-top-1 { margin-top: 8px; }
.mar-top-2 { margin-top: 16px; }
.mar-top-3 { margin-top: 24px; }
.mar-bottom-1 { margin-bottom: 8px; }
.mar-bottom-2 { margin-bottom: 16px; }
.mar-bottom-3 { margin-bottom: 24px; }

/* =========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================= */

@media (min-width: 760px) {
    .header label {
        display: none;
    }

    .menu {
        position: static;
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 0;
        background: transparent;
        border: 0;
    }

    .menu a {
        display: inline-flex;
        align-items: center;
        min-height: 36px;
        padding: 6px 12px;
        margin: 0;
    }

    .content {
        padding-top: 32px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 16px 10px;
    }

    .wrapper { padding: 0 14px; }
    .content { padding: 18px 14px 80px; }

    .login,
    .register {
        padding: 24px 18px;
        border-radius: 6px;
    }

    .login h1,
    .register h1 {
        font-size: 21px;
    }

    .page-title h2 { font-size: 24px; }
    .block { padding: 16px; }

    .atlas-links {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .atlas-links .btn,
    .form .btn {
        width: 100%;
        min-height: 44px;
        margin: 4px 0 0;
    }
}

/* ACCESSIBILITY & REDUCED MOTION */
:focus-visible {
    outline: 2px solid var(--atlas-accent);
    outline-offset: 2px;
}

button:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}