:root {
    color-scheme: light;
    --ink: #201f1d;
    --muted: #6f6b66;
    --paper: #fafafa;
    --surface: #ffffff;
    --surface-solid: #ffffff;
    --line: #eaeaea;
    --accent: #c96442;
    --accent-dark: #a94b2d;
    --accent-soft: #f4ddd2;
    --success: #28745d;
    --success-soft: #dceee7;
    --danger: #aa3e3e;
    --danger-soft: #f5dddd;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}

button,
input {
    font: inherit;
}

button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
}

.page-shell {
    width: min(1240px, calc(100% - 40px));
    margin-inline: auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid #2d2d2d;
    border-radius: 11px;
    color: #ffffff;
    background: #171717;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.hero {
    width: min(920px, 100%);
    margin-inline: auto;
    min-height: 0;
    padding: 76px 22px 38px;
    text-align: center;
}

.hero-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(26px, 3vw, 32px);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.15;
}

.hero h1 span {
    color: var(--ink);
}

.hero-description {
    max-width: 570px;
    margin: 13px auto 0;
    color: var(--muted);
    font-size: 15px;
}

.redeem-layout {
    width: min(920px, 100%);
    margin: 0 auto 32px;
}

.redeem-card {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.redeem-card {
    overflow: hidden;
}

.card-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 23px 26px 19px;
    border-bottom: 1px solid var(--line);
}

.card-heading h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 500;
}

.form-step {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    padding: 21px 26px;
    border-bottom: 1px solid var(--line);
}

.form-step-last {
    border-bottom: 0;
}

.step-number {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid #e8b39d;
    border-radius: 50%;
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-size: 14px;
    font-weight: 800;
}

.step-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 12px;
}

.step-title-row h3 {
    margin: 0 0 2px;
    font-size: 17px;
}

.step-title-row p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.state-badge {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--muted);
    background: #eeeae4;
    font-size: 11px;
    font-weight: 700;
}

.state-badge.is-success {
    color: var(--success);
    background: var(--success-soft);
}

.state-badge.is-error {
    color: var(--danger);
    background: var(--danger-soft);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

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

.field input {
    height: 44px;
    padding: 0 15px;
    font-size: 14px;
}

.field input:focus {
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 4px rgba(201, 100, 66, 0.11);
}

.input-action-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.grow-field {
    flex: 1;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 19px;
    border-radius: 13px;
    cursor: pointer;
    font-weight: 750;
    transition: transform 150ms ease, opacity 150ms ease, background 150ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:active:not(:disabled) {
    transform: translateY(0);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.button-secondary {
    color: var(--ink);
    background: #e7e1d9;
}

.button-secondary:hover:not(:disabled) {
    background: #ddd5cb;
}

.button-primary {
    color: white;
    background: var(--accent);
}

.button-primary:hover:not(:disabled) {
    background: var(--accent-dark);
}

.button-dark {
    color: white;
    background: var(--ink);
}

.button-wide {
    width: 100%;
}

.field-message {
    min-height: 16px;
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.field-message:empty {
    display: none;
}

.field-message.is-success {
    color: var(--success);
}

.field-message.is-error {
    color: var(--danger);
}

.field-help {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.field-help a {
    color: var(--accent-dark);
    font-weight: 700;
}

.confirm-row {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0 0 12px;
    color: #514e4a;
    cursor: pointer;
    font-size: 13px;
}

.confirm-row input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.custom-checkbox {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    border: 1px solid #bdb6ad;
    border-radius: 5px;
    background: white;
}

.confirm-row input:checked + .custom-checkbox {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 4px white;
}

.confirm-row input:focus-visible + .custom-checkbox {
    box-shadow: 0 0 0 4px rgba(201, 100, 66, 0.15);
}

.redeem-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 26px 22px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafafa;
}

.redeem-result[hidden] {
    display: none;
}

.redeem-result > div {
    min-width: 0;
}

.redeem-result #status-code {
    display: block;
    margin-bottom: 2px;
    color: var(--accent-dark);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.redeem-result h2 {
    margin: 0;
    font-size: 15px;
}

.redeem-result p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.redeem-result .button {
    flex: 0 0 auto;
    min-height: 38px;
}

.redeem-result.is-processing {
    border-color: #efd2c7;
    background: #fff8f5;
}

.redeem-result.is-success {
    border-color: #cfe4dc;
    background: #f3faf7;
}

.redeem-result.is-error {
    border-color: #efcaca;
    background: #fff6f6;
}

@media (max-width: 820px) {
    .hero {
        padding: 44px 2vw 30px;
    }

}

@media (max-width: 620px) {
    .page-shell {
        width: min(100% - 24px, 1180px);
    }

    .hero {
        min-height: auto;
        padding: 36px 2px 24px;
    }

    .hero-title-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .brand {
        padding: 7px 11px;
        font-size: 12px;
    }

    .hero h1 {
        font-size: clamp(23px, 7vw, 27px);
    }

    .hero-description {
        margin: 9px 0 11px;
        font-size: 14px;
    }

    .redeem-card {
        border-radius: 22px;
    }

    .card-heading {
        padding: 20px 17px 17px;
    }

    .form-step {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 10px;
        padding: 18px 17px;
    }

    .step-number {
        width: 34px;
        height: 34px;
    }

    .step-title-row {
        gap: 12px;
    }

    .input-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .redeem-result {
        align-items: stretch;
        flex-direction: column;
        margin: 0 17px 17px;
    }

}

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