:root {
    --green-900: #0f3d1f;
    --green-700: #1f7a3a;
    --green-600: #26924a;
    --green-100: #e6f4ea;
    --lime: #9bd35a;
    --ink: #1b2420;
    --muted: #5b6862;
    --line: #d5ddd8;
    --bg: #f5f8f6;
    --error: #b3261e;
    --error-bg: #fdecea;
    --radius: 12px;
    --focus: 0 0 0 3px rgba(38, 146, 74, .35);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }

.site-header {
    background: var(--green-900);
    color: #fff;
    border-bottom: 4px solid #f2b21b;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.logo { display: block; height: 50px; width: auto; }
.brand-tag { margin: 0; font-size: .9rem; opacity: .85; }

.container { width: 100%; max-width: 640px; margin: 0 auto; padding: 24px 16px 40px; flex: 1; }

.card-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
h1 { margin: 0 0 6px; font-size: 1.6rem; color: var(--green-900); }
.lead { margin: 0 0 20px; color: var(--muted); }

.alert {
    background: var(--error-bg);
    border-left: 4px solid var(--error);
    color: var(--error);
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 600;
}

fieldset { border: 0; margin: 0 0 24px; padding: 0; min-width: 0; }
legend {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--green-900);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.step {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--green-700);
    color: #fff;
    font-size: .9rem;
}

.field { margin-bottom: 16px; }
.field-narrow { max-width: 200px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
.req, .opt { font-weight: 400; color: var(--muted); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
fieldset > .hint { margin: -4px 0 14px; }
.card-guide { margin: 0 0 16px; }
.card-guide summary { cursor: pointer; font-weight: 600; color: var(--green-700); }
.card-guide img { display: block; width: 100%; max-width: 340px; height: auto; margin-top: 10px; }

input[type="text"], input[type="tel"], input[type="email"] {
    width: 100%;
    font: inherit;
    font-size: 1.1rem;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
}
#card_number, #cvv { font-variant-numeric: tabular-nums; letter-spacing: .08em; }
input:focus { outline: none; border-color: var(--green-600); box-shadow: var(--focus); }
input[aria-invalid="true"] { border-color: var(--error); background: var(--error-bg); }
.field-error { color: var(--error); margin: 6px 0 0; font-size: .92rem; font-weight: 600; }

.input-with-action { display: flex; gap: 8px; }
.input-with-action input { flex: 1; }

.check {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
}
.check-invalid { border-color: var(--error); background: var(--error-bg); }
.check input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--green-700); }
.check label { font-weight: 400; margin: 0; }
.check + .field-error { margin: -4px 0 10px; }
.badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 1px 7px;
    border-radius: 999px;
    background: #eef1ef;
    color: var(--muted);
    margin-right: 4px;
}
.badge-req { background: var(--green-100); color: var(--green-700); }

.legal { border-top: 1px solid var(--line); padding: 10px 0; }
.legal:last-of-type { border-bottom: 1px solid var(--line); }
.legal summary { cursor: pointer; font-weight: 600; color: var(--green-700); }
.legal p { font-size: .92rem; color: var(--muted); margin: 10px 0 4px; }

a { color: var(--green-700); }

.btn-primary, .btn-secondary {
    font: inherit;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.btn-primary {
    width: 100%;
    padding: 16px;
    font-size: 1.15rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #fff;
    background: var(--green-700);
    border: 0;
}
.btn-primary:hover { background: var(--green-600); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-secondary {
    padding: 11px 16px;
    color: var(--green-700);
    background: #fff;
    border: 1.5px solid var(--green-700);
}
.btn-primary:focus-visible, .btn-secondary:focus-visible { outline: none; box-shadow: var(--focus); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.success { text-align: center; }
.success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--green-100);
    color: var(--green-700);
    font-size: 2.4rem;
    display: grid;
    place-items: center;
}

dialog {
    border: 0;
    border-radius: var(--radius);
    padding: 20px;
    width: min(92vw, 480px);
}
dialog::backdrop { background: rgba(15, 61, 31, .6); }
dialog h2 { margin: 0 0 4px; color: var(--green-900); }
#scan-video { width: 100%; border-radius: 8px; background: #000; margin: 12px 0 8px; aspect-ratio: 4 / 3; object-fit: cover; }
.scan-status { min-height: 1.5em; color: var(--muted); margin: 0 0 10px; }

.site-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 16px; }
.site-footer p { margin: 2px 0; }

/* Shared in-store tablet: larger touch targets. */
.kiosk { font-size: 18px; }
.kiosk .container { max-width: 760px; }
.kiosk .check input { width: 30px; height: 30px; }

@media (max-width: 480px) {
    .card-panel { padding: 22px 16px; }
    .brand-tag { display: none; }
}
