        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: var(--font-sans);
            /* var(--page-bg). The auth flow ran on three different
               backgrounds — var(--card-bg) on login, var(--surface-2) on register, var(--hover-bg) on
               profile-setup — so the page colour changed under you as you
               moved between signing in, signing up and finishing a profile. */
            background-color: var(--page-bg);
            min-height: 100vh;
            padding: 2rem 1rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .registration-container {
            background: var(--card-bg);
            padding: 3rem 2.5rem;
            border-radius: var(--card-radius);
            /* No drop shadow: the rest of the site moved to a 1px border
               for card edges, and a shadow here made the same component read
               as a different one. */
            width: 100%;
            max-width: 500px;
            border: 1px solid var(--card-border);
        }
        .logo-section {
            margin-bottom: 1.75rem;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        .wordmark {
            font-size: 1.75rem;
            font-weight: 300;
            letter-spacing: -0.02em;
            color: var(--text-primary);
            text-decoration: none;
            align-self: flex-start;
            margin-bottom: 0.75rem;
        }
        .logo-section h1 {
            font-size: var(--text-xl);
            font-weight: 600;
            color: var(--text-primary);
            letter-spacing: -0.01em;
            line-height: 1.25;
            margin: 0;
        }
        .logo-section p {
            color: var(--text-body);
            font-size: var(--text-sm);
            margin: 0;
        }
        /* Two columns from tablet up: the form, and a rail that sets
           expectations once so no later page has to. */
        .apply-layout {
            width: 100%;
            max-width: 900px;
            display: grid;
            grid-template-columns: minmax(0, 1fr) 280px;
            gap: 32px;
            align-items: start;
        }
        @media (max-width: 860px) {
            .apply-layout { grid-template-columns: minmax(0, 1fr); max-width: 500px; }
        }
        .apply-aside { display: flex; flex-direction: column; gap: 16px; }
        .aside-card {
            background: var(--card-bg);
            border: 1px solid var(--card-border);
            border-radius: var(--card-radius);
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .aside-card h2 {
            margin: 0;
            font-size: var(--text-xs);
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--text-secondary);
        }
        .aside-card p { margin: 0; font-size: 13px; color: var(--text-body); line-height: 1.5; }
        .aside-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
        .aside-steps li { display: flex; gap: 12px; align-items: flex-start; }
        .aside-steps li > span:last-child { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--text-secondary); }
        .aside-steps strong { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }
        .aside-num {
            width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
            background: var(--accent); color: var(--accent-fg);
            font-size: 12px; font-weight: 600;
            display: inline-flex; align-items: center; justify-content: center;
        }
        .form-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }
        .google-hint { margin-top: -0.5rem; margin-bottom: 1rem; }
        .form-helper-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

        .form-group {
            margin-bottom: 1.5rem;
        }

        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }

        .form-label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 600;
            color: var(--text-body);
            font-size: 0.875rem;
        }

        .form-input, .form-select {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 2px solid var(--card-border);
            border-radius: 8px;
            font-size: 1rem;
            transition: background-color var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease);
            background-color: var(--card-bg);
        }

        .form-input:focus, .form-select:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
        }

        .form-select {
            cursor: pointer;
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 0.75rem center;
            background-size: 1rem;
            padding-right: 2.5rem;
            appearance: none;
        }

        .password-container {
            position: relative;
        }

        .password-toggle {
            position: absolute;
            right: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 0.875rem;
            font-weight: 500;
            padding: 0.25rem;
        }

        .password-toggle:hover {
            color: var(--text-body);
        }

        .password-requirements {
            margin-top: 0.75rem;
            font-size: 0.8rem;
            color: var(--text-secondary);
            line-height: 1.5;
        }

        .password-requirements .req-header {
            margin-bottom: 0.5rem;
            font-weight: 500;
        }

        .password-requirements .req-list {
            display: flex;
            flex-direction: column;
            gap: 0.375rem;
        }

        .password-requirements .req-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            transition: color var(--dur-base) var(--ease);
        }

        .password-requirements .req-item.valid {
            color: #16a34a;
        }

        .password-requirements .req-item.invalid {
            color: var(--text-secondary);
        }

        .password-requirements .req-icon {
            width: 1rem;
            height: 1rem;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .password-requirements .req-icon svg {
            width: 100%;
            height: 100%;
        }

        .password-requirements .req-item.valid .icon-check {
            display: block;
        }

        .password-requirements .req-item.valid .icon-circle {
            display: none;
        }

        .password-requirements .req-item.invalid .icon-check {
            display: none;
        }

        .password-requirements .req-item.invalid .icon-circle {
            display: block;
        }

        .phone-input {
            display: grid;
            grid-template-columns: auto 1fr;
            gap: 0.5rem;
            align-items: center;
        }

        .country-code {
            padding: 0.75rem 0.5rem;
            border: 2px solid var(--card-border);
            border-radius: 8px;
            background-color: var(--surface-2);
            font-size: 1rem;
            color: var(--text-body);
            font-weight: 500;
            text-align: center;
            min-width: 60px;
        }

        .terms-container {
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            margin: 1.5rem 0;
            padding: 1rem;
            background-color: var(--surface-2);
            border-radius: 8px;
            border: 1px solid var(--card-border);
        }

        .terms-checkbox {
            margin-top: 0.125rem;
            width: 1.125rem;
            height: 1.125rem;
            cursor: pointer;
        }

        .terms-text {
            font-size: 0.875rem;
            color: var(--text-muted);
            line-height: 1.5;
        }

        .terms-text a {
            color: var(--text-primary);
            text-decoration: none;
            font-weight: 500;
        }

        .terms-text a:hover {
            text-decoration: underline;
        }

        .register-btn {
            width: 100%;
            background: var(--accent);
            color: var(--accent-fg);
            border: 2px solid var(--accent);
            padding: 0.875rem 1.5rem;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: background-color var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease);
            position: relative;
            overflow: hidden;
        }

        .register-btn:hover {
            background: var(--card-bg);
            color: var(--text-primary);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .register-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .loading-spinner {
            display: none;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 20px;
            height: 20px;
            border: 2px solid transparent;
            border-top: 2px solid var(--accent);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: translate(-50%, -50%) rotate(0deg); }
            100% { transform: translate(-50%, -50%) rotate(360deg); }
        }

        .login-link {
            text-align: center;
            margin-top: 1.5rem;
            font-size: 0.875rem;
            color: var(--text-secondary);
        }

        .login-link a {
            color: var(--text-primary);
            text-decoration: underline;
            font-weight: 500;
        }

        .login-link a:hover {
            text-decoration: underline;
        }

        .verification-badge {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            margin-top: 1.5rem;
            padding: 0.75rem;
            background-color: #f0f9ff;
            border: 1px solid #bae6fd;
            border-radius: 8px;
            font-size: 0.875rem;
            color: #0369a1;
            text-align: center;
        }

        .verification-icon {
            width: 1.25rem;
            height: 1.25rem;
            flex-shrink: 0;
        }

        /* Google OAuth Button */
        .google-btn {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
            padding: 0.875rem 1.5rem;
            background: var(--card-bg);
            border: 2px solid var(--card-border);
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 500;
            color: var(--text-body);
            cursor: pointer;
            transition: background-color var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease);
            margin-bottom: 1.5rem;
        }

        .google-btn:hover {
            background: var(--surface-2);
            border-color: var(--border-strong);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .google-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .google-icon {
            width: 1.25rem;
            height: 1.25rem;
        }

        .divider {
            display: flex;
            align-items: center;
            margin: 1.5rem 0;
        }

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

        .divider-text {
            padding: 0 1rem;
            color: var(--text-secondary);
            font-size: 0.875rem;
            font-weight: 500;
        }

        .error-message {
            display: none;
            margin-top: 0.5rem;
            font-size: 0.875rem;
            color: var(--danger);
        }

        @media (max-width: 640px) {
            .registration-container {
                padding: 2rem 1.5rem;
                margin: 1rem;
            }

            .form-row {
                grid-template-columns: 1fr;
                gap: 1.5rem;
            }

            .logo-section h1 {
                font-size: 2rem;
            }

            .phone-input {
                grid-template-columns: 1fr;
                gap: 1rem;
            }

            .country-code {
                justify-self: start;
                width: 100px;
            }
        }
    
/* ── Accessibility ───────────────────────────────────────────────────────── */

/* Keyboard skip link. Off-screen until focused, so it costs sighted users
   nothing while giving keyboard users a way past the header on every page. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
    padding: 0.75rem 1rem;
    background: var(--accent);
    color: var(--accent-fg);
    text-decoration: none;
    border-radius: 0 0 6px 0;
}

.skip-link:focus {
    left: 0;
}

/* Every interactive control here is custom-styled, and several reset `outline`
   or `border` away. Without an explicit rule, keyboard focus is invisible —
   the page is operable but you cannot see where you are. */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Application fields */
.optional { color: var(--text-secondary); font-weight: 400; font-size: 0.85em; }
textarea.form-input { resize: vertical; min-height: 6rem; line-height: 1.5; }
.form-helper { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.3rem; }
