/* ═══════════════════════════════════════════════════
   AUTH MODULE CSS — Midnight Copper 3D Glassmorphism
   ═══════════════════════════════════════════════════ */
.auth-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
    perspective: 1200px;
    z-index: var(--z-auth-base, var(--z-above, 10));
    position: relative;
}

.auth-gate.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 3D Glassmorphic Card */
.auth-card {
    width: min(420px, 90vw);
    max-width: 420px;
    box-sizing: border-box;
    background: rgba(10, 14, 26, 0.65);
    border: 1px solid rgba(var(--copper-rgb), 0.2);
    border-radius: 24px;
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    box-shadow: 0 0 120px rgba(var(--copper-rgb), 0.08), inset 0 0 40px rgba(255,255,255,0.02);
    padding: 48px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
    will-change: transform;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .auth-card,
    .access-granted-overlay,
    .bio-modal,
    .global-theme-btn {
        background: rgba(10, 14, 26, 0.92);
    }
}

.auth-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--copper), #b76e79, transparent);
    border-radius: 24px 24px 0 0;
}

/* Fragment Shards Effect */
.auth-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%, rgba(var(--copper-rgb),0.02) 100%);
    pointer-events: none;
    transform: translateZ(1px);
}

.auth-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, rgba(10, 20, 36, .96), rgba(16, 34, 52, .8));
    border: 1px solid rgba(56, 189, 248, 0.24);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(34, 211, 238, 0.16);
    transform: translateZ(40px);
}

.auth-logo img {
    width: 28px;
    height: 28px;
    display: block;
}

.auth-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #f0ece4;
    transform: translateZ(30px);
}

.auth-subtitle {
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 32px;
    transform: translateZ(20px);
}

.auth-step {
    display: none;
    animation: fadeIn 0.4s ease forwards;
    transform-style: preserve-3d;
}

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

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

.auth-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(var(--copper-rgb), 0.15);
    border-radius: 12px;
    color: #f0ece4;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
    margin-bottom: 16px;
    font-family: inherit;
    text-align: center;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

.auth-input:focus {
    border-color: var(--copper);
    background: rgba(var(--copper-rgb), 0.08);
    box-shadow: 0 0 20px rgba(var(--copper-rgb), 0.15), inset 0 2px 10px rgba(0,0,0,0.2);
}

.otp-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.otp-input {
    width: 44px;
    height: 52px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(var(--copper-rgb), 0.15);
    border-radius: 10px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #f0ece4;
    outline: none;
    transition: all 0.3s;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}

.otp-input:focus {
    border-color: var(--copper);
    background: rgba(var(--copper-rgb), 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--copper-rgb), 0.2), inset 0 2px 8px rgba(0,0,0,0.2);
}

.auth-input:focus-visible,
.otp-input:focus-visible,
.auth-btn:focus-visible,
.google-sso-btn:focus-visible,
.biometric-btn:focus-visible,
.magic-link-btn:focus-visible,
.sector-card:focus-visible,
.global-theme-btn:focus-visible {
    outline: 2px solid var(--copper);
    outline-offset: 2px;
}

.auth-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--copper), #b76e79);
    color: #0a0e1a;
    font-weight: 700;
    font-size: 15px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 16px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(var(--copper-rgb), 0.3);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.auth-status {
    font-size: 13px;
    min-height: 20px;
    color: #9ca3af;
    transform: translateZ(10px);
}

.auth-status.error { color: #f87171; }
.auth-status.success { color: #22c55e; }

.auth-entitlement-host {
    margin-top: 14px;
    text-align: left;
}

.auth-entitlement-host--compact {
    margin-top: 16px;
}

.auth-entitlement {
    padding: 14px 14px 12px;
    border-radius: 16px;
    border: 1px solid rgba(var(--copper-rgb), 0.16);
    background: rgba(255, 255, 255, 0.035);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.auth-entitlement--loading {
    border-color: rgba(34, 211, 238, 0.24);
    background: rgba(34, 211, 238, 0.06);
}

.auth-entitlement--warn {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.08);
}

.auth-entitlement__eyebrow {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.16em;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
}

.auth-entitlement__title {
    font-size: 14px;
    font-weight: 700;
    color: #f0ece4;
    margin-bottom: 6px;
}

.auth-entitlement__summary {
    font-size: 12px;
    line-height: 1.55;
    color: #cbd5e1;
}

.auth-entitlement__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.auth-entitlement__pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: #dbe4ef;
    font-size: 11px;
    line-height: 1;
}

.auth-entitlement__pill.is-warn {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.12);
}

.auth-entitlement__note {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255,255,255,0.72);
}

.auth-entitlement__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.auth-entitlement__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: #f0ece4;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.auth-entitlement__link:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--copper-rgb), 0.35);
    background: rgba(var(--copper-rgb), 0.08);
}

.auth-entitlement__link--primary {
    border-color: rgba(var(--copper-rgb), 0.3);
    background: rgba(var(--copper-rgb), 0.12);
    color: #ffd8bb;
}

.auth-footer {
    margin-top: 32px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.2);
    transform: translateZ(10px);
}

/* ═══════════════════════════════════════════════════
   SCI-FI ACCESS GRANTED OVERLAY (Task 1.6)
   ═══════════════════════════════════════════════════ */
.access-granted-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-auth-overlay, var(--z-modal, 1000));
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(10, 14, 26, 0.95) 100%);
    backdrop-filter: blur(8px);
    transition: opacity 0.5s ease;
}

.access-granted-overlay h1 {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.5rem;
    text-shadow: 0 0 40px rgba(16, 185, 129, 0.8), 4px 4px 0px rgba(255, 255, 255, 0.1);
    animation: none;
}

.access-granted-scanline {
    position: absolute;
    width: 100%;
    height: 8px;
    background: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
    opacity: 0.6;
    animation: none;
}

.access-granted-overlay.active h1 {
    animation: glitchText 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both 4;
}

.access-granted-overlay.active .access-granted-scanline {
    animation: scanline 2s linear 4;
}

@keyframes glitchText {
    0% { transform: translate(0); }
    20% { transform: translate(-4px, 4px); filter: hue-rotate(90deg); }
    40% { transform: translate(-4px, -4px); filter: hue-rotate(-90deg); }
    60% { transform: translate(4px, 4px); opacity: 0.8; }
    80% { transform: translate(4px, -4px); opacity: 1; }
    100% { transform: translate(0); }
}

@keyframes scanline {
    0% { top: -10%; }
    100% { top: 110%; }
}

/* ═══════════════════════════════════════════════════
   GOOGLE SSO & BIOMETRIC / PASSKEY SCANNER (Task 2.1)
   ═══════════════════════════════════════════════════ */
.google-sso-btn {
    width: 100%;
    margin-top: 16px;
    padding: 13px 20px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    color: #4b5563;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.google-sso-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.google-sso-btn svg {
    width: 22px;
    height: 22px;
}
.biometric-btn {
    width: 100%;
    margin-top: 20px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.biometric-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.1);
}

.biometric-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.bio-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-auth-modal, 1010);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.bio-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.bio-scanner {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 30px;
    border: 2px solid rgba(34, 211, 238, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 30px rgba(34, 211, 238, 0.1), 0 0 40px rgba(34, 211, 238, 0.1);
}

.bio-icon {
    font-size: 64px;
    color: rgba(34, 211, 238, 0.4);
    transition: color 0.3s;
}

.bio-laser {
    position: absolute;
    left: 0;
    width: 100%;
    height: 4px;
    background: #22d3ee;
    box-shadow: 0 0 20px 4px #22d3ee;
    animation: none;
}

.bio-modal.active .bio-laser {
    animation: scanLaser 1.5s ease-in-out infinite alternate;
}

.bio-modal.success .bio-scanner {
    border-color: #10b981;
    box-shadow: inset 0 0 30px rgba(16, 185, 129, 0.2), 0 0 40px rgba(16, 185, 129, 0.2);
}

.bio-modal.success .bio-laser {
    background: #10b981;
    box-shadow: 0 0 20px 4px #10b981;
    animation: none;
    top: 0;
    height: 100%;
    transform: none;
    opacity: 0.2;
}

.bio-modal.success .bio-icon {
    color: #10b981;
    text-shadow: 0 0 20px #10b981;
}

.bio-text {
    margin-top: 30px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    color: #22d3ee;
    letter-spacing: 2px;
    text-transform: uppercase;
}

@keyframes scanLaser {
    0% { top: -10%; }
    100% { top: 110%; }
}

/* ═══════════════════════════════════════════════════
   PROGRESSIVE PROFILING & MAGIC LINK (Task 2.2 & 2.3)
   ═══════════════════════════════════════════════════ */
.sector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.sector-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateZ(5px);
}

.sector-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(34, 211, 238, 0.4);
}

.sector-card.active {
    background: radial-gradient(circle at top right, rgba(34, 211, 238, 0.15), transparent);
    border-color: #22d3ee;
    color: #22d3ee;
    box-shadow: inset 0 0 15px rgba(34, 211, 238, 0.1), 0 0 20px rgba(34, 211, 238, 0.15);
    transform: scale(1.05) translateZ(10px);
}

.magic-link-btn {
    background: none;
    border: none;
    color: rgba(34, 211, 238, 0.7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 14px;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 4px;
    transition: color 0.2s;
    width: 100%;
    text-align: center;
}

.magic-link-btn:hover {
    color: #22d3ee;
}

/* ═══════════════════════════════════════════════════
   LIGHT MODE (GÜNDÜZ MODU)
   Canonical: [data-theme="light"] on <html>
   ═══════════════════════════════════════════════════ */
[data-theme="light"] body {
    background: #f8fafc !important;
}

[data-theme="light"] .auth-card {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(var(--copper-rgb), 0.3) !important;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.05), inset 0 0 20px rgba(255, 255, 255, 1) !important;
}

[data-theme="light"] .auth-title {
    color: #0f172a !important;
}

[data-theme="light"] .auth-subtitle {
    color: #475569 !important;
}

[data-theme="light"] .auth-logo {
    box-shadow: 0 0 30px rgba(var(--copper-rgb), 0.4) !important;
    color: #fff !important;
}

[data-theme="light"] .auth-input,
[data-theme="light"] .otp-input {
    background: #fff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05) !important;
}

[data-theme="light"] .auth-input:focus,
[data-theme="light"] .otp-input:focus {
    border-color: var(--copper) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(var(--copper-rgb), 0.2), inset 0 1px 2px rgba(0,0,0,0.05) !important;
}

[data-theme="light"] .auth-footer {
    color: #64748b !important;
}

[data-theme="light"] .auth-entitlement {
    background: rgba(255,255,255,0.88) !important;
    border-color: rgba(148, 163, 184, 0.26) !important;
}

[data-theme="light"] .auth-entitlement__eyebrow {
    color: #64748b !important;
}

[data-theme="light"] .auth-entitlement__title {
    color: #0f172a !important;
}

[data-theme="light"] .auth-entitlement__summary,
[data-theme="light"] .auth-entitlement__note {
    color: #334155 !important;
}

[data-theme="light"] .auth-entitlement__pill {
    background: rgba(15, 23, 42, 0.04) !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
    color: #0f172a !important;
}

[data-theme="light"] .auth-entitlement__link {
    color: #0f172a !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    background: rgba(15, 23, 42, 0.04) !important;
}

/* Light Mode Overrides for Transparency Buttons (Passkey & Magic Link) */
[data-theme="light"] .biometric-btn,
[data-theme="light"] .magic-link-btn {
    color: #0f172a !important;
    font-weight: 600 !important;
}

[data-theme="light"] .biometric-btn {
    border-color: rgba(15, 23, 42, 0.2) !important;
    background: rgba(15, 23, 42, 0.04) !important;
}

[data-theme="light"] .biometric-btn:hover {
    background: rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.1) !important;
}

[data-theme="light"] .google-sso-btn {
    border-color: rgba(15, 23, 42, 0.15) !important;
    color: #0f172a !important;
}

/* Theme Toggle Button */
.global-theme-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: var(--z-auth-theme-btn, var(--z-top, 9999));
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 14, 26, 0.6);
    backdrop-filter: blur(12px);
    color: #f0ece4;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.global-theme-btn:hover {
    transform: scale(1.1) rotate(15deg);
    background: rgba(var(--copper-rgb), 0.2);
    border-color: rgba(var(--copper-rgb), 0.4);
}

[data-theme="light"] .global-theme-btn {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
    color: #f59e0b; /* Sun Yellow */
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .auth-card {
        width: min(420px, 94vw);
        padding: clamp(22px, 5vw, 34px) clamp(16px, 4vw, 26px);
        border-radius: 20px;
    }

    .auth-title {
        font-size: clamp(20px, 5.6vw, 24px);
    }

    .auth-subtitle {
        margin-bottom: 24px;
    }

    .otp-input {
        width: 40px;
        height: 48px;
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-step,
    .access-granted-overlay.active h1,
    .access-granted-overlay.active .access-granted-scanline,
    .bio-modal.active .bio-laser {
        animation: none !important;
    }

    .auth-card,
    .auth-btn,
    .global-theme-btn {
        transition: none !important;
    }
}

@media (max-width: 420px) {
    .otp-group {
        gap: 6px;
    }

    .otp-input {
        width: 36px;
        height: 44px;
        font-size: 16px;
    }
}

