:root {
    color-scheme: light;
    --color-primary: #31513f;
    --color-secondary: #3a2417;
    --color-accent: #c7923e;
    --color-background: #fbf4e8;
    --color-surface: #fffaf2;
    --color-border: #eadcc8;
    --color-text: #2b2118;
    --color-muted: #806f5f;
    --color-muted-strong: #5f4b3a;
    --shadow-soft: 0 20px 60px rgb(60 40 20 / 0.08);
    --shadow-tight: 0 14px 32px rgb(58 36 23 / 0.12);
    --radius: 22px;
    --focus-ring: 0 0 0 3px rgb(199 146 62 / 0.28);
    --font-display: Georgia, "Times New Roman", ui-serif, serif;
    font-family: "Inter", "Avenir Next", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(180deg, rgb(255 250 242 / 0.76), rgb(251 244 232 / 0.84)),
        url("../images/Mobile-bg-cafe.png"),
        linear-gradient(135deg, #fffaf2 0%, #fbf4e8 48%, #f3e4cf 100%);
    background-attachment: scroll, scroll, scroll;
    background-position: center, center, center;
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-size: cover, cover, cover;
    color: var(--color-text);
    font-size: 16px;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

button,
a {
    touch-action: manipulation;
}

a {
    color: inherit;
}

a:focus-visible,
button:focus-visible,
#main-content:focus-visible {
    outline: 0;
    box-shadow: var(--focus-ring);
}

img {
    display: block;
    max-width: 100%;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    transform: translateY(-150%);
    border-radius: 10px;
    background: var(--color-secondary);
    color: #ffffff;
    padding: 10px 14px;
    font-weight: 700;
    transition: transform 160ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-shell {
    width: min(100%, 520px);
    max-width: 100vw;
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-rows: 1fr auto;
    padding: 18px;
}

.site-footer {
    padding: 8px 0;
}

.site-main {
    display: grid;
    place-items: center;
    padding: 34px 0 28px;
}

.flow-card,
.rating-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: none;
    border-radius: var(--radius);
    background: rgb(255 255 255 / 0.95);
    box-shadow: var(--shadow-soft);
    padding: clamp(18px, 5vw, 30px);
    text-align: center;
    animation: page-enter 260ms ease both;
}

.rating-card {
    position: relative;
    display: grid;
    gap: 16px;
    overflow: visible;
}

.rating-card::before {
    content: none;
}

.rating-card > * {
    position: relative;
}

.flow-card {
    display: grid;
    gap: 18px;
}

.feedback-card,
.thanks-card {
    position: relative;
    gap: 18px;
    overflow: visible;
}

.feedback-card {
    text-align: left;
}

.feedback-card::before,
.thanks-card::before {
    content: none;
}

.feedback-card > *,
.thanks-card > * {
    position: relative;
}

.flow-card--center {
    text-align: center;
}

.flow-card__eyebrow,
.rating-card__eyebrow {
    margin: 0;
    color: #6f4e37;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    width: clamp(130px, 44vw, 150px);
    max-width: 100%;
    margin-block: -14px -18px;
}

.brand-logo__image {
    width: 100%;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.feedback-card .brand-logo {
    margin-block: -4px -18px;
}

.rating-card__copy,
.feedback-card__copy,
.thanks-card__copy {
    display: grid;
    gap: 12px;
}

.feedback-card__copy {
    text-align: center;
}

.thanks-card__success {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    justify-self: center;
    border: 1px solid rgb(227 200 156 / 0.72);
    border-radius: 999px;
    background: #f8f1e7;
    color: #7a563c;
    box-shadow: 0 16px 34px rgb(106 74 53 / 0.14);
    animation: success-pop 360ms ease 80ms both;
}

.thanks-card__success {
    width: 74px;
    height: 74px;
}

.thanks-card__success span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #7a563c;
    color: #ffffff;
    font-size: 25px;
    font-weight: 900;
    line-height: 1;
}

.thanks-card__success span {
    font-size: 26px;
    width: 44px;
    height: 44px;
}

.flow-card__title,
.rating-card__title {
    margin: 0 auto;
    max-width: 13ch;
    color: var(--color-secondary);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(34px, 8vw, 48px);
    line-height: 1.04;
    letter-spacing: 0;
    overflow-wrap: break-word;
}

.rating-card__title {
    margin-bottom: -2px;
    max-width: 17ch;
    font-size: clamp(28px, 8.4vw, 36px);
    line-height: 1.1;
}

.rating-card__title-line {
    display: block;
}

.rating-card__title-line--desktop {
    display: none;
}

.flow-card__title {
    max-width: 12ch;
}

.feedback-card .flow-card__title {
    margin-inline: auto;
    max-width: 13ch;
    font-size: clamp(32px, 8vw, 46px);
}

.feedback-title__line {
    display: inline;
}

.flow-card--center .flow-card__title {
    margin-inline: auto;
}

.flow-card__description,
.rating-card__description {
    margin: 0 auto;
    max-width: 32rem;
    color: var(--color-muted);
    line-height: 1.65;
}

.flow-card--center .flow-card__description {
    margin-inline: auto;
}

.feedback-card .flow-card__description {
    margin-inline: auto;
    max-width: 27rem;
}

.thanks-card .flow-card__title {
    max-width: 12ch;
    font-size: clamp(32px, 8vw, 46px);
}

.thanks-card .flow-card__description {
    max-width: 31rem;
}

.rating-widget {
    display: grid;
    gap: 14px;
    margin-top: 2px;
}

.rating-widget__helper,
.rating-widget__result {
    margin: 0;
    color: var(--color-muted);
}

.rating-widget__helper {
    color: var(--color-muted-strong);
    font-size: 15px;
    font-weight: 750;
}

.rating-widget__stars {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(7px, 2vw, 11px);
    width: 100%;
    margin: 0 auto;
    padding: 9px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff6e7, #fffdf8);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9);
    min-width: 0;
}

.rating-widget__star {
    min-width: 0;
    min-height: clamp(58px, 17vw, 82px);
    border: 1px solid rgb(234 220 200 / 0.95);
    border-radius: var(--radius);
    background: #fffaf2;
    color: #d8c7ad;
    font-size: clamp(30px, 9vw, 46px);
    line-height: 1;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 1px 0 rgb(255 255 255 / 0.9);
    transition:
        color 160ms ease,
        background-color 160ms ease,
        border-color 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

.rating-widget__star:hover,
.rating-widget__star:focus-visible {
    color: var(--color-accent);
    border-color: rgb(199 146 62 / 0.42);
    transform: translateY(-1px);
}

.rating-widget__star.is-selected,
.rating-widget__star.is-active {
    color: var(--color-accent);
    border-color: rgb(199 146 62 / 0.48);
    background: linear-gradient(180deg, #fff0c9, #fffaf2);
    box-shadow: 0 12px 28px rgb(199 146 62 / 0.2);
}

.rating-widget__star.is-pressed {
    animation: star-press 200ms ease-out both;
}

.rating-widget__result {
    min-height: 26px;
    font-weight: 700;
}

.rating-card__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding-top: 2px;
}

.rating-card__meta span {
    border: 1px solid rgb(234 220 200 / 0.9);
    border-radius: 999px;
    background: rgb(255 250 242 / 0.76);
    color: var(--color-muted-strong);
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800;
}

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius);
    padding: 0 20px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        box-shadow 160ms ease,
        filter 160ms ease,
        transform 160ms ease,
        opacity 160ms ease;
}

.button--primary {
    background:
        linear-gradient(180deg, rgb(255 255 255 / 0.1), transparent),
        #6f4e37;
    color: #ffffff;
    box-shadow: 0 16px 34px rgb(49 81 63 / 0.24);
}

.button--primary:hover {
    background:
        linear-gradient(180deg, rgb(255 255 255 / 0.08), transparent),
        #5b3f2d;
    filter: none;
    transform: translateY(-1px);
}

.button--primary:active {
    transform: translateY(0);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
}

.feedback-form .button.is-submitting {
    position: relative;
    filter: none;
}

.feedback-form .button.is-submitting::before {
    content: "";
    width: 16px;
    height: 16px;
    margin-right: 9px;
    border: 2px solid rgb(255 255 255 / 0.46);
    border-top-color: #ffffff;
    border-radius: 999px;
    animation: spin 720ms linear infinite;
}

.button--full {
    width: 100%;
}

.feedback-form {
    display: grid;
    gap: 22px;
    margin-top: 0;
}

.field {
    display: grid;
    gap: 8px;
    text-align: left;
}

.field__label {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: var(--color-text);
    font-weight: 800;
    line-height: 1.25;
}

.field__required {
    color: #6f4e37;
    font-size: 1em;
    font-weight: 850;
}

.field__control {
    width: 100%;
    min-height: 54px;
    border: 1px solid rgb(222 204 178 / 0.98);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgb(255 250 242 / 0.98), rgb(255 246 233 / 0.96));
    color: var(--color-text);
    font: inherit;
    padding: 14px 15px;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9);
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.field__control:focus {
    outline: 0;
    border-color: var(--color-primary);
    background: #fffdf8;
    box-shadow: var(--focus-ring), 0 12px 26px rgb(58 36 23 / 0.08);
    transform: translateY(-1px);
}

.field__control[aria-invalid="true"] {
    border-color: #c3372d;
    box-shadow: 0 0 0 3px rgb(195 55 45 / 0.12);
}

.field__control--textarea {
    min-height: 150px;
    line-height: 1.6;
    resize: vertical;
}

.field__error {
    display: block;
    min-height: 0;
    color: #c3372d;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.field__error:empty {
    display: none;
}

.selected-rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgb(199 146 62 / 0.32);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff0c9, #fffaf2);
    padding: 12px 14px;
    text-align: left;
    box-shadow: 0 10px 24px rgb(199 146 62 / 0.13);
}

.selected-rating--center {
    display: grid;
    gap: 2px;
    text-align: center;
}

.selected-rating span {
    color: var(--color-muted-strong);
    font-size: 13px;
    font-weight: 800;
}

.selected-rating strong {
    color: var(--color-secondary);
    font-size: 20px;
    line-height: 1.2;
}

.success-pill {
    width: fit-content;
    justify-self: center;
    border: 1px solid #e3c89c;
    border-radius: 999px;
    background: #f8f1e7;
    color: #6a4a35;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 800;
}

.notice {
    display: grid;
    gap: 4px;
    border-radius: 18px;
    padding: 14px;
    text-align: left;
}

.notice--warning {
    border: 1px solid #f2d48a;
    background: #fff0c9;
    color: #7a4a00;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    justify-self: center;
    color: #6b7280;
    font-weight: 600;
    text-decoration: none;
    transition: color 160ms ease;
}

.text-link:hover,
.text-link:focus-visible {
    color: #4b5563;
}

.text-link__icon {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.site-footer {
    color: var(--color-muted);
    font-size: 13px;
    text-align: center;
}

@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes star-press {
    0% {
        transform: scale(1);
    }

    48% {
        transform: scale(0.92);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes success-pop {
    from {
        opacity: 0;
        transform: scale(0.88) translateY(4px);
    }
}

@media (min-width: 720px) {
    body {
        background:
            linear-gradient(90deg, rgb(255 250 242 / 0.72), rgb(251 244 232 / 0.82)),
            url("../images/Desktop-bg-cafe.png"),
            linear-gradient(135deg, #fffaf2 0%, #fbf4e8 48%, #f3e4cf 100%);
        background-attachment: fixed, fixed, fixed;
        background-position: center, center, center;
        background-repeat: no-repeat, no-repeat, no-repeat;
        background-size: cover, cover, cover;
    }

    .site-shell {
        width: min(100%, 680px);
    }

    .brand-logo {
        width: clamp(170px, 26vw, 190px);
        margin-block: -18px -24px;
    }

    .feedback-card .brand-logo {
        margin-block: -6px -24px;
    }

    .feedback-card .flow-card__description {
        max-width: 34rem;
    }

    .rating-card__title {
        max-width: 18ch;
        font-size: clamp(38px, 4.4vw, 40px);
        line-height: 1.08;
    }

    .rating-card__title-line,
    .rating-card__title-line--desktop {
        display: block;
    }

    .rating-card__title-line--mobile {
        display: none;
    }

}

@media (max-width: 430px) {
    .site-shell {
        padding: 14px;
    }

    .site-main {
        padding-block: 18px 24px;
    }

    .flow-card,
    .rating-card {
        padding: 18px;
    }

    .rating-card,
    .feedback-card,
    .thanks-card {
        gap: 20px;
    }

    .flow-card__title,
    .rating-card__title {
        max-width: 10ch;
        font-size: 30px;
    }

    .rating-card__title {
        max-width: 17ch;
        font-size: clamp(28px, 8vw, 30px);
        line-height: 1.1;
    }

    .feedback-card .flow-card__title,
    .thanks-card .flow-card__title {
        font-size: 30px;
    }

    .feedback-card .flow-card__title {
        max-width: 14ch;
        font-size: 28px;
        line-height: 1.08;
    }

    .rating-widget__stars {
        gap: 5px;
        padding: 6px;
    }

    .rating-widget__star {
        min-height: 50px;
        font-size: 27px;
    }

    .selected-rating {
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
        padding-block: 10px;
    }
}

@media (max-width: 768px) {
    .feedback-card .flow-card__title {
        max-width: 280px;
        font-size: clamp(30px, 8vw, 34px);
        line-height: 1.08;
    }

    .feedback-title__line {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
