* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    background:
        linear-gradient(
            135deg,
            #f4f7fb 0%,
            #edf2f7 100%
        );
    color: #172033;
}

button,
textarea,
input {
    font: inherit;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
}

.feedback-card {
    width: 100%;
    max-width: 650px;
    background: #ffffff;
    border-radius: 18px;
    padding: 42px;
    box-shadow:
        0 20px 60px rgba(25, 42, 70, 0.12);
}

.brand {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin-bottom: 34px;
    color: #172033;
}

h1 {
    margin: 0 0 14px;
    font-size: clamp(28px, 5vw, 38px);
    line-height: 1.15;
    letter-spacing: -1px;
}

p {
    line-height: 1.65;
}

.lead {
    margin: 0 0 32px;
    font-size: 18px;
    color: #596579;
}

.feedback-step {
    display: none;
}

.feedback-step.is-active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

.rating-fieldset {
    padding: 0;
    margin: 0 0 30px;
    border: 0;
}

.rating-fieldset legend {
    display: block;
    width: 100%;
    margin-bottom: 14px;
    font-weight: 700;
    font-size: 16px;
}

.rating {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.rating button {
    cursor: pointer;
}

.star {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 2px;
    color: #d4d9e1;
    font-size: clamp(37px, 8vw, 50px);
    line-height: 1;
    transition:
        transform 0.15s ease,
        color 0.15s ease;
}

.star:hover {
    transform: translateY(-2px);
}

.star.selected {
    color: #f3b61f;
}

.star:focus-visible,
.zero-rating:focus-visible,
.primary-button:focus-visible,
.trustpilot-button:focus-visible {
    outline: 3px solid rgba(48, 103, 214, 0.35);
    outline-offset: 3px;
}

.zero-rating {
    width: 42px;
    height: 42px;
    margin-right: 5px;
    border: 2px solid #d8dee9;
    border-radius: 50%;
    background: #ffffff;
    color: #647086;
    font-weight: 800;
    transition: all 0.15s ease;
}

.zero-rating.selected {
    border-color: #596579;
    background: #596579;
    color: #ffffff;
}

.rating-label {
    min-height: 22px;
    margin-top: 10px;
    color: #687488;
    font-size: 14px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 9px;
    font-weight: 700;
}

textarea {
    width: 100%;
    min-height: 135px;
    resize: vertical;
    padding: 14px 15px;
    border: 1px solid #ccd4df;
    border-radius: 10px;
    color: #172033;
    background: #ffffff;
    line-height: 1.5;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

textarea::placeholder {
    color: #9099a8;
}

textarea:focus {
    outline: none;
    border-color: #3268d7;
    box-shadow:
        0 0 0 4px rgba(50, 104, 215, 0.1);
}

.primary-button,
.trustpilot-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 52px;
    padding: 13px 24px;
    border: 0;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 750;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        opacity 0.15s ease,
        box-shadow 0.15s ease;
}

.primary-button {
    width: 100%;
    background: #2865d5;
    color: #ffffff;
    box-shadow:
        0 8px 22px rgba(40, 101, 213, 0.22);
}

.primary-button:hover,
.trustpilot-button:hover {
    transform: translateY(-1px);
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.65;
    transform: none;
}

.trustpilot-button {
    margin-top: 14px;
    background: #00b67a;
    color: #ffffff;
}

.form-message {
    min-height: 0;
    margin-bottom: 15px;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
}

.form-message.error {
    padding: 12px 14px;
    background: #fff0f0;
    color: #9b2525;
    border-radius: 8px;
}

.form-message.success {
    padding: 12px 14px;
    background: #edf9f2;
    color: #176a3c;
    border-radius: 8px;
}

.state {
    text-align: center;
}

.state-icon {
    width: 62px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    border-radius: 50%;
    font-size: 27px;
    font-weight: 800;
}

.state-icon.success {
    background: #e7f8ef;
    color: #16844d;
}

.state-icon.neutral {
    background: #fff7df;
    color: #e0a21a;
}

.state-error .state-icon {
    background: #fdecec;
    color: #b93434;
}

.state-error h1 {
    font-size: 30px;
}

.page-footer {
    margin-top: 22px;
    color: #7a8494;
    font-size: 13px;
}

@media (max-width: 600px) {
    .page-shell {
        justify-content: flex-start;
        padding: 15px;
    }

    .feedback-card {
        padding: 27px 20px;
        border-radius: 14px;
    }

    .brand {
        margin-bottom: 26px;
    }

    .lead {
        font-size: 16px;
    }

    .rating {
        gap: 4px;
    }

    .zero-rating {
        width: 36px;
        height: 36px;
    }
}