:root {
    --ink: #15171c;
    --muted: #5c6570;
    --blue: #365dc9;
    --blue-dark: #294ba9;
    --teal: #365dc9;
    --surface: #ffffff;
    --background: #f4f6f8;
    --line: #d8dde3;
    --soft-blue: #eef2ff;
    --shadow: 0 16px 38px rgba(21, 23, 28, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--background);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.55;
    overflow-x: hidden;
}

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

a { color: inherit; }

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 70px;
    padding: 10px max(24px, calc((100vw - 1180px) / 2));
    color: #fff;
    background: #15171c;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .05);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 850;
    line-height: 1.12;
    text-decoration: none;
    transition: transform .35s ease;
}

.brand img {
    width: 60px;
    height: 44px;
    object-fit: contain;
    transition: transform .45s ease;
}

.brand:hover { transform: translateY(-1px); }
.brand:hover img { transform: rotate(-7deg) scale(1.04); }

.header-side {
    display: flex;
    align-items: center;
    gap: 26px;
}

.header-label, .header-back {
    margin: 0;
    color: rgba(255, 255, 255, .7);
    font-size: .84rem;
    font-weight: 750;
}

.header-back {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .7);
}

.header-back span {
    font-size: 1.1rem;
    transition: transform .2s ease;
}

.header-back:hover span { transform: translateX(4px); }

.header-back:focus-visible, .brand:focus-visible {
    outline: 2px solid #c1d0fa;
    outline-offset: 5px;
}

.app-shell {
    width: min(1180px, calc(100% - 48px));
    max-width: 100%;
    margin: 0 auto;
    padding: 76px 0 92px;
}

.intro { max-width: 760px; }

.eyebrow {
    margin: 0 0 12px;
    color: var(--blue);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

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

h1 {
    max-width: 760px;
    margin-bottom: 18px;
    font-size: clamp(2.35rem, 5vw, 4.3rem);
    line-height: 1.04;
    letter-spacing: -.045em;
}

.intro-copy {
    max-width: 720px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1.1rem;
}

.progress-card {
    width: 100%;
    max-width: 100%;
    margin: 42px 0 24px;
    padding: 22px 26px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.progress-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.progress-top strong { font-size: .95rem; }
.progress-top span { color: var(--blue); font-weight: 750; }

.progress-track {
    height: 7px;
    overflow: hidden;
    background: #e7edf5;
    border-radius: 999px;
}

.progress-track span {
    display: block;
    width: 11.111%;
    height: 100%;
    background: var(--blue);
    border-radius: inherit;
    transition: width .3s ease;
}

.progress-steps {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 8px;
    margin-top: 12px;
    color: #8a97a9;
    font-size: .72rem;
    font-weight: 700;
    text-align: center;
}

.progress-steps span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.progress-steps span.is-active { color: var(--blue); }
.progress-steps span.is-complete { color: var(--teal); }

.analysis-form { position: relative; }

.form-step {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: clamp(28px, 4vw, 48px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.form-step[hidden] { display: none; }

.form-step.is-active { animation: step-in .32s ease both; }

@keyframes step-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-title {
    display: block;
    width: 100%;
    padding: 0;
    color: var(--ink);
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.12;
}

.step-intro {
    margin: 11px 0 30px;
    color: var(--muted);
}

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

.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.three { grid-template-columns: 1.35fr 1.1fr .65fr; }

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 18px 0;
    color: var(--ink);
    font-weight: 700;
}

.field.compact { max-width: 760px; }

.field input, .field select, .field textarea {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    color: var(--ink);
    background: #fbfcfe;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: 0;
    resize: vertical;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.field textarea { min-height: 96px; }

.field input:focus, .field select:focus, .field textarea:focus {
    background: #fff;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(49, 95, 194, .12);
}

.question-block {
    margin: 32px 0;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.question-block h2 {
    margin-bottom: 6px;
    font-size: 1.08rem;
    line-height: 1.25;
}

.question-copy {
    margin-bottom: 16px;
    color: var(--muted);
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.choice-grid.one-line { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.choice-grid label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 12px 14px;
    color: #263752;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    line-height: 1.35;
    transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.choice-grid label:hover {
    border-color: #99add5;
    transform: translateY(-1px);
}

.choice-grid label.is-selected {
    background: var(--soft-blue);
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(49, 95, 194, .09);
}

.choice-grid input, .consent input {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin: 1px 0 0;
    accent-color: var(--blue);
}

.info-note {
    margin: 22px 0 30px;
    padding: 15px 17px;
    color: #314b73;
    background: #eef2ff;
    border-left: 4px solid var(--blue);
    border-radius: 6px;
}

.tech-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 26px 0 28px;
}

.tech-cards article {
    padding: 18px;
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.tech-cards strong { display: block; margin-bottom: 8px; }
.tech-cards p { margin-bottom: 10px; color: var(--muted); font-size: .9rem; }
.tech-cards small { color: var(--blue); font-size: .78rem; font-weight: 700; }

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
    margin-top: 20px;
}

.consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 24px 0 14px;
    color: #35445b;
    font-size: .93rem;
}

.submit-note {
    padding: 13px 15px;
    color: var(--muted);
    background: #f7f9fc;
    border-radius: 6px;
    font-size: .9rem;
}

.step-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.button {
    min-width: 128px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 800;
    transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.button:hover { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(49, 95, 194, .28); outline-offset: 2px; }

.button.primary {
    color: #fff;
    background: var(--blue);
    box-shadow: 0 8px 20px rgba(54, 93, 201, .2);
}

.button.primary:hover { background: var(--blue-dark); }

.button.secondary {
    color: var(--ink);
    background: #fff;
    border-color: var(--line);
}

.button.secondary:hover { border-color: #9aaaca; background: #f7f9fc; }

.form-status {
    min-height: 24px;
    margin: 16px 4px 0;
    color: #b42318;
    font-size: .92rem;
    font-weight: 650;
}

.app-footer {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 60px;
    align-items: end;
    margin-inline: calc((100% - 100vw) / 2);
    padding: 48px max(56px, calc((100vw - 1180px) / 2));
    color: #fff;
    background: #15171c;
    font-size: .9rem;
}

.app-footer strong { font-size: 18px; }

.app-footer p {
    max-width: 390px;
    margin: 6px 0 0;
    color: rgba(255, 255, 255, .54);
    font-size: 12px;
}

.app-footer > div:nth-child(2) {
    display: flex;
    gap: 22px;
    font-size: 12px;
}

.app-footer a { color: inherit; text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
.app-footer .footer-top { color: #c1d0fa; font-size: 12px; font-weight: 800; }

.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (max-width: 860px) {
    .app-shell { width: calc(100% - 32px); padding-top: 52px; }
    .progress-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: 8px; font-size: .68rem; }
    .choice-grid.one-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tech-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .app-header { align-items: flex-start; flex-direction: column; gap: 10px; padding: 12px 20px; }
    .header-side { width: 100%; justify-content: space-between; gap: 14px; }
    .app-shell { width: min(100% - 24px, 560px); padding: 42px 0 58px; }
    h1 { font-size: 2.45rem; }
    .intro-copy { font-size: 1rem; }
    .progress-card { margin-top: 30px; padding: 18px; }
    .progress-steps { display: none; }
    .form-step { padding: 24px 18px; }
    .field-grid.two, .field-grid.three, .summary-grid, .choice-grid, .choice-grid.one-line, .tech-cards { grid-template-columns: 1fr; }
    .choice-grid label { padding: 11px 12px; }
    .step-actions { position: sticky; bottom: 0; z-index: 2; margin-inline: -18px; padding: 14px 18px; background: rgba(255,255,255,.96); }
    .button { min-width: 0; flex: 1; }
    .app-footer { grid-template-columns: 1fr; gap: 25px; margin-inline: -12px; padding: 42px 22px; }
    .app-footer > div:nth-child(2) { flex-wrap: wrap; }
}
