:root {
    color-scheme: light;
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-muted: #f1f3f7;
    --border: #e2e6ee;
    --text-primary: #111827;
    --text-secondary: #5f6b7a;
    --brand: #1e3a8a;
    --brand-soft: #dbeafe;
    --accent: #0ea5e9;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --transition: 0.2s ease;
}

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

body {
    font-family: "Inter", sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
}

img,
svg {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.app {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 32px 20px 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #e0f2fe 0%, #7dd3fc 35%, #2563eb 70%, #1e3a8a 100%);
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.brand-title {
    font-weight: 700;
    font-size: 18px;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    background: var(--brand-soft);
    color: var(--brand);
    border-radius: 999px;
}

.ghost-button,
.primary-button {
    border-radius: 999px;
    padding: 10px 18px;
    border: 1px solid transparent;
    background: transparent;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.ghost-button {
    border-color: var(--border);
    color: var(--text-primary);
    background: var(--surface);
}

.ghost-button:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.primary-button {
    background: var(--brand);
    color: #fff;
}

.primary-button:hover {
    background: #162a62;
}

.primary-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.app-main {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.hero {
    display: grid;
    gap: 24px;
}

.hero h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 12px;
}

.hero-text {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

.hero-eyebrow {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.2em;
    color: var(--brand);
    font-weight: 600;
    margin-bottom: 12px;
}

.hero-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.hero-card-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.progress {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-muted);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 14%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    transition: width var(--transition);
}

.progress-label {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.hero-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.meta-title {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
}

.meta-value {
    font-weight: 600;
    font-size: 14px;
}

.form-shell {
    display: grid;
    gap: 24px;
}

.stepper {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.stepper-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.stepper-list {
    list-style: none;
    display: grid;
    gap: 12px;
}

.step-item {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    color: var(--text-secondary);
}

.step-item span:first-child {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--surface-muted);
    font-weight: 600;
    color: var(--text-primary);
}

.step-item p {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.step-item span:last-child {
    font-size: 12px;
    color: var(--text-secondary);
}

.step-item.is-active {
    border-color: var(--brand);
    background: rgba(30, 58, 138, 0.08);
}

.step-item.is-complete span:first-child {
    background: var(--brand);
    color: #fff;
}

.form-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.step-header {
    margin-bottom: 20px;
}

.step-header h2 {
    font-size: 22px;
    margin-bottom: 6px;
}

.step-header p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.form-alert {
    display: none;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 20px;
}

.form-alert.is-visible {
    display: block;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.field-grid {
    display: grid;
    gap: 16px;
}

.field label,
.field-label {
    font-size: 13px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 14px;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 110px;
}

.checkbox-grid,
.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.checkbox-card,
.radio-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.checkbox-card input,
.radio-card input {
    width: 16px;
    height: 16px;
}

.checkbox-card:hover,
.radio-card:hover {
    border-color: var(--brand);
}

.field-error {
    font-size: 12px;
    color: var(--danger);
    min-height: 16px;
}

.dynamic-list {
    display: grid;
    gap: 14px;
}

.dynamic-item {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-muted);
}

.icon-button {
    border: none;
    background: transparent;
    color: var(--danger);
    font-weight: 600;
    cursor: pointer;
    justify-self: flex-start;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
}

.form-step {
    display: none;
}

.form-step.is-active {
    display: block;
}

.is-hidden {
    display: none;
}

.summary-grid {
    display: grid;
    gap: 20px;
}

.summary-card {
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-muted);
}

.summary-card h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

.score {
    font-size: 36px;
    font-weight: 700;
    color: var(--brand);
}

.score-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.score-breakdown {
    display: grid;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.summary-section {
    display: grid;
    gap: 6px;
    margin-bottom: 18px;
}

.summary-section h4 {
    font-size: 14px;
}

.summary-list {
    display: grid;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.summary-list strong {
    color: var(--text-primary);
}

.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 20;
}

.success-overlay.is-hidden {
    display: none;
}

.success-card {
    width: min(960px, 100%);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 28px;
    display: grid;
    gap: 20px;
    max-height: 90vh;
    overflow: auto;
}

.success-header h2 {
    font-size: 24px;
    margin-bottom: 6px;
}

.success-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.success-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 16px;
    background: var(--text-primary);
    color: #fff;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
    pointer-events: none;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.footer {
    margin-top: 12px;
    text-align: center;
    font-size: 0.85rem;
    color: #6b7280;
    white-space: nowrap;
}

.author {
    display: inline;
    margin-left: 4px;
    font-weight: 600;
    text-decoration: none;
    background: linear-gradient(90deg, #1e3a8a, #4c1d95);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.author:hover {
    opacity: 0.9;
}

@media (min-width: 960px) {
    .hero {
        grid-template-columns: 1.2fr 0.8fr;
        align-items: center;
    }

    .form-shell {
        grid-template-columns: 280px 1fr;
        align-items: start;
    }

    .field-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-grid {
        grid-template-columns: 0.7fr 1fr;
    }
}
