*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Matches Shared.Web/Theme/PeopleTheme.cs's Primary (#4A37D6, 7.41:1 on white — AAA) and
       UI.MD3's own brand seed (src/UI.MD3.Styles/tools/generate-brand-scheme.py) — this file
       was still on the pre-AAA-fix #594AE2 (6.0:1, AA only). -light/-dark are that same seed's
       own tone-50/tone-30 palette entries, not new values. */
    --primary: #4A37D6;
    --primary-light: #7859ff;
    --primary-dark: #3228c5;
    --surface: #ffffff;
    --bg: #f4f3fb;
    --text: #1a1a2e;
    --text-secondary: #64648c;
    --border: #e0dff0;
    --error: #ff3f5f;
    --success: #1e7e34;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 8px 32px rgba(74, 55, 214, 0.08), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 60px rgba(74, 55, 214, 0.12), 0 4px 16px rgba(0,0,0,0.06);
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #7859ff;
        --primary-light: #9b7aff;
        --primary-dark: #4A37D6;
        --surface: #1e1e2d;
        --bg: #1a1a27;
        --text: #e0dfed;
        --text-secondary: #92929f;
        --border: #33323e;
        --success: #4caf50;
        --shadow: 0 8px 32px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2);
        --shadow-lg: 0 20px 60px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.3);
    }
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    animation: fadeUp 0.5s ease-out;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Brand header */
.brand {
    text-align: center;
    margin-bottom: 40px;
}

.brand-icon {
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
    color: var(--primary);
    filter: drop-shadow(0 4px 16px rgba(74, 55, 214, 0.35));
}

.brand-name {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
}

.brand-tagline {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 400;
}

/* Help / "learn more" links (small, icon + text) */
.help-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.help-link:hover { color: var(--primary); text-decoration: underline; }

.brand .help-link { margin-top: 10px; }

/* Inline icon SVGs never shrink inside their flex containers */
.help-link svg,
.icon-check,
.google-btn svg,
.microsoft-btn svg,
.submit-btn svg {
    flex-shrink: 0;
}

/* Card */
.auth-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    border: 1px solid var(--border);
    transition: box-shadow 0.3s ease;
}

.auth-card:hover {
    box-shadow: var(--shadow-lg);
}

.section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 4px 0 16px;
}

.auth-card h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 12px;
}

.auth-card p { margin-bottom: 12px; }
.auth-card ul { margin: 0 0 20px 20px; }
.auth-card ul li { margin-bottom: 4px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Multi-step progress indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 28px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.2s ease;
}

.step-dot.active { background: var(--primary); transform: scale(1.25); }
.step-dot.done { background: var(--primary-light); }

.step-line {
    width: 32px;
    height: 2px;
    background: var(--border);
}

.step-line.done { background: var(--primary-light); }

/* Status line with icon (checkmarks) */
.status-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-check { color: var(--success); }

#external-account {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Google / Microsoft buttons */
.google-btn,
.microsoft-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
}

.google-btn:hover,
.microsoft-btn:hover {
    border-color: var(--primary);
    background: rgba(74, 55, 214, 0.04);
    box-shadow: 0 2px 8px rgba(74, 55, 214, 0.1);
    transform: translateY(-1px);
}

.google-btn:active,
.microsoft-btn:active { transform: translateY(0); }

.external-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.external-btn:hover {
    border-color: var(--primary);
    background: rgba(74, 55, 214, 0.04);
    transform: translateY(-1px);
}

.external-btn:active { transform: translateY(0); }

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
    text-transform: lowercase;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Form fields */
.field { margin-bottom: 20px; }

.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    transition: all 0.2s ease;
    outline: none;
}

.field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 55, 214, 0.12);
}

.field input::placeholder { color: var(--text-secondary); opacity: 0.5; }
.field .text-danger { display: block; font-size: 12px; color: var(--error); margin-top: 4px; }

.remember-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Checkbox row */
.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.remember-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    border-radius: 4px;
}

.remember-row label {
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* Submit button */
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(74, 55, 214, 0.3);
    transform: translateY(-1px);
}

.submit-btn:active { transform: translateY(0); }

/* Error summary */
.error-summary {
    background: rgba(255, 63, 95, 0.08);
    border: 1px solid rgba(255, 63, 95, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--error);
}

/* Secondary link */
.auth-link {
    text-align: center;
    margin-top: 28px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.auth-link a:hover { color: var(--primary-light); text-decoration: underline; }

/* External login processing (spinner) */
.auth-card-center {
    text-align: center;
    padding: 48px 40px;
}

.spinner {
    animation: spin 1s linear infinite;
    color: var(--primary);
}

@keyframes spin { to { transform: rotate(360deg); } }

.spinner-text {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 15px;
}

@media (max-width: 480px) {
    .auth-card { padding: 28px 24px; }
    .brand { margin-bottom: 28px; }
}
