/* Ticketing: the public booking page (/ticket/CODE), the customer's booking page (/ticket/order/REF) and a single ticket (/ticket/t/CODE).
   Light on purpose (no framework): it is opened on phones, often at the door. --a is the event colour. */
:root { --a: #5867dd; --a-text: #fff; --ink: #1e222e; --muted: #6b7385; --line: #e4e6f0; --bg: #f2f3f7; --card: #fff; --ok: #188c62; --warn: #b45309; --warn-bg: #fff4dc; --bad: #b8352f; --bad-bg: #fde6e6; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
a { color: var(--a); }
.tk-wrap { max-width: 640px; margin: 0 auto; padding: 0 14px; }

/* hero */
.tk-hero { position: relative; color: #fff; background: var(--a) center/cover no-repeat; min-height: 190px; display: flex; align-items: flex-end; }
.tk-hero:before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.68) 100%); }
.tk-hero-in { position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding: 56px 16px 18px; }
.tk-logo { position: absolute; top: 12px; left: 16px; max-height: 38px; max-width: 45%; border-radius: 6px; background: rgba(255,255,255,.85); padding: 3px 6px; }
.tk-hero h1 { margin: 0 0 4px; font-size: 25px; line-height: 1.2; font-weight: 700; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.tk-hero p { margin: 0; font-size: 14px; opacity: .93; line-height: 1.4; }
.tk-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.tk-meta span { display: inline-flex; align-items: center; gap: 5px; }

.tk-card { background: var(--card); border-radius: 14px; box-shadow: 0 6px 22px rgba(30,34,46,.07); padding: 16px; margin: 14px 0; }
.tk-card h2 { margin: 0 0 10px; font-size: 17px; }
.tk-card h3 { margin: 0 0 8px; font-size: 15px; }
.tk-desc { font-size: 14px; line-height: 1.6; color: #3b4152; white-space: pre-line; }
.tk-muted { color: var(--muted); font-size: 13px; }
.tk-steps { display: flex; gap: 6px; margin: 14px 0 0; }
.tk-step { flex: 1; text-align: center; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; font-weight: 700; color: #a2a7bc; padding-bottom: 6px; border-bottom: 3px solid var(--line); }
.tk-step.on { color: var(--ink); border-color: var(--a); }
.tk-step.done { color: var(--ok); border-color: var(--ok); }

/* banners */
.tk-banner { border-radius: 10px; padding: 11px 13px; font-size: 14px; margin: 12px 0; line-height: 1.45; }
.tk-banner.warn { background: var(--warn-bg); color: var(--warn); }
.tk-banner.bad { background: var(--bad-bg); color: var(--bad); }
.tk-banner.ok { background: #e3f6ee; color: var(--ok); }
.tk-banner.info { background: #eaeefc; color: #3345b3; }

/* slots */
.tk-day { margin: 16px 2px 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.tk-slot { background: var(--card); border: 2px solid var(--line); border-radius: 14px; margin: 8px 0; overflow: hidden; }
.tk-slot.has { border-color: var(--a); }
.tk-slot.full { opacity: .62; }
.tk-slot-h { display: flex; align-items: center; gap: 10px; padding: 13px 14px; cursor: pointer; }
.tk-slot.full .tk-slot-h { cursor: default; }
.tk-slot-t { flex: 1; min-width: 0; }
.tk-slot-t strong { font-size: 17px; }
.tk-slot-t small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
.tk-pill { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tk-pill.low { background: var(--warn-bg); color: var(--warn); }
.tk-pill.full { background: #eceef4; color: #6b7385; }
.tk-pill.ok { background: #e3f6ee; color: var(--ok); }
.tk-pill.sel { background: var(--a); color: var(--a-text); }
.tk-slot-b { display: none; padding: 2px 14px 14px; border-top: 1px dashed var(--line); }
.tk-slot.open .tk-slot-b { display: block; }
.tk-chev { color: var(--muted); font-size: 18px; transition: transform .15s; }
.tk-slot.open .tk-chev { transform: rotate(90deg); }

/* ticket rows with steppers */
.tk-trow { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #f0f1f6; }
.tk-trow:last-child { border-bottom: 0; }
.tk-trow-n { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; }
.tk-trow-n small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.tk-trow-p { font-weight: 700; font-size: 15px; min-width: 54px; text-align: right; }
.tk-step-c { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.tk-step-c button { width: 42px; height: 42px; border: 0; background: #f7f8fc; font-size: 20px; font-weight: 700; color: var(--ink); cursor: pointer; }
.tk-step-c button:disabled { color: #c3c7d6; cursor: default; }
.tk-step-c span { min-width: 34px; text-align: center; font-weight: 700; font-size: 16px; }
.tk-fam { background: #eaf7f1; color: var(--ok); border-radius: 10px; padding: 9px 12px; font-size: 13px; margin-top: 10px; }

/* basket + form */
.tk-line { display: flex; gap: 10px; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #f0f1f6; font-size: 14px; }
.tk-line:last-child { border-bottom: 0; }
.tk-line small { display: block; color: var(--muted); }
.tk-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; padding-top: 12px; }
.tk-sub { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); padding: 3px 0; }
.tk-sub.good { color: var(--ok); }
.tk-rm { border: 0; background: none; color: var(--bad); font-size: 13px; cursor: pointer; padding: 4px 0; }
.tk-field { margin-bottom: 13px; }
.tk-field label { display: block; font-size: 13px; font-weight: 700; color: #4a5164; margin-bottom: 5px; }
.tk-input { width: 100%; font-size: 16px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f9f9fc; appearance: none; font-family: inherit; }
.tk-input:focus { outline: none; border-color: var(--a); background: #fff; }
.tk-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tk-plan { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 9px; cursor: pointer; }
.tk-plan.on { border-color: var(--a); background: #fafaff; }
.tk-plan input { margin-top: 3px; accent-color: var(--a); width: 18px; height: 18px; }
.tk-plan b { display: block; font-size: 15px; }
.tk-plan small { display: block; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.tk-check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: #4a5164; line-height: 1.45; }
.tk-check input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--a); }
.tk-terms { max-height: 110px; overflow: auto; background: #f7f8fc; border-radius: 8px; padding: 8px 10px; font-size: 12px; color: #555; margin-bottom: 8px; white-space: pre-line; }

/* buttons + sticky bar */
.tk-btn { display: block; width: 100%; border: 0; border-radius: 12px; padding: 15px 16px; font-size: 16px; font-weight: 700; background: var(--a); color: var(--a-text); cursor: pointer; text-align: center; text-decoration: none; font-family: inherit; }
.tk-btn:disabled { opacity: .45; cursor: default; }
.tk-btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.tk-btn.sm { padding: 10px 14px; font-size: 14px; display: inline-block; width: auto; }
.tk-bar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; box-shadow: 0 -6px 24px rgba(30,34,46,.12); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); z-index: 20; }
.tk-bar-in { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.tk-bar-in .tk-btn { flex: 1; }
.tk-bar-sum { font-size: 13px; color: var(--muted); line-height: 1.3; }
.tk-bar-sum b { display: block; color: var(--ink); font-size: 16px; }
.tk-spin { text-align: center; padding: 40px 0; color: var(--muted); }

/* a booking and its tickets */
.tk-ticket { text-align: center; }
.tk-ticket img.qr { width: 220px; height: 220px; max-width: 70%; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
.tk-ticket .code { font-family: "Courier New", monospace; font-weight: 700; letter-spacing: 1px; margin-top: 6px; }
.tk-ticket.used img.qr, .tk-ticket.cancelled img.qr { opacity: .25; }
.tk-state { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .5px; padding: 4px 12px; border-radius: 999px; margin: 6px 0; }
.tk-state.valid { background: #e3f6ee; color: var(--ok); }
.tk-state.used { background: var(--warn-bg); color: var(--warn); }
.tk-state.cancelled { background: var(--bad-bg); color: var(--bad); }
.tk-paytbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tk-paytbl td { padding: 9px 4px; border-bottom: 1px solid #f0f1f6; }
.tk-paytbl td:last-child { text-align: right; }
.tk-staffbox { background: #1e222e; color: #fff; border-radius: 14px; padding: 14px; margin: 14px 0; }
.tk-staffbox .tk-btn { background: #fff; color: #1e222e; }
.tk-foot { text-align: center; color: #9aa0b4; font-size: 12px; margin: 22px 0 6px; }
@media (min-width: 700px) { .tk-hero { min-height: 240px; } .tk-hero h1 { font-size: 30px; } }
