:root {
    --primary: #2357d9;
    --primary-dark: #172f77;
    --accent: #0f9f6e;
    --warning: #b7791f;
    --danger: #dc2626;
    --ink: #172033;
    --muted: #64748b;
    --line: #dbe4f0;
    --soft: #f6f8fb;
    --card: #ffffff;
    --shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--soft);
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    line-height: 1.75;
}

a {
    color: inherit;
}

.site-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0 48px;
}

.site-nav,
.site-links,
.auth-links,
.hero-actions,
.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.site-nav {
    justify-content: space-between;
    margin-bottom: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-dark);
    font-weight: 900;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    letter-spacing: 0;
}

.nav-link,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    color: var(--primary);
    font-weight: 900;
    text-decoration: none;
}

.btn.primary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 10px 22px rgba(35, 87, 217, 0.18);
}

.btn.danger {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.hero {
    display: grid;
    gap: 16px;
    padding: clamp(24px, 4vw, 40px);
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    font-weight: 900;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 820px;
    margin-bottom: 0;
    color: var(--primary-dark);
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.18;
}

.lead {
    max-width: 820px;
    margin-bottom: 0;
    color: #475569;
    font-size: 1.06rem;
    font-weight: 750;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.panel h2,
.panel h3 {
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.panel p,
.panel li {
    color: #475569;
    font-weight: 700;
}

.clean-list {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.clean-list li {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.choice-grid,
.level-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.level-choice-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice-card,
.level-choice-card,
.placement-question,
.result-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.featured-choice {
    border-color: rgba(35, 87, 217, 0.45);
    box-shadow: var(--shadow);
}

.route-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 8px;
    background: #e8eefc;
    color: var(--primary-dark);
    font-weight: 900;
    font-size: 0.86rem;
}

.choice-card h2,
.level-choice-card h2,
.placement-question h2,
.result-card h2 {
    margin: 10px 0 8px;
    color: var(--primary-dark);
}

.choice-card p,
.level-choice-card p,
.placement-question p,
.result-card p {
    color: #475569;
    font-weight: 700;
}

.direct-start-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.level-price {
    display: block;
    margin: 14px 0;
    color: var(--accent);
    font-size: 1.05rem;
}

.placement-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.placement-summary span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--soft);
    border: 1px solid var(--line);
    color: var(--primary-dark);
    font-weight: 900;
}

.placement-form {
    display: grid;
    gap: 14px;
}

.placement-question {
    margin: 0;
}

.placement-question legend {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 900;
}

.placement-question legend span {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #fff;
    background: var(--primary);
}

.question-prompt {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
    color: var(--ink);
    font-size: 1.1rem;
}

.placement-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
    color: var(--ink);
    font-weight: 900;
    cursor: pointer;
}

.option-row:has(input:checked) {
    border-color: var(--primary);
    background: #e8eefc;
}

.option-row input {
    accent-color: var(--primary);
}

.placement-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    position: sticky;
    bottom: 0;
    padding: 14px 0;
    background: var(--soft);
    border-top: 1px solid var(--line);
}

.result-card {
    margin-top: 18px;
    border-color: rgba(15, 159, 110, 0.45);
}

.result-score {
    color: var(--accent);
    font-size: 1.25rem;
    font-weight: 900;
}

.result-sections li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.legal-note {
    color: var(--warning);
    font-weight: 900;
}

.footer {
    margin-top: 24px;
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-weight: 800;
}

.footer-links {
    margin-top: 8px;
}

@media (max-width: 860px) {
    .site-nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-links,
    .auth-links,
    .hero-actions,
    .footer-links {
        width: 100%;
    }

    .nav-link,
    .btn {
        flex: 1 1 145px;
    }

    .grid,
    .two-col,
    .choice-grid,
    .level-choice-grid {
        grid-template-columns: 1fr;
    }

    .direct-start-panel,
    .placement-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .placement-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .placement-options {
        grid-template-columns: 1fr;
    }
}
