        :root {
            --bg-deep:        #030711;
            --bg-base:        #0a0f1e;
            --bg-elevated:    #111827;
            --bg-surface:     rgba(255,255,255,0.04);
            --text-primary:   #f0f4ff;
            --text-secondary: rgba(176,190,230,0.78);
            --text-muted:     rgba(148,163,210,0.79); /* A93b: 4.5:1 on every dark ground */
            --border-default: rgba(255,255,255,0.10);
            --border-strong:  rgba(255,255,255,0.18);
            --accent-blue:    #4f8fff;
            --accent-purple:  #7c5cff;
            --accent-green:   #2dd98a;
            --accent-amber:   #f5a623;
            --accent-red:     #ff4f6a;
            --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
            --font-sans:    'Onest', system-ui, sans-serif;
            --font-mono:    'Geist Mono', ui-monospace, monospace;
            --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
            --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        @media (prefers-color-scheme: light) {
            :root:not([data-theme="dark"]) {
                --bg-deep:        #e8eef9;
                --bg-base:        #f7f9fc;
                --bg-elevated:    #ffffff;
                --bg-surface:     rgba(15,30,70,0.04);
                --text-primary:   #0a0f1e;
                --text-secondary: rgba(15,30,70,0.72);
                --text-muted:     rgba(15,30,70,0.63); /* A93b: 4.5:1 on every light ground */
                --border-default: rgba(15,30,70,0.10);
                --border-strong:  rgba(15,30,70,0.18);
            }
        }
        html[data-theme="light"] {
            --bg-deep:        #e8eef9;
            --bg-base:        #f7f9fc;
            --bg-elevated:    #ffffff;
            --bg-surface:     rgba(15,30,70,0.04);
            --text-primary:   #0a0f1e;
            --text-secondary: rgba(15,30,70,0.72);
            --text-muted:     rgba(15,30,70,0.63); /* A93b: 4.5:1 on every light ground */
            --border-default: rgba(15,30,70,0.10);
            --border-strong:  rgba(15,30,70,0.18);
        }

        *, *::before, *::after { box-sizing: border-box; }
        html, body {
            margin: 0; padding: 0;
            background: radial-gradient(ellipse at top, #142060 0%, var(--bg-deep) 70%);
            color: var(--text-primary);
            font-family: var(--font-sans);
            min-height: 100vh;
            -webkit-font-smoothing: antialiased;
            -webkit-tap-highlight-color: transparent;
        }
        html[data-theme="light"] body,
        @media (prefers-color-scheme: light) {
            html:not([data-theme="dark"]) body {
                background: linear-gradient(180deg, #e8eef9 0%, #f7f9fc 50%);
            }
        }
        html[data-theme="light"] body { background: linear-gradient(180deg, #e8eef9 0%, #f7f9fc 50%); }

        /* Split layout — single column on mobile, two-column on desktop.
           Mobile keeps the existing centred form unchanged. Desktop adds
           a brand panel on the left so the page doesn't float in empty
           space on big screens. */
        .split {
            min-height: 100vh;
            display: flex; flex-direction: column;
        }
        .brand-side { display: none; }

        .app {
            max-width: 420px;
            margin: 0 auto;
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;  /* vertically centres the logo + form in the available height */
            width: 100%;
            padding: calc(env(safe-area-inset-top) + 24px) 24px calc(env(safe-area-inset-bottom) + 28px);
        }

        @media (min-width: 820px) {
            .split {
                flex-direction: row;
                min-height: 100vh;
            }
            .brand-side {
                display: flex;
                flex: 1 1 50%;
                flex-direction: column;
                justify-content: center;
                padding: 60px 64px;
                background:
                    radial-gradient(circle at 30% 20%, rgba(124,92,255,0.18), transparent 55%),
                    radial-gradient(circle at 70% 80%, rgba(34,211,238,0.10), transparent 55%),
                    linear-gradient(135deg, #0e1a3e 0%, #050912 100%);
                border-right: 1px solid var(--border-default);
                position: relative;
                overflow: hidden;
            }
            html[data-theme="light"] .brand-side,
            html:not([data-theme="dark"]) .brand-side {
                background:
                    radial-gradient(circle at 30% 20%, rgba(124,92,255,0.12), transparent 55%),
                    radial-gradient(circle at 70% 80%, rgba(34,211,238,0.08), transparent 55%),
                    linear-gradient(135deg, #f0f3fa 0%, #e8eef9 100%);
            }
            .brand-mark {
                width: 80px; height: 80px;
                border-radius: 20px;
                background: linear-gradient(135deg, #1e2856, #0a0f1e);
                display: flex; align-items: center; justify-content: center;
                margin-bottom: 28px;
                box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
                overflow: hidden;
            }
            .brand-mark img { width: 100%; height: 100%; object-fit: cover; }
            .brand-side h2 {
                font-family: var(--font-display);
                font-weight: 800;
                font-size: 44px;
                letter-spacing: -0.028em;
                line-height: 1.05;
                margin: 0 0 14px;
                color: var(--text-primary);
                max-width: 500px;
            }
            .brand-side .tagline {
                color: var(--text-secondary);
                font-size: 18px;
                line-height: 1.55;
                max-width: 460px;
                margin: 0 0 40px;
                font-weight: 500;
            }
            html[data-theme="light"] .brand-side .tagline,
            html:not([data-theme="dark"]) .brand-side .tagline {
                color: rgba(15,30,70,0.78);
            }
            .brand-side .features {
                display: flex; flex-direction: column; gap: 14px;
                max-width: 460px;
            }
            .brand-side .feature {
                display: flex; align-items: center; gap: 12px;
                font-size: 14px; color: var(--text-secondary);
            }
            .brand-side .feature .ico {
                width: 32px; height: 32px;
                border-radius: 9px;
                background: rgba(79,143,255,0.10);
                color: var(--accent-blue);
                display: inline-flex; align-items: center; justify-content: center;
                flex-shrink: 0;
                border: 1px solid rgba(79,143,255,0.20);
            }
            .brand-side .feature .ico.cyan   { background: rgba(34,211,238,0.10);  color: var(--accent-cyan);   border-color: rgba(34,211,238,0.22); }
            .brand-side .feature .ico.purple { background: rgba(124,92,255,0.10);   color: var(--accent-purple); border-color: rgba(124,92,255,0.22); }
            .brand-side .feature strong {
                color: var(--text-primary); font-weight: 600;
                display: block; margin-bottom: 1px;
            }

            .form-side {
                flex: 1 1 50%;
                display: flex; align-items: center; justify-content: center;
                padding: 40px;
            }
            .app {
                margin: 0;
                padding: 0;
                min-height: auto;
            }
            /* On desktop the centered icon at the top of the form is redundant
               with the big brand-mark on the left — hide it to keep the form
               focused on the inputs. */
            .form-side .app > .logo { display: none; }
            .form-side .app > .hero { margin-top: 0; margin-bottom: 28px; text-align: left; }
            .form-side .app > .hero h1 { font-size: 32px; }
        }

        .logo {
            margin: 0 auto 22px;
            width: 64px; height: 64px;
            border-radius: 16px;
            background: linear-gradient(135deg, #1e2856, #0a0f1e);
            display: flex; align-items: center; justify-content: center;
            box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
            overflow: hidden;
        }
        .logo img { width: 100%; height: 100%; object-fit: cover; }

        .hero {
            text-align: center;
            margin-bottom: 32px;
        }
        .hero h1 {
            font-family: var(--font-display);
            font-weight: 700; font-size: 26px;
            letter-spacing: -0.02em; line-height: 1.15;
            margin: 0 0 6px;
        }
        .hero p {
            color: var(--text-secondary);
            font-size: 14px; line-height: 1.55;
            margin: 0;
        }

        /* Status banners — appear above the form when there's something to say */
        .banner {
            display: flex; align-items: flex-start; gap: 10px;
            padding: 12px 14px; border-radius: 10px;
            font-size: 13px; line-height: 1.5;
            margin-bottom: 16px;
            animation: bannerIn 350ms var(--ease-out);
        }
        @keyframes bannerIn {
            from { opacity: 0; transform: translateY(-4px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        .banner .ico { flex-shrink: 0; margin-top: 1px; }
        .banner.error  { background: rgba(255,79,106,0.10); border: 1px solid rgba(255,79,106,0.32); color: var(--accent-red); }
        .banner.warn   { background: rgba(245,166,35,0.10); border: 1px solid rgba(245,166,35,0.32); color: var(--accent-amber); }
        .banner.info   { background: rgba(79,143,255,0.10); border: 1px solid rgba(79,143,255,0.32); color: var(--accent-blue); }
        .banner.ok     { background: rgba(45,217,138,0.10); border: 1px solid rgba(45,217,138,0.32); color: var(--accent-green); }
        .banner strong { font-weight: 700; display: block; margin-bottom: 1px; }
        .banner .sub   { color: inherit; opacity: 0.85; font-weight: 500; }

        .field { margin-bottom: 14px; }
        .field label {
            display: block;
            font-size: 13px; font-weight: 500;
            color: var(--text-secondary);
            margin-bottom: 6px;
        }
        .field .input-wrap { position: relative; }
        .field input {
            width: 100%;
            padding: 14px 14px;
            background: var(--bg-elevated);
            border: 1px solid var(--border-default);
            border-radius: 10px;
            color: var(--text-primary);
            font-family: var(--font-sans);
            font-size: 15px;
            outline: none;
            -webkit-appearance: none;
            transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
        }
        .field input::placeholder { color: rgba(176,190,230,0.30); }
        html[data-theme="light"] .field input::placeholder,
        @media (prefers-color-scheme: light) {
            html:not([data-theme="dark"]) .field input::placeholder { color: rgba(15,30,70,0.32); }
        }
        html[data-theme="light"] .field input::placeholder { color: rgba(15,30,70,0.32); }
        .field input:focus {
            border-color: var(--accent-blue);
            box-shadow: 0 0 0 3px rgba(79,143,255,0.15);
        }
        .field input.has-toggle { padding-right: 44px; }
        .field .show-toggle {
            position: absolute;
            right: 12px; top: 50%;
            transform: translateY(-50%);
            background: none; border: none;
            color: var(--text-muted);
            padding: 6px;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: color 150ms var(--ease-out);
        }
        .field .show-toggle:hover { color: var(--text-primary); }
        .field .show-toggle .eye-off { display: none; }
        .field .show-toggle.on .eye    { display: none; }
        .field .show-toggle.on .eye-off { display: inline-flex; }

        .submit {
            width: 100%;
            padding: 15px 18px;
            background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
            color: white; border: none;
            font-family: var(--font-display);
            font-size: 15px; font-weight: 700;
            letter-spacing: -0.008em;
            border-radius: 12px;
            box-shadow: 0 8px 24px rgba(79,143,255,0.32), inset 0 1px 0 rgba(255,255,255,0.18);
            margin-top: 18px;
            cursor: pointer;
            transition: transform 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
            display: flex; align-items: center; justify-content: center; gap: 8px;
        }
        .submit:hover { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(79,143,255,0.42), inset 0 1px 0 rgba(255,255,255,0.18); }
        .submit:active { transform: translateY(0); }
        .submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
        .submit .spinner {
            width: 16px; height: 16px;
            border: 2px solid rgba(255,255,255,0.3);
            border-top-color: white;
            border-radius: 50%;
            animation: spin 0.7s linear infinite;
            display: none;
        }
        .submit.loading .spinner { display: inline-block; }
        .submit.loading .label { opacity: 0.6; }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* Theme toggle button — top-right corner */
        .theme-toggle {
            position: absolute;
            top: calc(env(safe-area-inset-top) + 12px);
            right: 16px;
            width: 36px; height: 36px;
            border: none;
            background: var(--bg-surface);
            border-radius: 10px;
            color: var(--text-secondary);
            display: inline-flex; align-items: center; justify-content: center;
            cursor: pointer;
            transition: background 150ms var(--ease-out), color 150ms var(--ease-out);
        }
        .theme-toggle:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
        .theme-toggle .moon { display: none; }
        .theme-toggle .sun  { display: inline-flex; }
        html[data-theme="light"] .theme-toggle .moon { display: inline-flex; }
        html[data-theme="light"] .theme-toggle .sun  { display: none; }
        @media (prefers-color-scheme: light) {
            html:not([data-theme="dark"]) .theme-toggle .moon { display: inline-flex; }
            html:not([data-theme="dark"]) .theme-toggle .sun  { display: none; }
        }
        html[data-theme="dark"] .theme-toggle .moon { display: none; }
        html[data-theme="dark"] .theme-toggle .sun  { display: inline-flex; }

