:root {
    color-scheme: light;
    --bg: #f7f8fa;
    --surface: #ffffff;
    --ink: #101828;
    --muted: #667085;
    --line: #d0d5dd;
    --line-soft: #eaecf0;
    --blue: #175cd3;
    --blue-dark: #1849a9;
    --green: #067647;
    --red: #b42318;
    --shadow: 0 20px 60px rgba(16, 24, 40, 0.1);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 0, rgba(23, 92, 211, 0.12), transparent 320px),
        var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
}

h1 {
    margin: 12px 0 22px;
    font-size: 24px;
    line-height: 1.2;
    text-align: center;
}

.redeem-shell {
    min-height: 100vh;
    display: grid;
    place-items: start center;
    padding: 42px 14px 28px;
}

.redeem-panel {
    width: min(440px, 100%);
    padding: 22px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin: 0 auto;
    border-radius: var(--radius);
    background: var(--ink);
    color: #ffffff;
    font-weight: 800;
}

form {
    display: grid;
    gap: 14px;
}

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

.field span,
.field-label label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.inline-link {
    padding: 0;
    background: transparent;
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
    cursor: pointer;
}

.inline-link:hover {
    color: var(--blue-dark);
}

input,
textarea {
    width: 100%;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--ink);
    outline: none;
}

input {
    height: 44px;
}

textarea {
    min-height: 112px;
    padding-top: 11px;
    padding-bottom: 11px;
    line-height: 1.45;
    resize: vertical;
}

textarea::placeholder {
    color: #98a2b3;
}

input:focus,
textarea:focus {
    border-color: #84caff;
    box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.12);
}

.action-row {
    display: block;
}

.primary-button {
    width: 100%;
    height: 44px;
    border-radius: var(--radius);
    background: var(--blue);
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.primary-button:hover {
    background: var(--blue-dark);
}

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

.buy-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    color: var(--blue);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.buy-link:hover {
    color: var(--blue-dark);
}

.message {
    min-height: 20px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.message.error {
    color: var(--red);
}

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

.progress-panel {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
}

.status-row,
.progress-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.status-row span,
.progress-main span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.status-row strong {
    color: var(--blue);
    font-size: 15px;
}

.progress-bar {
    height: 10px;
    margin: 14px 0 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f6;
}

.progress-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
    transition: width 0.25s ease;
}

.progress-main strong {
    font-size: 22px;
    line-height: 1.1;
}

.progress-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.progress-grid div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: #fcfcfd;
}

.progress-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.progress-grid strong {
    display: block;
    margin-top: 6px;
    overflow-wrap: anywhere;
    font-size: 17px;
    line-height: 1.15;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(16, 24, 40, 0.62);
}

.modal-card {
    width: min(1180px, 100%);
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
}

.modal-head strong {
    font-size: 15px;
}

.modal-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    background: #f2f4f7;
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.modal-card img {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: min(82vh, 680px);
    object-fit: contain;
    background: #000000;
}

.notice-card {
    width: min(360px, 100%);
}

.notice-body {
    padding: 18px 16px 8px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.6;
}

.notice-actions {
    padding: 12px 16px 16px;
}

.notice-confirm {
    height: 42px;
}

@media (max-width: 420px) {
    .redeem-shell {
        align-items: start;
        padding-top: 18px;
    }

    .redeem-panel {
        padding: 18px;
    }

    .field-label {
        align-items: flex-start;
    }

    .action-row {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 8px;
    }

    .modal-backdrop {
        align-items: start;
        padding: 16px 10px;
    }

    .modal-card img {
        max-height: 78vh;
    }

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