/* ==========================================================================
   GRCPro Auth — Neon Glass (login, register, forgot password)
   Uses design tokens from landing.css
   ========================================================================== */

.auth-glass-page {
    min-height: 100vh;
    background: var(--gradient-hero);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

.auth-glass-page.auth-glass-page--with-demo {
    padding-top: 2.75rem;
}

.auth-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.auth-bg__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 217, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 217, 255, 0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, black 15%, transparent 75%);
    animation: authGridDrift 45s linear infinite;
}

@keyframes authGridDrift {
    to { transform: translate(56px, 56px); }
}

.auth-bg__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    animation: authOrbFloat 14s ease-in-out infinite;
}

.auth-bg__orb--1 {
    width: 420px;
    height: 420px;
    background: rgba(37, 99, 255, 0.22);
    top: -8%;
    right: 8%;
}

.auth-bg__orb--2 {
    width: 360px;
    height: 360px;
    background: rgba(109, 91, 255, 0.18);
    bottom: 5%;
    left: -6%;
    animation-delay: -5s;
}

.auth-bg__orb--3 {
    width: 280px;
    height: 280px;
    background: rgba(0, 217, 255, 0.14);
    top: 42%;
    left: 38%;
    animation-delay: -9s;
}

@keyframes authOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(24px, -18px) scale(1.04); }
}

.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
}

.auth-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
}

.auth-panel--form {
    overflow-y: auto;
}

.auth-card {
    width: 100%;
    max-width: 520px;
    padding: clamp(1.75rem, 3vw, 2.5rem);
    background: rgba(8, 18, 40, 0.72);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow-card), 0 0 0 1px rgba(0, 217, 255, 0.06) inset;
    animation: authFadeUp 0.7s var(--ease-out) both;
}

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

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

.auth-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-brand img {
    height: 64px;
    width: auto;
    max-width: min(300px, 80vw);
    margin: 0 auto 0.75rem;
    display: block;
}

.auth-brand__tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-header {
    margin-bottom: 1.5rem;
}

.auth-header h1 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin: 0;
}

.auth-header a,
.auth-link {
    color: var(--cyan);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.auth-header a:hover,
.auth-link:hover {
    color: var(--glow);
    text-shadow: 0 0 12px rgba(0, 217, 255, 0.35);
}

.auth-section-title {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cyan);
    margin: 1.25rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-glass);
}

.auth-field {
    margin-bottom: 1.1rem;
}

.auth-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap > .bi {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.05rem;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 1;
}

.auth-input {
    width: 100%;
    height: 3.25rem;
    padding: 0 1rem 0 2.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    background: rgba(3, 12, 32, 0.55);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input::placeholder {
    color: var(--text-muted);
}

.auth-input:focus {
    outline: none;
    border-color: var(--border-glow);
    background: rgba(3, 16, 40, 0.75);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.12), 0 0 24px rgba(0, 217, 255, 0.08);
}

.auth-input:focus + .bi,
.auth-input-wrap:focus-within > .bi {
    color: var(--cyan);
}

.auth-input.is-valid {
    border-color: rgba(0, 255, 178, 0.45);
}

.auth-input.is-invalid {
    border-color: rgba(255, 90, 90, 0.55);
}

.auth-toggle-pw {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: rgba(8, 20, 48, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    color: #CBD5E1;
    padding: 0;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.auth-toggle-pw .bi {
    position: static;
    transform: none;
    pointer-events: none;
    font-size: 1.1rem;
    color: inherit;
}

.auth-input-wrap:has(.auth-toggle-pw) .auth-input {
    padding-right: 3.5rem;
}

.auth-toggle-pw:hover,
.auth-toggle-pw:focus-visible {
    color: #25B4F8;
    border-color: rgba(37, 180, 248, 0.45);
    background: rgba(8, 24, 56, 0.9);
    box-shadow: 0 0 0 2px rgba(37, 180, 248, 0.15);
    outline: none;
}

/* Keep autofill fields dark so icons stay readable (Chrome/Edge) */
html:not(.auth-theme-light) .auth-input:-webkit-autofill,
html:not(.auth-theme-light) .auth-input:-webkit-autofill:hover,
html:not(.auth-theme-light) .auth-input:-webkit-autofill:focus,
html:not(.auth-theme-light) .auth-input:-webkit-autofill:active {
    -webkit-text-fill-color: #EFF6FF !important;
    caret-color: #EFF6FF;
    -webkit-box-shadow: 0 0 0 1000px rgba(3, 14, 36, 0.96) inset !important;
    box-shadow: 0 0 0 1000px rgba(3, 14, 36, 0.96) inset !important;
    border-color: var(--border-glass);
    transition: background-color 99999s ease-out 0s;
}

html:not(.auth-theme-light) .auth-input-wrap:has(.auth-input:-webkit-autofill) > .bi:not(.auth-toggle-pw .bi) {
    color: #94A3B8;
}

html:not(.auth-theme-light) .auth-input-wrap:has(.auth-input:-webkit-autofill) .auth-toggle-pw {
    color: #E2E8F0;
    background: rgba(6, 16, 40, 0.92);
    border-color: rgba(148, 163, 184, 0.38);
}

.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0 1.5rem;
    font-size: 0.85rem;
}

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-check input {
    width: 18px;
    height: 18px;
    margin-top: 0.15rem;
    accent-color: var(--cyan);
    flex-shrink: 0;
}

.auth-check a {
    color: var(--cyan);
    font-weight: 600;
    text-decoration: none;
}

.auth-check a:hover {
    color: var(--glow);
    text-decoration: underline;
}

.auth-btn-primary {
    width: 100%;
    height: 3.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.98rem;
    color: #031B4E;
    background: var(--gradient-accent);
    box-shadow: 0 4px 24px rgba(0, 217, 255, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 217, 255, 0.35);
}

.auth-btn-outline {
    width: 100%;
    height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.auth-btn-outline:hover {
    border-color: var(--border-glow);
    background: rgba(0, 217, 255, 0.06);
    color: var(--text-primary);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-glass);
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.auth-alert--danger {
    background: rgba(255, 80, 80, 0.1);
    border-color: rgba(255, 80, 80, 0.25);
    color: #ffb4b4;
}

.auth-alert--success {
    background: rgba(0, 255, 178, 0.08);
    border-color: rgba(0, 255, 178, 0.22);
    color: #9fffe0;
}

.auth-panel--showcase {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.06) 0%, rgba(109, 91, 255, 0.08) 100%);
    border-left: 1px solid var(--border-glass);
}

.auth-showcase {
    max-width: 480px;
    animation: authFadeUp 0.8s var(--ease-out) 0.15s both;
}

.auth-feature-card {
    padding: 1.75rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(16px);
}

.auth-feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.auth-feature-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

.auth-learn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glow);
    color: var(--cyan);
    font-size: 0.85rem;
    font-weight: 600;
}

.auth-carousel-item {
    display: none;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.auth-carousel-item.active {
    display: block;
    opacity: 1;
}

.auth-carousel-item h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 0.75rem;
}

.auth-carousel-item p {
    color: var(--text-secondary);
    line-height: 1.65;
}

.auth-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.auth-carousel-nav {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.auth-carousel-nav:hover {
    border-color: var(--border-glow);
    color: var(--cyan);
}

.auth-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.auth-dot.active {
    background: var(--cyan);
    transform: scale(1.25);
}

.auth-demo-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    text-align: center;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #031B4E;
    background: linear-gradient(90deg, #00FFB2, #00D9FF);
}

.auth-home-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--border-glow);
    background: rgba(8, 18, 40, 0.85);
    color: var(--cyan);
    font-size: 1.25rem;
    box-shadow: var(--shadow-glow);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.auth-theme-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 5.25rem;
    z-index: 100;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--border-glow);
    background: rgba(8, 18, 40, 0.85);
    color: var(--cyan);
    font-size: 1.25rem;
    box-shadow: var(--shadow-glow);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.28s ease, color 0.28s ease;
}

.auth-theme-fab:hover {
    transform: translateY(-3px);
    color: var(--glow);
}

.auth-home-fab:hover {
    transform: translateY(-3px);
    color: var(--glow);
}

.auth-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.auth-strength {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.auth-strength-fill {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background 0.3s ease;
}

.auth-strength-fill.weak,
.password-strength-fill.strength-weak { width: 25%; background: #ff6b6b; }
.auth-strength-fill.fair,
.password-strength-fill.strength-fair { width: 50%; background: #fbbf24; }
.auth-strength-fill.good,
.password-strength-fill.strength-good { width: 75%; background: var(--blue); }
.auth-strength-fill.strong,
.password-strength-fill.strength-strong { width: 100%; background: var(--success); }

.password-strength-meter {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background 0.3s ease;
}

.auth-success-only .auth-panel--showcase {
    display: none !important;
}

.auth-success-only .auth-card {
    max-width: 640px;
}

.tenant-available { color: var(--success); font-size: 0.75rem; font-weight: 600; }
.tenant-taken { color: #ff8a8a; font-size: 0.75rem; font-weight: 600; }

.tenant-suggestions {
    margin-top: 0.5rem;
    background: rgba(8, 18, 40, 0.95);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    max-height: 150px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border-glass);
}

.suggestion-item:hover {
    background: rgba(0, 217, 255, 0.08);
    color: var(--cyan);
}

.password-requirements {
    font-size: 0.72rem;
    margin-top: 0.4rem;
    color: var(--text-muted);
}

.requirement-item.valid {
    color: var(--success);
}

@media (max-width: 991px) {
    .auth-shell {
        flex-direction: column;
    }

    .auth-panel--showcase {
        display: none;
    }

    .auth-card {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.35rem 1.1rem;
    }

    .auth-input,
    .auth-btn-primary,
    .auth-btn-outline {
        height: 3rem;
    }

    .auth-theme-fab {
        right: 4.75rem;
        width: 46px;
        height: 46px;
        bottom: 1.25rem;
    }

    .auth-home-fab {
        width: 46px;
        height: 46px;
        bottom: 1.25rem;
        right: 1.25rem;
    }
}

/* ── Light mode (respects localStorage grcpro_theme) ───────────────────── */
html.auth-theme-light {
    --bg-dark: #F0F5FB;
    --bg-elevated: #FFFFFF;
    --bg-card: rgba(255, 255, 255, 0.94);
    --text-primary: #192C42;
    --text-secondary: rgba(25, 44, 66, 0.78);
    --text-muted: rgba(25, 44, 66, 0.52);
    --border-glass: rgba(18, 50, 100, 0.12);
    --border-glow: rgba(10, 143, 212, 0.38);
    --gradient-hero: linear-gradient(135deg, #E4ECF6 0%, #F0F5FB 45%, #E8EFF8 100%);
    --gradient-card: linear-gradient(145deg, rgba(10, 143, 212, 0.06) 0%, rgba(82, 72, 200, 0.04) 100%);
    --shadow-glow: 0 0 28px rgba(10, 143, 212, 0.14);
    --shadow-card: 0 8px 32px rgba(18, 50, 100, 0.08);
    --cyan: #0A8FD4;
    --blue: #2563FF;
    --glow: #25B4F8;
    --success: #0E9170;
}

html.auth-theme-light .auth-bg__grid {
    background-image:
        linear-gradient(rgba(10, 143, 212, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 143, 212, 0.07) 1px, transparent 1px);
}

html.auth-theme-light .auth-bg__orb--1 { background: rgba(37, 99, 255, 0.14); }
html.auth-theme-light .auth-bg__orb--2 { background: rgba(109, 91, 255, 0.10); }
html.auth-theme-light .auth-bg__orb--3 { background: rgba(0, 217, 255, 0.08); }

html.auth-theme-light .auth-card {
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-card), 0 0 0 1px rgba(10, 143, 212, 0.08) inset;
}

html.auth-theme-light .auth-input {
    background: rgba(255, 255, 255, 0.98);
    border-color: var(--border-glass);
    color: var(--text-primary);
}

html.auth-theme-light .auth-input:focus {
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(10, 143, 212, 0.14), 0 0 20px rgba(10, 143, 212, 0.08);
}

html.auth-theme-light .auth-toggle-pw {
    color: rgba(25, 44, 66, 0.62);
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(18, 50, 100, 0.16);
}

html.auth-theme-light .auth-toggle-pw:hover,
html.auth-theme-light .auth-toggle-pw:focus-visible {
    color: var(--cyan);
    border-color: rgba(10, 143, 212, 0.35);
    background: #FFFFFF;
    box-shadow: 0 0 0 2px rgba(10, 143, 212, 0.12);
}

html.auth-theme-light .auth-input:-webkit-autofill,
html.auth-theme-light .auth-input:-webkit-autofill:hover,
html.auth-theme-light .auth-input:-webkit-autofill:focus,
html.auth-theme-light .auth-input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 1000px #FFFFFF inset !important;
    box-shadow: 0 0 0 1000px #FFFFFF inset !important;
}

html.auth-theme-light .auth-btn-outline {
    background: rgba(255, 255, 255, 0.7);
    color: var(--cyan);
}

html.auth-theme-light .auth-panel--showcase {
    background: linear-gradient(135deg, rgba(10, 143, 212, 0.06) 0%, rgba(82, 72, 200, 0.05) 100%);
    border-left-color: var(--border-glass);
}

html.auth-theme-light .auth-feature-card {
    background: rgba(255, 255, 255, 0.72);
}

html.auth-theme-light .auth-carousel-nav {
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-primary);
}

html.auth-theme-light .auth-dot {
    background: rgba(25, 44, 66, 0.22);
}

html.auth-theme-light .auth-alert--danger {
    background: rgba(200, 38, 31, 0.08);
    border-color: rgba(200, 38, 31, 0.22);
    color: #9B1C16;
}

html.auth-theme-light .auth-alert--success {
    background: rgba(14, 145, 112, 0.08);
    border-color: rgba(14, 145, 112, 0.22);
    color: #0A6B52;
}

html.auth-theme-light .auth-home-fab,
html.auth-theme-light .auth-theme-fab {
    background: rgba(255, 255, 255, 0.96);
    color: var(--cyan);
    box-shadow: var(--shadow-card);
}

html.auth-theme-light .auth-strength,
html.auth-theme-light .password-strength-meter {
    background: rgba(18, 50, 100, 0.08);
}

html.auth-theme-light .tenant-suggestions {
    background: rgba(255, 255, 255, 0.98);
}

html.auth-theme-light .suggestion-item:hover {
    background: rgba(10, 143, 212, 0.08);
}

body.auth-glass-page.theme-transitioning,
body.auth-glass-page.theme-transitioning .auth-card,
body.auth-glass-page.theme-transitioning .auth-input,
body.auth-glass-page.theme-transitioning .auth-home-fab,
body.auth-glass-page.theme-transitioning .auth-theme-fab {
    transition:
        background-color 0.28s ease,
        border-color 0.28s ease,
        color 0.28s ease,
        box-shadow 0.28s ease !important;
}
