:root {
    --ink: #202327;
    --muted: #66707b;
    --line: #e3e7ec;
    --panel: #ffffff;
    --page: #f6f7f9;
    --accent: #8f1f2d;
    --accent-soft: #fbf0f2;
    --accent-dark: #671622;
    --focus: #c7d0dc;
    --shadow: 0 12px 34px rgba(22, 28, 36, 0.1);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

button,
select {
    font-family: "Segoe UI", Arial, sans-serif;
}

.fit-shell {
    height: 100vh;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 14px;
}

.fit-card {
    width: min(560px, 100%);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid #edf0f3;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px 22px;
}

.fit-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.fit-topline span:first-child {
    color: var(--accent);
    font-size: 14px;
    font-weight: 800;
}

.intro {
    display: grid;
    gap: 8px;
}

.intro h1,
.result-view h1 {
    margin: 0;
    color: var(--ink);
    font-size: 25px;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0;
}

.intro p,
.result-copy {
    max-width: 480px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.eyebrow {
    width: max-content;
    margin: 0;
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--muted);
    background: #f4f6f8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.progress {
    height: 4px;
    margin: 16px 0 18px;
    overflow: hidden;
    background: #edf0f3;
    border-radius: 999px;
}

.progress-bar {
    background: var(--accent);
    border-radius: inherit;
    transition: width 260ms ease;
}

.fit-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.step {
    display: none;
}

.step.active {
    display: block;
}

.fit-form[data-direction="forward"] .step.active {
    animation: stepForward 220ms ease both;
}

.fit-form[data-direction="back"] .step.active {
    animation: stepBack 220ms ease both;
}

.step label {
    display: block;
    margin-bottom: 13px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
}

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

.option-btn {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #fff;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, background 150ms ease;
}

.option-btn:hover {
    border-color: #cbd3dc;
    box-shadow: 0 6px 14px rgba(22, 28, 36, 0.06);
    transform: translateY(-1px);
}

.option-btn:focus,
.btn-fit-primary:focus,
.btn-fit-secondary:focus {
    outline: none;
}

.option-btn.selected {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(143, 31, 45, 0.35);
}

.option-btn:focus-visible,
.btn-fit-primary:focus-visible,
.btn-fit-secondary:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.needs-choice .option-btn {
    animation: choicePulse 420ms ease;
}

.form-select {
    min-height: 44px;
    border-color: var(--line);
    border-radius: 8px;
    color: var(--ink);
    background-color: #fff;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
}

.form-select:focus {
    border-color: var(--accent);
    box-shadow: none;
}

.fit-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 18px;
}

.btn-fit-primary,
.btn-fit-secondary {
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 8px;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}

.btn-fit-primary {
    border: 1px solid var(--accent);
    color: #fff;
    background: var(--accent);
    box-shadow: 0 8px 18px rgba(143, 31, 45, 0.16);
}

.btn-fit-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 11px 22px rgba(143, 31, 45, 0.22);
}

.btn-fit-secondary {
    border: 1px solid var(--line);
    color: var(--ink);
    background: #fff;
}

.btn-fit-secondary:hover {
    border-color: #c9d1da;
    background: #f8fafc;
}

.result-view {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.result-view h1 {
    color: var(--accent);
    font-size: 52px;
    line-height: 1;
}

.result-view form {
    margin-top: 12px;
}

@keyframes stepForward {
    from {
        opacity: 0;
        transform: translateX(18px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes stepBack {
    from {
        opacity: 0;
        transform: translateX(-18px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes choicePulse {
    50% {
        border-color: var(--accent);
        transform: translateY(-2px);
    }
}

@media (max-width: 520px) {
    .fit-shell {
        padding: 10px;
    }

    .fit-card {
        min-height: calc(100vh - 20px);
        padding: 18px;
        box-shadow: 0 12px 34px rgba(22, 28, 36, 0.11);
    }

    .fit-topline {
        margin-bottom: 18px;
    }

    .intro h1 {
        font-size: 24px;
    }

    .result-view h1 {
        font-size: 48px;
    }

    .option-grid {
        grid-template-columns: 1fr;
    }

    .step label {
        font-size: 17px;
    }

    .fit-actions {
        padding-top: 18px;
    }

    .btn-fit-primary,
    .btn-fit-secondary {
        flex: 1;
        padding-right: 12px;
        padding-left: 12px;
    }
}
