:root {
    --bg: #f6f4ef;
    --surface: #ffffff;
    --surface-2: #fbf9f4;
    --ink: #1d2a2a;
    --muted: #5f6e6e;
    --line: #e4e0d6;
    --brand: #0f5b5c;
    --brand-ink: #0f3d3e;
    --brand-soft: #e3f0ee;
    --accent: #c2593f;
    --ok: #2f7d4f;
    --warn: #a66a00;
    --bad: #b03a2e;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15, 61, 62, .06), 0 8px 24px rgba(15, 61, 62, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.15; color: var(--brand-ink); letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); margin: .2em 0 .4em; font-weight: 800; }
h2 { font-size: 1.45rem; margin: 0 0 .5em; }
h3 { font-size: 1.15rem; margin: 0 0 .4em; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 32px; padding-bottom: 64px; min-height: 60vh; }
.main.wide { max-width: 1320px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .92rem; }
.kicker { text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; color: var(--accent); font-weight: 700; margin: 0; }

/* header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--brand-ink); text-decoration: none; font-size: 1.05rem; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; font-size: .95rem; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a.is-on { background: var(--brand-soft); color: var(--brand-ink); }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 24px 0; font-size: .88rem; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border: 0; border-radius: 10px; cursor: pointer;
    background: var(--brand); color: #fff; font: inherit; font-weight: 700; text-decoration: none;
    transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-ink); }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 15px 26px; font-size: 1.05rem; width: 100%; }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn-ghost { background: transparent; color: var(--brand-ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1.5px #ecc9c4; }
.btn-danger:hover { background: #fbeceb; }

/* hero */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding: 24px 0 40px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.facts { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; }
.facts li { padding-left: 26px; position: relative; }
.facts li::before { content: "✦"; position: absolute; left: 0; color: var(--accent); }
.hero-ticket { display: flex; justify-content: center; }

.ticket {
    position: relative; display: flex; flex-direction: column; gap: 6px;
    width: 100%; max-width: 360px; padding: 26px 28px;
    background: linear-gradient(135deg, var(--brand) 0%, #136f6f 100%); color: #fff;
    border-radius: 18px; box-shadow: 0 18px 40px rgba(15, 91, 92, .28);
    transform: rotate(-2deg);
}
.ticket::before, .ticket::after {
    content: ""; position: absolute; top: 50%; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); transform: translateY(-50%);
}
.ticket::before { left: -13px; }
.ticket::after { right: -13px; }
.ticket-kicker { text-transform: uppercase; letter-spacing: .2em; font-size: .72rem; color: #bfe0dc; }
.ticket-name { font-size: 1.35rem; font-weight: 800; }
.ticket-value { font-size: 2.3rem; font-weight: 800; letter-spacing: -.02em; }
.ticket-code { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; letter-spacing: .08em; padding-top: 10px; border-top: 1.5px dashed rgba(255, 255, 255, .35); }
.ticket-inline { transform: none; margin: 24px auto; text-align: left; }

/* cards */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.choose { margin-bottom: 40px; }
.card-amount { display: grid; gap: 14px; justify-items: start; border-left: 5px solid var(--accent); }
.card-amount p { margin: 0; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); text-decoration: none; font-weight: 700; }
.chip:hover { box-shadow: inset 0 0 0 1.5px var(--brand); color: var(--brand-ink); }

.section-title { margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.package { display: flex; flex-direction: column; }
.package p { margin: 0 0 10px; }
.ticks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; flex: 1; }
.ticks li { padding-left: 24px; position: relative; font-size: .95rem; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.package-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.price { font-weight: 800; font-size: 1.3rem; color: var(--brand-ink); white-space: nowrap; }

/* buy form */
.buy { max-width: 640px; margin: 0 auto; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.step { font-size: .8rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.step.is-on { background: var(--brand); color: #fff; box-shadow: none; }

.form { display: grid; gap: 14px; }
.form fieldset { border: 0; margin: 0; padding: 22px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: 14px; }
.form legend { float: left; width: 100%; font-weight: 800; color: var(--brand-ink); font-size: 1.05rem; margin-bottom: 4px; padding: 0; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=number], .form input[type=search], .form textarea, .form select, .filters input, .filters select {
    width: 100%; padding: 12px 14px; font: inherit; font-weight: 500; color: var(--ink);
    background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 10px;
}
.form input:focus, .form textarea:focus, .filters input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.form .check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--brand); }
.field-error { color: var(--bad); font-size: .86rem; margin: -6px 0 0; font-weight: 600; }

.amount-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.amount-pick { position: relative; }
.amount-pick input { position: absolute; opacity: 0; }
.amount-pick span { display: block; text-align: center; padding: 12px 8px; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 800; cursor: pointer; }
.amount-pick input:checked + span { background: var(--brand); color: #fff; box-shadow: none; }
.amount-pick input:focus-visible + span { outline: 3px solid var(--brand-soft); }

.pkg-options { display: grid; gap: 8px; }
.pkg-option { display: flex !important; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; }
.pkg-option:has(input:checked) { box-shadow: inset 0 0 0 2px var(--brand); background: #fff; }
.pkg-option input { margin-top: 4px; accent-color: var(--brand); }
.pkg-body { display: grid; gap: 2px; flex: 1; font-weight: 500; }
.pkg-head { display: flex; justify-content: space-between; gap: 12px; }
.pkg-head .price { font-size: 1.05rem; }

/* alerts, results */
.alert { padding: 12px 16px; border-radius: 10px; margin: 0 0 16px; font-weight: 600; }
.alert-success { background: #e6f3ea; color: #1e5a37; }
.alert-error { background: #fbeceb; color: #8a2b22; }
.alert-info { background: #fdf3e2; color: #6e4a00; }

.result { max-width: 560px; margin: 24px auto; text-align: center; display: grid; justify-items: center; gap: 6px; }
.result .btn { margin-top: 8px; }
.result-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; font-weight: 800; background: var(--brand-soft); color: var(--brand); }
.result-paid .result-icon { background: #e6f3ea; color: var(--ok); }
.result-cancelled .result-icon, .result-failed .result-icon { background: #fbeceb; color: var(--bad); }
.spin { animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.prose { max-width: 720px; margin: 0 auto; }
.prose li { margin-bottom: 8px; }

/* admin */
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-head h1 { font-size: 1.8rem; margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input { width: 260px; max-width: 100%; padding: 8px 12px; }
.filters select { width: auto; padding: 8px 12px; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.actions form { display: flex; gap: 6px; margin: 0; }
.actions .note { width: 120px; padding: 5px 8px; font: inherit; font-size: .82rem; border: 1px solid var(--line); border-radius: 6px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.badge-active { background: #e6f3ea; color: #1e5a37; }
.badge-expired { background: #fdf3e2; color: #6e4a00; }
.badge-redeemed { background: var(--brand-soft); color: var(--brand-ink); }
.badge-void { background: #fbeceb; color: #8a2b22; }
.admin-split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.login-box { max-width: 380px; margin: 40px auto; background: var(--surface); padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow); }

@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; gap: 24px; }
    .admin-split { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .form fieldset, .card { padding: 18px; }
    .package-foot { flex-direction: column; align-items: stretch; }
    .nav a { padding: 6px 8px; }
}
