/* =============================================================
   QRGuard — Auth Stylesheet v3
   All selectors scoped under body.auth-page for higher specificity
   so existing user_style.css can't break the form layout.
   ============================================================= */

body.auth-page {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f6f7f9;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

body.auth-page * { box-sizing: border-box; }

/* ─── Nav (clean & minimal) ──────────────────────────────── */
body.auth-page .main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 40px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}
body.auth-page .main-nav .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #0f172a;
}
body.auth-page .main-nav .logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.025em;
}
body.auth-page .nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
body.auth-page .nav-item a {
    padding: 9px 16px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all .2s;
}
body.auth-page .nav-item a:hover {
    color: #0f172a;
    background: #f1f5f9;
}

/* ─── Auth shell ─────────────────────────────────────────── */
body.auth-page .auth-container {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    min-height: calc(100vh - 81px);
    position: relative;
    overflow: hidden;
}

/* ─── Banner (left — Scanner Viewport with wavy partition) ─ */
body.auth-page .auth-banner {
    grid-column: 1 / 2;
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: 56px 56px 48px;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse 90% 70% at 50% 110%, rgba(59, 130, 246, 0.32) 0%, transparent 65%),
        radial-gradient(ellipse 70% 50% at 100% 0%, rgba(34, 211, 238, 0.08) 0%, transparent 60%),
        linear-gradient(180deg, #07101f 0%, #0a1428 50%, #122144 100%);
    /* Extend banner 60px right so wave can bulge into form padding area */
    width: calc(100% + 60px);
    /* Wavy right edge */
    -webkit-clip-path: url(#bannerWaveClip);
    clip-path: url(#bannerWaveClip);
    z-index: 2;
}

/* Corner brackets — scanner viewfinder feel */
body.auth-page .scan-corner {
    position: absolute;
    width: 36px;
    height: 36px;
    z-index: 2;
    pointer-events: none;
}
body.auth-page .scan-corner::before,
body.auth-page .scan-corner::after {
    content: "";
    position: absolute;
    background: #67e8f9;
    box-shadow: 0 0 12px rgba(103, 232, 249, 0.5);
    opacity: 0.85;
}
body.auth-page .scan-corner::before { width: 100%; height: 2px; }
body.auth-page .scan-corner::after  { width: 2px; height: 100%; }

body.auth-page .scan-corner.tl { top: 24px; left: 24px; }
body.auth-page .scan-corner.tl::before { top: 0; left: 0; }
body.auth-page .scan-corner.tl::after  { top: 0; left: 0; }

body.auth-page .scan-corner.tr { top: 24px; right: 24px; }
body.auth-page .scan-corner.tr::before { top: 0; right: 0; }
body.auth-page .scan-corner.tr::after  { top: 0; right: 0; }

body.auth-page .scan-corner.bl { bottom: 24px; left: 24px; }
body.auth-page .scan-corner.bl::before { bottom: 0; left: 0; }
body.auth-page .scan-corner.bl::after  { bottom: 0; left: 0; }

body.auth-page .scan-corner.br { bottom: 24px; right: 24px; }
body.auth-page .scan-corner.br::before { bottom: 0; right: 0; }
body.auth-page .scan-corner.br::after  { bottom: 0; right: 0; }

/* Animated scan line — the signature element */
body.auth-page .scan-beam {
    position: absolute;
    left: 60px;
    right: 60px;
    height: 1.5px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(103, 232, 249, 0.7) 30%,
        rgba(103, 232, 249, 0.9) 50%,
        rgba(103, 232, 249, 0.7) 70%,
        transparent 100%);
    box-shadow: 0 0 12px rgba(103, 232, 249, 0.5);
    z-index: 2;
    pointer-events: none;
    animation: scanBeam 5s cubic-bezier(.65,0,.35,1) infinite;
}
@keyframes scanBeam {
    0%   { top: 5%;  opacity: 0; }
    8%   { opacity: 0.8; }
    50%  { top: 95%; opacity: 0.8; }
    58%  { opacity: 0; }
    100% { top: 5%;  opacity: 0; }
}

/* Top header: brand + status */
body.auth-page .banner-header {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
body.auth-page .banner-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
}
body.auth-page .banner-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}
body.auth-page .banner-brand-text {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #fff;
}

body.auth-page .status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid rgba(103, 232, 249, 0.35);
    background: rgba(103, 232, 249, 0.08);
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #67e8f9;
    backdrop-filter: blur(6px);
}
body.auth-page .status-pill .status-dot {
    width: 7px;
    height: 7px;
    background: #22d3ee;
    border-radius: 50%;
    box-shadow: 0 0 8px #22d3ee, 0 0 16px rgba(34, 211, 238, 0.5);
    animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1;   transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.85); }
}

/* Headline */
body.auth-page .banner-headline {
    position: relative;
    z-index: 3;
    margin-top: 72px;
    max-width: 540px;
}
body.auth-page .banner-eyebrow {
    display: inline-block;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #67e8f9;
    margin-bottom: 20px;
    padding-left: 16px;
    position: relative;
}
body.auth-page .banner-eyebrow::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    width: 8px;
    height: 1.5px;
    background: #67e8f9;
    transform: translateY(-50%);
}
body.auth-page .banner-headline h1 {
    font-size: 60px;
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.035em;
    margin: 0 0 24px 0;
    color: #fff;
}
body.auth-page .banner-headline h1 em {
    font-style: normal;
    background: linear-gradient(135deg, #67e8f9 0%, #3b82f6 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}
body.auth-page .banner-headline p {
    font-size: 16.5px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    max-width: 460px;
    font-weight: 400;
}

/* Robot — positioned at CONTAINER level, sits over the wavy boundary
   (cannot be inside .auth-banner because banner is clip-pathed).
   Sized so right edge stops just before the form card (which is centered
   in column 2 with max-width 440px, so its left edge is ~115px from boundary). */
body.auth-page .banner-robot {
    position: absolute;
    bottom: 0;
    left: calc(53.49% - 240px);
    width: 350px;
    max-width: 26vw;
    z-index: 5;
    pointer-events: none;
    filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.45));
}

/* Bottom stats — constrained to left, robot-safe area */
body.auth-page .banner-stats {
    position: relative;
    z-index: 3;
    margin-top: auto;
    padding-top: 32px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    max-width: 46%;
}
body.auth-page .banner-stat {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 8px;
}
body.auth-page .banner-stat i {
    color: #67e8f9;
    font-size: 12px;
}
body.auth-page .banner-stat strong {
    color: #fff;
    font-weight: 700;
}
body.auth-page .banner-stat-sep {
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, 0.15);
}

/* ─── Form side ──────────────────────────────────────────── */
body.auth-page .auth-form-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: #f6f7f9;
}
body.auth-page .auth-box {
    width: 100%;
    max-width: 440px;
}
body.auth-page .auth-header {
    margin-bottom: 36px;
}
body.auth-page .auth-header h2 {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0a0e1a;
    margin: 0 0 10px 0;
    line-height: 1.1;
}
body.auth-page .auth-header p {
    font-size: 15px;
    color: #64748b;
    margin: 0;
    line-height: 1.55;
}

/* Alerts */
body.auth-page .auth-alert {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 11px;
    line-height: 1.4;
}
body.auth-page .auth-alert.error {
    background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
}
body.auth-page .auth-alert.error i { color: #dc2626; }
body.auth-page .auth-alert.success {
    background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d;
}
body.auth-page .auth-alert.success i { color: #16a34a; }

/* Form fields — scoped to avoid conflicts with user_style.css */
body.auth-page .auth-form { display: block; width: 100%; }
body.auth-page .auth-form .input-group {
    display: block;
    width: 100%;
    margin-bottom: 22px;
}
body.auth-page .auth-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 9px;
    width: auto;
    letter-spacing: -0.005em;
}
body.auth-page .auth-form .input-wrapper {
    position: relative;
    display: block;
    width: 100%;
}
body.auth-page .auth-form .input-wrapper > i:first-child {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
    pointer-events: none;
    transition: color .2s;
    z-index: 2;
}
body.auth-page .auth-form .input-wrapper input {
    width: 100%;
    padding: 16px 18px 16px 48px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
    font-family: inherit;
    color: #0f172a;
    outline: none;
    transition: all .18s;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
body.auth-page .auth-form .input-wrapper input::placeholder { color: #94a3b8; }
body.auth-page .auth-form .input-wrapper input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 1px 2px rgba(15, 23, 42, 0.03);
}
body.auth-page .auth-form .input-wrapper:focus-within > i:first-child { color: #2563eb; }
body.auth-page .auth-form .input-wrapper input[type="password"] {
    padding-right: 48px;
    letter-spacing: 0.05em;
}
body.auth-page .auth-form .toggle-pw {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    font-size: 14px;
    z-index: 2;
}
body.auth-page .auth-form .toggle-pw:hover { color: #2563eb; }

/* Forgot link */
body.auth-page .auth-actions {
    display: flex;
    justify-content: flex-end;
    margin: -8px 0 22px 0;
}
body.auth-page .forgot-link {
    font-size: 13px;
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}
body.auth-page .forgot-link:hover { text-decoration: underline; }

/* CAPTCHA */
body.auth-page .captcha-box {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 22px;
    transition: .2s;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
body.auth-page .captcha-box:hover { border-color: #cbd5e1; }
body.auth-page .captcha-box.verified { border-color: #bfdbfe; background: #eff6ff; }
body.auth-page .captcha-checkbox {
    width: 22px; height: 22px;
    border: 2px solid #c5c5c5;
    border-radius: 3px;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: .2s;
}
body.auth-page .captcha-checkbox svg { opacity: 0; transition: .2s; }
body.auth-page .captcha-box.verified .captcha-checkbox { background: #2563eb; border-color: #2563eb; }
body.auth-page .captcha-box.verified .captcha-checkbox svg { opacity: 1; }
body.auth-page .captcha-spinner {
    width: 22px; height: 22px;
    border: 2.5px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    flex-shrink: 0;
    display: none;
    animation: spin .7s linear infinite;
}
body.auth-page .captcha-box.loading .captcha-checkbox { display: none; }
body.auth-page .captcha-box.loading .captcha-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
body.auth-page .captcha-label { font-size: 14px; color: #334155; font-weight: 500; flex: 1; }
body.auth-page .captcha-branding { display: flex; align-items: center; gap: 6px; opacity: .6; }
body.auth-page .rc-logo { width: 26px; height: 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; }
body.auth-page .rc-logo span { border-radius: 1px; }
body.auth-page .rc-logo .c1 { background: #4285f4; }
body.auth-page .rc-logo .c2 { background: #ea4335; }
body.auth-page .rc-logo .c3 { background: #fbbc04; }
body.auth-page .rc-logo .c4 { background: #34a853; }
body.auth-page .captcha-branding p { font-size: 8.5px; color: #64748b; margin: 0; line-height: 1.25; }

/* Submit button */
body.auth-page .auth-btn {
    width: 100%;
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: .2s;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: -0.005em;
}
body.auth-page .auth-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255,255,255,0.15);
}
body.auth-page .auth-btn:disabled { cursor: not-allowed; opacity: .5; }

body.auth-page .auth-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 14px;
    color: #64748b;
}
body.auth-page .auth-footer a { color: #2563eb; font-weight: 600; text-decoration: none; }
body.auth-page .auth-footer a:hover { text-decoration: underline; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
    body.auth-page .auth-container {
        grid-template-columns: 1fr;
        overflow: visible;
    }
    body.auth-page .auth-banner {
        /* On stacked layout: no wavy partition, no width extension */
        width: 100%;
        -webkit-clip-path: none;
        clip-path: none;
        min-height: 540px;
        padding: 40px 240px 32px 40px; /* reserve right space for robot */
    }
    body.auth-page .banner-headline {
        margin-top: 40px;
        max-width: none;
    }
    body.auth-page .banner-headline h1 { font-size: 44px; }
    body.auth-page .banner-headline p { font-size: 15px; }
    body.auth-page .banner-stats { max-width: 100%; }
    body.auth-page .banner-robot {
        /* On stacked: anchor inside the banner area (top-positioned, not bottom) */
        left: auto;
        right: 0;
        top: 240px;
        bottom: auto;
        width: 240px;
        max-width: 240px;
    }
    body.auth-page .scan-corner { width: 28px; height: 28px; }
}
@media (max-width: 640px) {
    body.auth-page .main-nav { padding: 14px 18px; }
    body.auth-page .nav-links { display: none; }
    body.auth-page .auth-banner {
        padding: 28px 160px 24px 22px; /* tighter right reservation */
        min-height: 480px;
    }
    body.auth-page .banner-header { flex-wrap: wrap; gap: 12px; }
    body.auth-page .status-pill { font-size: 10px; padding: 5px 10px; }
    body.auth-page .banner-headline {
        margin-top: 24px;
        max-width: 100%;
    }
    body.auth-page .banner-headline h1 { font-size: 30px; line-height: 1.05; }
    body.auth-page .banner-headline p { font-size: 14px; }
    body.auth-page .banner-stats {
        max-width: 100%;
        gap: 12px;
        padding-top: 18px;
    }
    body.auth-page .banner-stat { font-size: 10.5px; }
    body.auth-page .scan-beam { left: 22px; right: 22px; }
    body.auth-page .scan-corner.tl, body.auth-page .scan-corner.bl { left: 14px; }
    body.auth-page .scan-corner.tl { top: 14px; }
    body.auth-page .scan-corner.bl { bottom: 14px; }
    body.auth-page .banner-robot {
        right: -10px;
        top: 200px;
        width: 170px;
        max-width: 170px;
        opacity: 0.9;
    }
    body.auth-page .auth-form-section { padding: 32px 22px; }
    body.auth-page .auth-header h2 { font-size: 28px; }
}