/* ========================================
   LIVIAGO - AUTH PAGES
   Brand: Navy + Steel Blue + Red "GO"
   ======================================== */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---- THEME: DARK (default) ---- */
:root,
[data-theme="dark"] {
    --auth-bg: #0b1622;
    --auth-bg-alt: #0f1d2e;
    --auth-surface: #132338;
    --auth-surface-2: #172a42;
    --auth-border: rgba(90, 165, 210, 0.12);
    --auth-border-hover: rgba(90, 165, 210, 0.22);
    --auth-border-focus: #4a9ebe;
    --auth-text: #eaf2fb;
    --auth-text-secondary: #8aa8c7;
    --auth-text-muted: #5a7a9a;
    --auth-brand-blue: #4a9ebe;
    --auth-brand-red: #e53935;
    --auth-accent: #4a9ebe;
    --auth-accent-hover: #5bb5d8;
    --auth-accent-glow: rgba(74, 158, 190, 0.2);
    --auth-glow-1: rgba(74, 158, 190, 0.1);
    --auth-glow-2: rgba(229, 57, 53, 0.05);
    --auth-input-bg: #0f1d2e;
    --auth-card-bg: #132338;
    --auth-card-border: rgba(90, 165, 210, 0.1);
    --auth-card-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    --auth-nav-bg: rgba(11, 22, 34, 0.85);
    --auth-success: #10b981;
    --auth-warning: #f59e0b;
    --auth-error: #ef4444;
    --auth-success-bg: rgba(16, 185, 129, 0.08);
    --auth-warning-bg: rgba(245, 158, 11, 0.08);
    --auth-error-bg: rgba(239, 68, 68, 0.08);
    --auth-info-bg: rgba(74, 158, 190, 0.08);
}

/* ---- THEME: LIGHT ---- */
[data-theme="light"] {
    --auth-bg: #f4f7fb;
    --auth-bg-alt: #edf2f8;
    --auth-surface: #ffffff;
    --auth-surface-2: #f8fafc;
    --auth-border: rgba(74, 158, 190, 0.12);
    --auth-border-hover: rgba(74, 158, 190, 0.25);
    --auth-border-focus: #2d7fa5;
    --auth-text: #0d1b2a;
    --auth-text-secondary: #3e5c76;
    --auth-text-muted: #6b8ba8;
    --auth-brand-blue: #2d7fa5;
    --auth-brand-red: #d32f2f;
    --auth-accent: #2d7fa5;
    --auth-accent-hover: #236b8e;
    --auth-accent-glow: rgba(45, 127, 165, 0.15);
    --auth-glow-1: rgba(74, 158, 190, 0.06);
    --auth-glow-2: rgba(229, 57, 53, 0.03);
    --auth-input-bg: #f8fafc;
    --auth-card-bg: #ffffff;
    --auth-card-border: rgba(74, 158, 190, 0.1);
    --auth-card-shadow: 0 20px 60px rgba(13, 27, 42, 0.08);
    --auth-nav-bg: rgba(244, 247, 251, 0.9);
    --auth-success: #059669;
    --auth-warning: #d97706;
    --auth-error: #dc2626;
    --auth-success-bg: rgba(5, 150, 105, 0.06);
    --auth-warning-bg: rgba(217, 119, 6, 0.06);
    --auth-error-bg: rgba(220, 38, 38, 0.06);
    --auth-info-bg: rgba(45, 127, 165, 0.06);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--auth-bg);
    color: var(--auth-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--auth-accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--auth-accent-hover);
}

/* ---- MINIMAL NAV ---- */
.auth-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--auth-nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--auth-border);
    transition: background 0.3s ease;
}

.auth-nav-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--auth-text);
    font-weight: 700;
    font-size: 1.1rem;
}

.auth-nav-logo {
    height: 32px;
    width: auto;
}

.auth-nav-brand-text {
    color: var(--auth-brand-blue);
    font-weight: 700;
}

.auth-nav-brand-go {
    color: var(--auth-brand-red);
    font-weight: 800;
}

.auth-nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-theme-toggle {
    background: transparent;
    border: 1px solid var(--auth-border);
    color: var(--auth-text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.auth-theme-toggle:hover {
    border-color: var(--auth-border-hover);
    color: var(--auth-text);
    background: var(--auth-surface);
}

.auth-nav-link {
    color: var(--auth-text-secondary);
    text-decoration: none;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    transition: color 0.2s;
}

.auth-nav-link:hover {
    color: var(--auth-text);
}

/* ---- PAGE LAYOUT ---- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 40px;
    position: relative;
}

.auth-glow {
    position: absolute;
    top: -5%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background:
        radial-gradient(ellipse at 40% 50%, var(--auth-glow-1) 0%, transparent 60%),
        radial-gradient(ellipse at 60% 40%, var(--auth-glow-2) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ---- CARD ---- */
.auth-card {
    position: relative;
    z-index: 1;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--auth-card-shadow);
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.auth-card.auth-card-wide {
    max-width: 580px;
}

.auth-card.auth-card-info {
    max-width: 560px;
}

/* ---- CARD HEADER ---- */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 80px;
    height: auto;
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.auth-logo:hover {
    transform: scale(1.05);
}

.auth-brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.auth-brand-livia {
    color: var(--auth-brand-blue);
}

.auth-brand-go {
    color: var(--auth-brand-red);
}

.auth-subtitle {
    color: var(--auth-text-muted);
    font-size: 0.9rem;
    font-weight: 400;
}

.auth-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: 4px;
}

/* ---- FORM ---- */
.auth-form-group {
    margin-bottom: 20px;
}

.auth-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--auth-text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.auth-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    color: var(--auth-text);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.auth-input:focus {
    border-color: var(--auth-border-focus);
    box-shadow: 0 0 0 3px var(--auth-accent-glow);
}

.auth-input::placeholder {
    color: var(--auth-text-muted);
    font-size: 0.85rem;
}

.auth-input.error {
    border-color: var(--auth-error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.auth-input.success {
    border-color: var(--auth-success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ---- CHECKBOX ---- */
.auth-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.auth-checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-accent);
    cursor: pointer;
    flex-shrink: 0;
}

.auth-checkbox-row span,
.auth-checkbox-row label {
    color: var(--auth-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
}

/* ---- BUTTONS ---- */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    text-decoration: none;
}

.auth-btn-primary {
    background: var(--auth-brand-red);
    color: #fff;
}

.auth-btn-primary:hover {
    background: #c62828;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(229, 57, 53, 0.2);
    color: #fff;
}

.auth-btn-secondary {
    background: transparent;
    color: var(--auth-text-secondary);
    border: 1px solid var(--auth-border-hover);
}

.auth-btn-secondary:hover {
    color: var(--auth-text);
    border-color: var(--auth-accent);
    background: rgba(74, 158, 190, 0.05);
}

.auth-btn-blue {
    background: var(--auth-accent);
    color: #fff;
}

.auth-btn-blue:hover {
    background: var(--auth-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--auth-accent-glow);
    color: #fff;
}

.auth-btn-success {
    background: var(--auth-success);
    color: #fff;
}

.auth-btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
    color: #fff;
}

.auth-btn-auto {
    width: auto;
}

.auth-btn-sm {
    padding: 8px 18px;
    font-size: 0.85rem;
}

/* Loader inside button */
.auth-btn .auth-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.6s linear infinite;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

/* ---- LINKS / FOOTER ---- */
.auth-links {
    text-align: center;
    margin-top: 24px;
}

.auth-links p {
    color: var(--auth-text-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.auth-links a {
    color: var(--auth-accent);
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-divider {
    border: none;
    border-top: 1px solid var(--auth-border);
    margin: 24px 0;
}

.auth-legal {
    text-align: center;
    font-size: 0.75rem;
    color: var(--auth-text-muted);
    line-height: 1.5;
}

.auth-legal a {
    color: var(--auth-text-secondary);
}

.auth-legal a:hover {
    color: var(--auth-accent);
}

/* ---- ALERT ---- */
.auth-alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    border: 1px solid;
}

.auth-alert-error {
    background: var(--auth-error-bg);
    border-color: rgba(239, 68, 68, 0.15);
    color: var(--auth-error);
}

.auth-alert-success {
    background: var(--auth-success-bg);
    border-color: rgba(16, 185, 129, 0.15);
    color: var(--auth-success);
}

.auth-alert-warning {
    background: var(--auth-warning-bg);
    border-color: rgba(245, 158, 11, 0.15);
    color: var(--auth-warning);
}

.auth-alert-info {
    background: var(--auth-info-bg);
    border-color: rgba(74, 158, 190, 0.15);
    color: var(--auth-accent);
}

/* ---- INFO CARDS (for success/confirmation pages) ---- */
.auth-info-card {
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: background 0.3s, border-color 0.3s;
}

.auth-info-card-success {
    border-color: rgba(16, 185, 129, 0.2);
    background: var(--auth-success-bg);
}

.auth-info-card-warning {
    border-color: rgba(245, 158, 11, 0.2);
    background: var(--auth-warning-bg);
}

.auth-info-card-info {
    border-color: rgba(74, 158, 190, 0.2);
    background: var(--auth-info-bg);
}

.auth-info-card h3,
.auth-info-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.auth-info-card-success h3,
.auth-info-card-success h4 {
    color: var(--auth-success);
}

.auth-info-card-warning h3,
.auth-info-card-warning h4 {
    color: var(--auth-warning);
}

.auth-info-card-info h3,
.auth-info-card-info h4 {
    color: var(--auth-accent);
}

.auth-info-card p {
    color: var(--auth-text-secondary);
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 6px;
}

.auth-info-card p:last-child {
    margin-bottom: 0;
}

/* ---- STATUS ICON ---- */
.auth-status-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 20px;
}

.auth-status-icon-success {
    background: var(--auth-success-bg);
    color: var(--auth-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.auth-status-icon-warning {
    background: var(--auth-warning-bg);
    color: var(--auth-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.auth-status-icon-info {
    background: var(--auth-info-bg);
    color: var(--auth-accent);
    border: 1px solid rgba(74, 158, 190, 0.2);
}

/* ---- STEP INDICATOR (register) ---- */
.auth-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.auth-step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    color: var(--auth-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-step.active {
    background: var(--auth-accent);
    border-color: var(--auth-accent);
    color: #fff;
}

.auth-step.completed {
    background: var(--auth-success);
    border-color: var(--auth-success);
    color: #fff;
}

.auth-step-line {
    width: 40px;
    height: 2px;
    background: var(--auth-border);
    margin: 0 6px;
    transition: background 0.3s ease;
}

.auth-step-line.completed {
    background: var(--auth-success);
}

/* ---- FORM STEP ---- */
.auth-form-step {
    display: none;
}

.auth-form-step.active {
    display: block;
}

.auth-step-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--auth-text);
    text-align: center;
    margin-bottom: 20px;
}

.auth-step-title i {
    color: var(--auth-accent);
    margin-right: 8px;
}

/* ---- VALIDATION MESSAGE ---- */
.auth-validation {
    font-size: 0.75rem;
    margin-top: 4px;
    min-height: 16px;
}

.auth-validation.success {
    color: var(--auth-success);
}

.auth-validation.error {
    color: var(--auth-error);
}

/* Field loading spinner */
.auth-field-loading {
    position: relative;
}

.auth-field-loading::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid var(--auth-accent);
    border-radius: 50%;
    border-top-color: transparent;
    animation: authSpin 0.6s linear infinite;
}

/* ---- GRID for form fields ---- */
.auth-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ---- BUTTON ROW ---- */
.auth-btn-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.auth-btn-row .auth-btn {
    width: auto;
    flex: 1;
}

.auth-btn-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.auth-btn-group .auth-btn {
    width: auto;
}

/* ---- BOTTOM FOOTER ---- */
.auth-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 12px 24px;
    font-size: 0.75rem;
    color: var(--auth-text-muted);
    background: transparent;
}

.auth-footer a {
    color: var(--auth-text-muted);
    margin: 0 8px;
}

.auth-footer a:hover {
    color: var(--auth-accent);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
    .auth-page {
        padding: 72px 16px 60px;
        align-items: flex-start;
    }

    .auth-card {
        padding: 28px 22px;
        border-radius: 14px;
    }

    .auth-logo {
        width: 64px;
    }

    .auth-brand {
        font-size: 1.3rem;
    }

    .auth-nav-brand-text,
    .auth-nav-brand-go {
        display: none;
    }

    .auth-form-grid {
        grid-template-columns: 1fr;
    }

    .auth-btn-row {
        flex-direction: column;
    }

    .auth-btn-row .auth-btn {
        width: 100%;
    }

    .auth-btn-group {
        flex-direction: column;
    }

    .auth-btn-group .auth-btn {
        width: 100%;
    }

    .auth-footer {
        position: static;
        margin-top: 24px;
    }
}

/* ---- ANIMATIONS ---- */
@media (prefers-reduced-motion: no-preference) {
    .auth-card {
        animation: authFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    @keyframes authFadeUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ---- HIDDEN UTILITY ---- */
.hidden {
    display: none !important;
}
