/* Extracted from login.html so it can run under a strict CSP
   (style-src 'self' — no 'unsafe-inline' on <style> blocks).
   The original inline <style>...</style> in login.html is now a
   <link rel="stylesheet"> reference to this file. */

/* Fonts hoisted to HTML <link> in login.html for parallel fetch — see commit log. */

* { box-sizing: border-box; }
        body { font-family: 'Manrope', 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; display: flex; justify-content: center; align-items: center; min-height: 100vh; background-color: #0f172a; color: white; margin: 0; padding: 20px; }
        .card { background: #1e293b; padding: 40px; border-radius: 16px; border: 1px solid #334155; width: 100%; max-width: 360px; box-shadow: 0 10px 30px -12px rgba(0,0,0,0.6), 0 4px 10px -2px rgba(0,0,0,0.32); text-align: center; }
        h1 { font-family: 'Bricolage Grotesque', 'Segoe UI', sans-serif; font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; color: #38bdf8; margin-bottom: 25px; }
        /* 16px font on inputs prevents iOS auto-zoom on focus */
        input { width: 100%; background: #0f172a; border: 1px solid #334155; color: white; padding: 14px; margin-bottom: 12px; border-radius: 8px; font-size: 16px; outline: none; font-family: inherit; }
        input:focus { border-color: #38bdf8; }
        button { background: linear-gradient(135deg, #38bdf8, #0ea5e9); color: #0f172a; width: 100%; font-size: 1rem; padding: 14px; border-radius: 8px; border: none; font-weight: 700; letter-spacing: 0.01em; cursor: pointer; font-family: inherit; min-height: 48px; box-shadow: 0 8px 22px -6px rgba(56,189,248,0.40), 0 2px 6px rgba(0,0,0,0.3); transition: transform 0.18s cubic-bezier(.2,.8,.2,1), filter 0.18s ease; }
        button:hover { filter: brightness(1.06); transform: translateY(-1px); }
        button:active { transform: translateY(0); }
        button:disabled { background: #334155; color: #64748b; cursor: not-allowed; }
        p { margin-top: 15px; font-size: 0.85rem; color: #94a3b8; }
        a, .link-btn { color: #38bdf8; text-decoration: none; font-weight: bold; background: none; border: none; cursor: pointer; padding: 0; font-size: inherit; font-family: inherit; }
        a:hover, .link-btn:hover { text-decoration: underline; }
        .forgot-row { display: flex; justify-content: center; margin: -4px 0 12px; }
        .form-msg { font-size: 0.85rem; margin-top: 12px; min-height: 18px; display: none; }
        .form-msg.error { display: block; color: #f87171; }
        .form-msg.success { display: block; color: #10b981; }
        .form-msg.info {
            display: block; color: #fcd34d; line-height: 1.4;
            background: rgba(245,158,11,0.10); border: 1px solid rgba(245,158,11,0.25);
            border-radius: 8px; padding: 10px 12px;
        }

        /* Modal */
        .modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.85); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
        .modal-overlay.open { display: flex; }
        .modal-card { background: #1e293b; border: 1px solid #334155; border-radius: 16px; padding: 28px 24px; width: 100%; max-width: 380px; text-align: left; }
        .modal-title { font-size: 1.2rem; font-weight: 700; color: #38bdf8; margin-bottom: 6px; text-align: center; }
        .modal-desc { font-size: 0.85rem; color: #94a3b8; margin-bottom: 16px; text-align: center; line-height: 1.5; }
        .modal-actions { display: flex; gap: 8px; margin-top: 4px; }
        .modal-actions .cancel { background: #334155; color: #94a3b8; }
        .modal-actions .cancel:hover { background: #475569; color: #fff; }

        /* === MOBILE === */
        @media (max-width: 480px) {
            body { padding: 0; align-items: stretch; }
            .card { max-width: 100%; min-height: 100vh; min-height: 100dvh; border-radius: 0; border: none; padding: 32px 22px; display: flex; flex-direction: column; justify-content: center; box-shadow: none; }
            .modal-overlay { padding: 0; align-items: flex-end; }
            .modal-card { max-width: 100%; border-radius: 16px 16px 0 0; padding: 24px 22px 32px; }
            .modal-actions { gap: 10px; }
            .modal-actions button { padding: 14px; min-height: 48px; }
        }
        /* Visually-hidden — for accessibility-only labels on inputs
           that show their context via placeholder. Element is removed
           from view but read by screen readers. */
        .visually-hidden {
            position: absolute !important;
            width: 1px; height: 1px;
            padding: 0; margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        /* Phase 5: legal links + consent line on auth pages.
           Sits at the very bottom of the auth card; muted but reachable. */
        .auth-legal-links {
            margin-top: 22px;
            font-size: 0.78rem;
            color: rgba(148,163,184,0.85);
            text-align: center;
        }
        .auth-legal-links a,
        .auth-legal-links button { color: rgba(148,163,184,1); text-decoration: none; background: none; border: none; padding: 0; font: inherit; cursor: pointer; width: auto; min-height: 0; display: inline; box-shadow: none; }
        .auth-legal-links a:hover,
        .auth-legal-links button:hover { color: var(--accent, #38bdf8); text-decoration: underline; }
        .auth-legal-links span { margin: 0 8px; opacity: 0.6; }

        .auth-legal-consent {
            margin-top: 16px;
            font-size: 0.78rem;
            color: rgba(148,163,184,0.85);
            text-align: center;
            line-height: 1.5;
        }
        .auth-legal-consent a { color: rgba(148,163,184,1); text-decoration: underline; }
        .auth-legal-consent a:hover { color: var(--accent, #38bdf8); }

        /* === GOOGLE SIGN-IN ===
           Sits below the password form, separated by a hairline "or"
           divider. The button uses Google's brand-approved colours
           (white background, grey border) to match what users expect
           from Google's own button — overriding the global gradient
           button style above. */
        .google-signin-section {
            margin-top: 18px;
        }
        .auth-divider {
            display: flex;
            align-items: center;
            gap: 10px;
            margin: 6px 0 14px;
            color: #94a3b8;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }
        .auth-divider::before,
        .auth-divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: #334155;
        }
        /* Overlay pattern — our custom-styled button is what the user sees;
           Google's invisible GIS-rendered button sits on top to capture
           the actual click. See login.html for the full explanation. */
        .google-signin-wrapper {
            position: relative;
            /* Stack context for the absolute-positioned render target. */
            isolation: isolate;
        }
        .google-signin-btn {
            /* The visible custom button. Restored to the original look the
               user expects (white, multi-coloured G, "Continue with Google"
               label) since GIS's brand-mandated button looks foreign here. */
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            width: 100%;
            background: #fff;
            color: #1f2937;
            border: 1px solid #d1d5db;
            box-shadow: 0 1px 2px rgba(0,0,0,0.18);
            font-weight: 600;
            transition: background 0.15s ease, border-color 0.15s ease, transform 0.18s cubic-bezier(.2,.8,.2,1);
            /* pointer-events:none → clicks pass through to Google's
               invisible button positioned on top of this. tabindex="-1"
               on the <button> already removes it from focus order. */
            pointer-events: none;
        }
        .google-signin-btn:hover {
            background: #f9fafb;
            border-color: #9ca3af;
            filter: none;
        }
        .google-signin-icon { flex: 0 0 18px; display: inline-block; }
        .google-signin-label { font-size: 0.95rem; }

        /* Hover the wrapper → style the visible button (since the visible
           button itself can't be hovered due to pointer-events:none). */
        .google-signin-wrapper:hover .google-signin-btn {
            background: #f9fafb;
            border-color: #9ca3af;
        }
        /* Keyboard focus on Google's invisible button → ring on ours. */
        .google-signin-wrapper:focus-within .google-signin-btn {
            outline: 2px solid #38bdf8;
            outline-offset: 2px;
        }

        /* Google's renderButton output, positioned exactly over the visible
           button with opacity:0. Clicks land here and trigger the popup
           (desktop) or redirect (mobile). Sized to match the visible button
           dimensions via width:100% on the wrapper.
           overflow:hidden is REQUIRED — Google's internal wrapper may
           render its fallback SVG / accessibility labels much larger than
           the slot (up to ~280px square), and without clipping those
           overflow areas would catch clicks meant for the "Claim one" and
           "Appeal a Ban" links sitting below the wrapper. */
        #google-signin-render-target {
            position: absolute;
            inset: 0;
            opacity: 0;
            z-index: 2;
            overflow: hidden;
        }
        #google-signin-render-target > div,
        #google-signin-render-target iframe {
            width: 100% !important;
            height: 100% !important;
        }
