:root {
    --blue-950: #082c78;
    --blue-900: #0d3d9c;
    --blue-700: #1d58c8;
    --blue-500: #4384f5;
    --blue-100: #eaf1ff;
    --ink: #0b2360;
    --muted: #58709f;
    --white: #ffffff;
    --line: #c8d8fb;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--blue-950);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--white);
    font-family: Arial, Helvetica, sans-serif;
    background: var(--blue-950);
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.page-shell {
    width: min(100% - 40px, 1120px);
    min-height: 100svh;
    margin: 0 auto;
    padding: 28px 0;
    display: grid;
    grid-template-rows: auto 1fr;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 16px;
    color: #cbdcff;
    font-size: 13px;
    text-transform: uppercase;
}

.site-header > span {
    display: none;
}

.brand {
    display: inline-flex;
    align-items: center;
}

.brand img {
    display: block;
    width: min(250px, 65vw);
    height: auto;
    filter: brightness(0) invert(1);
}

.welcome-view {
    display: grid;
    width: min(100%, 1040px);
    margin: 0 auto;
    align-content: center;
    justify-items: center;
    gap: clamp(32px, 7vh, 72px);
    padding: 24px 0 40px;
    text-align: center;
}

.intro {
    max-width: 680px;
}

.eyebrow {
    margin: 0 0 16px;
    color: #9fc0ff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(34px, 4vw, 54px);
    line-height: 1.08;
}

.intro > p:last-child,
.success-view > p:not(.eyebrow) {
    margin: 24px 0 0;
    color: #cbdcff;
    font-size: 17px;
    line-height: 1.55;
}

.feedback-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.feedback-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 190px;
    padding: 30px;
    overflow: hidden;
    color: var(--blue-100);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    background: var(--blue-900);
    border: 1px solid #2a62c7;
    border-radius: 6px;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.feedback-card:last-child {
    grid-column: auto;
    min-height: 190px;
}

.feedback-card:focus-visible {
    outline: 2px solid #b9d2ff;
    outline-offset: 3px;
}

.feedback-card:active {
    background: #174fb5;
    border-color: #8fb6ff;
    transform: translateY(0);
}

@media (hover: hover) and (pointer: fine) {
    .feedback-card:hover {
        background: var(--blue-700);
        border-color: #82adff;
        transform: translateY(-2px);
    }

    .feedback-card:hover .card-action-arrow {
        transform: translateX(4px);
    }

    .feedback-card:hover:active {
        background: #174fb5;
        border-color: #8fb6ff;
        transform: translateY(0);
    }
}

.card-title {
    display: block;
    max-width: 180px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.card-action {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #b9d2ff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.card-action-arrow {
    display: inline-block;
    color: var(--white);
    font-size: 19px;
    line-height: 1;
    transition: transform 160ms ease;
}

.feedback-card:focus-visible .card-action-arrow {
    transform: translateX(4px);
}

.form-view {
    width: min(100%, 760px);
    margin: 0 auto;
}

.back-button,
.return-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    color: #cbdcff;
    background: transparent;
    border: 0;
    font-size: 15px;
}

.back-button:hover,
.back-button:focus-visible,
.return-button:hover,
.return-button:focus-visible {
    color: var(--white);
    outline: none;
}

.back-button span {
    font-size: 20px;
}

#feedback-form {
    margin-top: 32px;
    padding: 48px;
    color: var(--ink);
    background: var(--white);
    border-radius: 6px;
}

.form-heading {
    padding-bottom: 32px;
    border-bottom: 1px solid var(--line);
}

.form-heading .eyebrow {
    margin-bottom: 12px;
    color: var(--blue-700);
}

.form-heading h1 {
    font-size: clamp(28px, 4vw, 40px);
}

.form-heading p:last-child {
    margin: 16px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.form-fields {
    display: grid;
    gap: 22px;
    padding: 32px 0;
}

.field {
    display: grid;
    gap: 9px;
}

.field label,
.rating-legend {
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
}

.field label span,
.rating-legend span {
    color: var(--blue-700);
}

.field input,
.field textarea {
    width: 100%;
    color: var(--ink);
    background: #f8faff;
    border: 1px solid var(--line);
    border-radius: 4px;
    outline: 0;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input {
    height: 48px;
    padding: 0 14px;
}

.field textarea {
    min-height: 128px;
    padding: 13px 14px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(67, 132, 245, 0.2);
}

.rating-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.rating-legend {
    margin-bottom: 12px;
}

.rating-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.rating-scale-labels {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
}

.rating-scale-labels span {
    max-width: 160px;
}

.rating-scale-labels span:last-child {
    text-align: right;
}

.rating-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rating-option span {
    display: grid;
    min-height: 54px;
    place-items: center;
    color: var(--blue-700);
    background: var(--blue-100);
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 17px;
    font-weight: 700;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.rating-option:hover span,
.rating-option input:focus-visible + span {
    border-color: var(--blue-500);
}

.rating-option input:checked + span {
    color: var(--white);
    background: var(--blue-700);
    border-color: var(--blue-700);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.submit-button,
.return-button {
    min-height: 50px;
    padding: 0 20px;
    color: var(--white);
    background: var(--blue-700);
    border: 1px solid var(--blue-700);
    border-radius: 4px;
    font-weight: 700;
    transition: background-color 160ms ease, transform 160ms ease;
}

.submit-button:hover,
.submit-button:focus-visible,
.return-button:hover,
.return-button:focus-visible {
    color: var(--white);
    background: #1446ad;
    border-color: #1446ad;
    outline: none;
    transform: translateY(-1px);
}

.submit-button:disabled {
    cursor: wait;
    opacity: 0.7;
    transform: none;
}

.submit-button span {
    margin-left: 10px;
    font-size: 20px;
}

.required-note {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.required-note span {
    color: var(--blue-700);
    font-size: 16px;
}

.form-error {
    margin: 16px 0 0;
    color: #b42318;
    font-size: 14px;
    line-height: 1.4;
}

.success-view {
    display: grid;
    max-width: 520px;
    margin: 100px auto 0;
    text-align: center;
    justify-items: center;
}

.review-success-view {
    display: grid;
    min-height: calc(100svh - 150px);
    align-content: center;
    gap: clamp(36px, 7vh, 72px);
    padding: 24px 0 40px;
}

.review-success-message {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.review-success-message h1 {
    font-size: clamp(32px, 4vw, 48px);
}

.review-success-message p {
    margin: 20px 0 0;
    color: #cbdcff;
    font-size: 17px;
    line-height: 1.55;
}

.review-success-message p + p {
    margin-top: 26px;
}

.review-success-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.review-success-grid .feedback-card {
    min-height: 168px;
}

@media (max-width: 760px) {
    .review-success-view {
        min-height: calc(100svh - 120px);
    }

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

    .review-success-grid .feedback-card {
        min-height: 150px;
    }
}

@media (max-width: 420px) {
    .review-success-grid {
        grid-template-columns: 1fr;
    }

    .review-success-grid .feedback-card {
        min-height: 136px;
    }
}

.success-mark {
    display: grid;
    width: 64px;
    height: 64px;
    margin-bottom: 28px;
    place-items: center;
    color: var(--blue-900);
    background: var(--white);
    border-radius: 50%;
    font-size: 32px;
    font-weight: 700;
}

.success-view .return-button {
    margin-top: 32px;
}

[hidden] {
    display: none !important;
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 32px, 1120px);
        padding: 24px 0;
    }

    .site-header {
        padding-bottom: 12px;
    }

    .welcome-view {
        gap: 36px;
        padding: 28px 0;
    }

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

    .feedback-card,
    .feedback-card:last-child {
        min-height: 164px;
        padding: 26px;
    }

    /* .feedback-card:last-child {
        grid-column: 1 / -1;
        width: calc((100% - 12px) / 2);
        justify-self: center;
    } */

    .card-title {
        max-width: 210px;
    }

    #feedback-form {
        padding: 30px 22px;
    }

    .form-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .submit-button {
        width: 100%;
        justify-content: center;
    }

    .success-view {
        margin-top: 64px;
    }
}

@media (max-width: 420px) {
    .brand img {
        width: min(210px, 70vw);
    }

    h1 {
        font-size: 33px;
    }

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

    .feedback-card,
    .feedback-card:last-child {
        min-height: 136px;
        padding: 22px;
    }

    .feedback-card:last-child {
        grid-column: auto;
        width: auto;
    }

    .card-title {
        max-width: 290px;
    }

    .rating-options {
        gap: 5px;
    }
}
