:root {
    --navy: #00214e;
    --gold: #f2ab01;
    --ink: #344155;
    --line: #dce2e9;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f3f5f7;
    color: var(--ink);
    font: 16px/1.65 Arial, sans-serif;
}

header {
    background: white;
    border-top: 5px solid var(--gold);
}

.head {
    max-width: 1160px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 30px;
}

.logo {
    width: 300px;
    max-width: 55%;
    height: auto;
}

.client {
    font-size: 13px;
    letter-spacing: 2px;
    color: var(--navy);
    text-align: right;
}

.client b {
    display: block;
    font-size: 17px;
    letter-spacing: 0;
}

.hero {
    background: var(--navy);
    color: white;
    padding: 42px max(24px, calc((100% - 1100px)/2));
}

.eyebrow {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    font-weight: bold;
}

h1 {
    font-size: 36px;
    line-height: 1.2;
    margin: 12px 0 20px;
    font-weight: 400;
}

.rule {
    width: 55px;
    height: 4px;
    background: var(--gold);
}

.shell {
    max-width: 1160px;
    padding: 28px 30px 55px;
    margin: auto;
}

.steps {
    display: flex;
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
    gap: 6px;
}

.steps li {
    flex: 1;
    border-top: 3px solid #d7dee6;
    padding-top: 12px;
    font-size: 13px;
}

.steps li.active {
    border-color: var(--gold);
    color: var(--navy);
    font-weight: bold;
}

.steps span {
    margin-right: 7px;
}

.card {
    background: white;
    padding: 36px 40px;
    border: 1px solid var(--line);
    box-shadow: 0 8px 30px #00214e06;
}

h2 {
    font-size: 25px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--navy);
    margin: 0 0 22px;
}

h3 {
    color: var(--navy);
    font-size: 18px;
}

p {
    margin: 0 0 17px;
}

.notice {
    border-left: 4px solid var(--gold);
    padding: 15px 20px;
    background: #fff8e6;
    margin: 22px 0;
    font-size: 14px;
}

.meta {
    display: flex;
    gap: 30px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 22px;
    margin-bottom: 26px;
    font-size: 14px;
}

.meta b {
    color: var(--navy);
}

button, .btn {
    font: inherit;
    font-weight: bold;
    border: 1px solid var(--navy);
    padding: 12px 25px;
    cursor: pointer;
    background: white;
    color: var(--navy);
    text-decoration: none;
    display: inline-block;
}

button.primary, .btn-primary {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
}

button:hover, .btn:hover {
    filter: brightness(.96);
}

button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 3px solid #d59300;
    outline-offset: 3px;
}

.actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid var(--line);
}

.actions .primary {
    margin-left: auto;
}

.scale {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: #f4f6f9;
    margin: 22px 0;
    gap: 1px;
}

.scale div {
    text-align: center;
    font-size: 12px;
    padding: 12px 5px;
}

.scale b {
    display: block;
    font-size: 18px;
    color: var(--navy);
}

fieldset {
    margin: 0;
    padding: 22px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
}

legend {
    float: left;
    width: 100%;
    font-size: 16px;
    margin-bottom: 15px;
}

legend b {
    display: inline-block;
    color: #8b97a7;
    font-size: 12px;
    margin-right: 12px;
}

.ratings {
    clear: both;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.choice {
    position: relative;
    cursor: pointer;
}

.choice input {
    position: absolute;
    opacity: 0;
}

.choice span {
    display: grid;
    place-items: center;
    border: 1px solid #cbd3df;
    width: 48px;
    height: 42px;
    color: var(--navy);
}

.choice input:checked + span {
    background: var(--navy);
    color: white;
    border-color: var(--navy);
}

.choice input:focus-visible + span {
    outline: 3px solid var(--gold);
}

.invalid {
    background: #fff5ed;
}

.error {
    color: #a32f21;
    font-weight: bold;
    font-size: 14px;
}

textarea {
    display: block;
    width: 100%;
    min-height: 150px;
    resize: vertical;
    border: 1px solid #bac5d3;
    padding: 15px;
    font: inherit;
    margin: 12px 0 30px;
}

label.q {
    font-weight: bold;
    display: block;
    color: var(--navy);
}

.review {
    padding: 17px 0;
    border-bottom: 1px solid var(--line);
}

.answer {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 3px 0 0 auto;
    padding: 2px 5px;
    color: var(--navy);
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    text-align: right;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.progressline {
    height: 4px;
    background: #e5e9ef;
    margin: 12px 0 25px;
}

.progressline div {
    height: 100%;
    background: var(--gold);
    transition: width .2s;
}

.tiny {
    font-size: 12px;
    color: #647084;
}

.success {
    text-align: center;
    padding: 35px 0;
}

.tick {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--gold);
    display: grid;
    place-items: center;
    margin: 0 auto 25px;
    font-size: 32px;
    color: var(--navy);
}

footer {
    background: var(--navy);
    color: #c4cfdf;
    padding: 24px 30px;
    font-size: 12px;
    text-align: center;
}

/* Form input additions using the exact palette */
.form-input {
    width: 100%;
    border: 1px solid #cbd3df;
    padding: 12px 14px;
    font: inherit;
    margin: 8px 0 16px;
}

.form-input:focus {
    outline: 3px solid var(--gold);
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 18px;
}

.captcha-img {
    border: 1px solid var(--line);
    background: #fff;
    display: inline-flex;
    align-items: center;
}

@media(max-width: 650px) {
    .head { padding: 18px; }
    .logo { width: 230px; }
    .client { font-size: 9px; letter-spacing: 1px; }
    .client b { font-size: 13px; }
    .hero { padding: 28px 20px; }
    h1 { font-size: 29px; }
    .shell { padding: 20px 14px 35px; }
    .card { padding: 24px 19px; }
    .steps li { font-size: 10px; }
    .steps span { display: block; }
    .meta { gap: 15px; font-size: 12px; }
    .ratings { justify-content: space-between; gap: 6px; }
    .choice span { width: 46px; }
    .scale div { font-size: 10px; }
    .actions button, .actions .btn { font-size: 13px; padding: 12px 16px; }
}

@media print {
    header, .hero, .steps, .actions, footer { display: none; }
    .shell, .card { padding: 0; box-shadow: none; border: 0; }
    .review { break-inside: avoid; }
}

/* Update the global scale headers to map perfectly to 5 columns */
.scale {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: #f4f6f9;
    margin: 22px 0;
    gap: 1px;
}

.scale div {
    text-align: center;
    font-size: 12px;
    padding: 12px 5px;
}

.scale b {
    display: block;
    font-size: 18px;
    color: var(--navy);
}

/* Question Title Row Layout */
legend.question-title {
    float: left;
    width: 100%;
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--ink);
}

/* Make sure the ratings block is horizontal and floats to the right side if desired, 
   or occupies full width with spacing like the image */
.ratings-grid {
    clear: both;
    display: flex; /* Flex horizontal */
    gap: 12px;
    justify-content: flex-start; /* Align left or flex-end to align right */
    align-items: center;
    margin-top: 10px;
}

/* Hidden radio inputs */
.choice {
    position: relative;
    cursor: pointer;
    display: inline-block;
}

.choice input {
    position: absolute;
    opacity: 0;
    z-index: -1;
    width: 1px;
    height: 1px;
}

/* The visual clickable box */
.choice span {
    display: grid;
    place-items: center;
    border: 1px solid #cbd3df;
    width: 48px;  /* Fixed width from template */
    height: 42px; /* Fixed height from template */
    color: var(--navy);
    font-size: 14px;
    background: #fff;
    transition: all 0.2s ease;
    border-radius: 2px;
}

/* Checked State - Dark Navy Box */
.choice input:checked + span {
    background: var(--navy);
    color: white;
    border-color: var(--navy);
}

/* Focus state for accessibility */
.choice input:focus-visible + span {
    outline: 3px solid var(--gold);
}

/* Form validation error styling */
.invalid {
    background: #fff5ed;
    border: 1px solid #d9534f;
    padding: 10px;
    border-radius: 4px;
}

/* ============================================================
   Likert scale choices - layout fix
   Keep this block AFTER the existing styles above.
   ============================================================ */

/* The question text remains on its own line above the choices. */
legend.question-title {
    float: none;
    display: block;
    width: 100%;
    margin: 0 0 16px;
    color: var(--ink);
}

/* Five evenly sized options, aligned to the right on wide screens. */
.ratings,
.ratings-grid {
    clear: both;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 12px;
    width: 100%;
    max-width: 920px;
    margin: 18px 0 8px auto;
}

.ratings .choice,
.ratings-grid .choice {
    display: block;
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    cursor: pointer;
}

/* Override the old broad `.choice span` rule only for the outer box. */
.choice .choice-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    width: 100%;
    min-height: 116px;
    height: auto;
    padding: 10px 8px;
    border: 1px solid #cbd3df;
    border-radius: 5px;
    background: #fff;
    color: var(--navy);
    text-align: center;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

/* Only the number receives the small square border. */
.choice .choice-number {
    display: grid;
    place-items: center;
    flex: 0 0 56px;
    width: 64px;
    height: 56px;
    padding: 0;
    border: 1px solid #cbd3df;
    border-radius: 2px;
    background: transparent;
    color: inherit;
    font-size: 23px;
    font-weight: 700;
    line-height: 1;
}

/* Text stays inside the option box and wraps naturally. */
.choice .choice-text {
    display: block;
    width: 100%;
    min-height: 32px;
    height: auto;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Selected option. */
.choice input:checked + .choice-box {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}

.choice input:checked + .choice-box .choice-number {
    border-color: #d7e1ef;
    color: #fff;
}

.choice input:checked + .choice-box .choice-text {
    color: #fff;
}

.choice:hover .choice-box {
    border-color: var(--navy);
}

.choice input:focus-visible + .choice-box {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

/* Keep all five options readable on phones; scroll horizontally if needed. */
@media (max-width: 650px) {
    .ratings,
    .ratings-grid {
        justify-content: flex-start;
        max-width: 100%;
        margin: 16px 0 8px;
        padding: 3px 3px 9px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    .ratings .choice,
    .ratings-grid .choice {
        flex: 0 0 104px;
        scroll-snap-align: start;
    }

    .choice .choice-box {
        min-height: 112px;
        padding: 9px 6px;
    }

    .choice .choice-number {
        flex-basis: 52px;
        width: 58px;
        height: 52px;
        font-size: 21px;
    }

    .choice .choice-text {
        font-size: 12px;
    }
}


/* ============================================================
   Final Likert rating layout - single horizontal scale band
   Matches the supplied reference: light-grey background,
   five equal columns, large number above its description.
   ============================================================ */
.ratings,
.ratings-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    justify-content: stretch;
    gap: 0;
    width: 100%;
    max-width: none;
    margin: 22px 0;
    padding: 14px 10px;
    background: #f2f5f8;
    overflow: visible;
}

.ratings .choice,
.ratings-grid .choice {
    display: block;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}

/* Remove the individual card/box appearance. */
.ratings .choice .choice-box,
.ratings-grid .choice .choice-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 116px;
    height: 100%;
    margin: 0;
    padding: 12px 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--ink);
    text-align: center;
}

/* Large scale number, like the reference image. */
.ratings .choice .choice-number,
.ratings-grid .choice .choice-number {
    display: block;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--navy);
    font-size: 36px;
    font-weight: 700;
    line-height: 1.15;
}

/* Description sits below the number and wraps within its column. */
.ratings .choice .choice-text,
.ratings-grid .choice .choice-text {
    display: block;
    width: 100%;
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

/* Selected answer: keep the same band design and add a subtle marker. */
.ratings .choice input:checked + .choice-box,
.ratings-grid .choice input:checked + .choice-box {
    background: #e6edf5;
    color: var(--navy);
    box-shadow: inset 0 -4px 0 var(--gold);
}

.ratings .choice input:checked + .choice-box .choice-number,
.ratings-grid .choice input:checked + .choice-box .choice-number {
    color: var(--navy);
}

.ratings .choice input:checked + .choice-box .choice-text,
.ratings-grid .choice input:checked + .choice-box .choice-text {
    color: var(--ink);
}

.ratings .choice:hover .choice-box,
.ratings-grid .choice:hover .choice-box {
    background: #e9eef4;
}

.ratings .choice input:focus-visible + .choice-box,
.ratings-grid .choice input:focus-visible + .choice-box {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
}

@media (max-width: 650px) {
    .ratings,
    .ratings-grid {
        grid-template-columns: repeat(5, minmax(104px, 1fr));
        margin: 16px 0;
        padding: 10px 6px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .ratings .choice .choice-box,
    .ratings-grid .choice .choice-box {
        min-height: 104px;
        padding: 10px 5px;
    }

    .ratings .choice .choice-number,
    .ratings-grid .choice .choice-number {
        font-size: 30px;
    }

    .ratings .choice .choice-text,
    .ratings-grid .choice .choice-text {
        font-size: 14px;
    }
}

/* Final typography override: requested maximum sizes for the Likert scale. */
.ratings .choice .choice-number,
.ratings-grid .choice .choice-number {
    font-size: 18px !important;
}

.ratings .choice .choice-text,
.ratings-grid .choice .choice-text {
    font-size: 12px !important;
}

@media (max-width: 650px) {
    .ratings .choice .choice-number,
    .ratings-grid .choice .choice-number {
        font-size: 18px !important;
    }

    .ratings .choice .choice-text,
    .ratings-grid .choice .choice-text {
        font-size: 12px !important;
    }
}

/* ============================================================
   Compact rating scale override
   Keep this block last so it overrides all earlier scale rules.
   ============================================================ */
fieldset {
    padding-top: 10px;
    padding-bottom: 10px;
}

legend.question-title {
    margin-bottom: 6px;
    line-height: 1.3;
}

.ratings,
.ratings-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: none;
    margin: 6px 0 4px;
    padding: 0;
    background: #f4f6f9;
}

.ratings .choice,
.ratings-grid .choice {
    display: block;
    min-width: 0;
    margin: 0;
}

.ratings .choice .choice-box,
.ratings-grid .choice .choice-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 6px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: center;
}

.ratings .choice .choice-number,
.ratings-grid .choice .choice-number {
    display: block;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--navy);
    font-size: 18px !important;
    font-weight: 700;
    line-height: 1.1;
}

.ratings .choice .choice-text,
.ratings-grid .choice .choice-text {
    display: block;
    width: 100%;
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 12px !important;
    font-weight: 400;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.ratings .choice input:checked + .choice-box,
.ratings-grid .choice input:checked + .choice-box {
    background: #e8edf3;
    box-shadow: inset 0 -2px 0 var(--gold);
}

.ratings .choice:hover .choice-box,
.ratings-grid .choice:hover .choice-box {
    background: #e9eef4;
}

.ratings .choice input:focus-visible + .choice-box,
.ratings-grid .choice input:focus-visible + .choice-box {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
}

@media (max-width: 650px) {
    .ratings,
    .ratings-grid {
        grid-template-columns: repeat(5, minmax(90px, 1fr));
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .ratings .choice .choice-box,
    .ratings-grid .choice .choice-box {
        padding: 5px 2px;
    }
}