/* ============================================================
   Arayat Sports Center — design system (shared by all views)
   Brand: royal blue + white, orange accent (from flyer)
   ============================================================ */
:root {
  --blue-950: #021a5c;
  --blue-900: #04237a;
  --blue-800: #062c96;
  --blue-700: #0a36b0;   /* primary brand blue */
  --blue-600: #1746c9;
  --blue-500: #2f5fe0;
  --blue-100: #e3eaff;
  --blue-50:  #f2f5ff;
  --orange-600: #e2620f;
  --orange-500: #f47b20; /* accent */
  --orange-100: #ffeedd;

  --ink: #0b1533;
  --ink-2: #3a4566;
  --ink-3: #6b7594;
  --line: #e3e7f2;
  --line-2: #cfd6e8;
  --bg: #f5f7fc;
  --surface: #ffffff;

  --ok: #0f9d58;   --ok-bg: #e4f6ec;
  --warn: #b26a00; --warn-bg: #fff3d6;
  --danger: #d93025; --danger-bg: #fde7e5;
  --info: #1a5fd0; --info-bg: #e3edff;
  --muted: #6b7594; --muted-bg: #eef0f6;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(4, 35, 122, .06), 0 1px 1px rgba(4, 35, 122, .04);
  --shadow: 0 6px 20px -6px rgba(4, 35, 122, .18), 0 2px 6px rgba(4, 35, 122, .06);
  --shadow-lg: 0 24px 60px -20px rgba(4, 35, 122, .35);
  --ring: 0 0 0 3px rgba(47, 95, 224, .28);

  --font-display: 'Saira', 'Saira Condensed', system-ui, sans-serif;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --header-h: 64px;
  --gutter: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.container-sm { max-width: 760px; }
.stack > * + * { margin-top: var(--stack, 16px); }
.row { display: flex; gap: 12px; align-items: center; }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.strong { font-weight: 700; }
.display { font-family: var(--font-display); }
.eyebrow { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-size: .78rem; color: var(--orange-500); }
.center { text-align: center; }
.hide-mobile { } @media (max-width: 720px) { .hide-mobile { display: none !important; } }
.only-mobile { display: none !important; } @media (max-width: 720px) { .only-mobile { display: initial !important; } }

/* ---------- buttons ---------- */
.btn {
  --bh: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--bh); padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none !important;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease, border-color .15s;
  white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--blue-700); color: #fff; box-shadow: 0 6px 16px -6px rgba(10, 54, 176, .6); }
.btn-primary:hover { background: var(--blue-600); }
.btn-accent { background: var(--orange-500); color: #fff; box-shadow: 0 6px 16px -6px rgba(244, 123, 32, .6); }
.btn-accent:hover { background: var(--orange-600); }
.btn-white { background: #fff; color: var(--blue-800); }
.btn-white:hover { background: var(--blue-50); }
.btn-outline { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-outline:hover { border-color: var(--blue-500); color: var(--blue-700); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--blue-50); color: var(--blue-700); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-soft { background: var(--danger-bg); color: var(--danger); }
.btn-sm { --bh: 36px; padding: 0 12px; font-size: .85rem; border-radius: 10px; }
.btn-lg { --bh: 54px; padding: 0 26px; font-size: 1.05rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--bh); padding: 0; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
@media (max-width: 600px) { .card-pad { padding: 16px; } }
.card-hover { transition: box-shadow .2s, transform .2s, border-color .2s; }
.card-hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--blue-100); }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* ---------- badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-danger { color: var(--danger); background: var(--danger-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-muted { color: var(--muted); background: var(--muted-bg); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: .85rem; font-weight: 600; cursor: pointer; }
.chip.is-active { background: var(--blue-700); color: #fff; border-color: var(--blue-700); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.label { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.hint { font-size: .78rem; color: var(--ink-3); }
.error-text { font-size: .8rem; color: var(--danger); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); font: inherit; font-size: 16px; /* 16px avoids iOS zoom */ color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: var(--ring); }
.input.is-invalid { border-color: var(--danger); }

/* Selectable option tiles (radio/checkbox cards) */
.option {
  position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
  border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.option:hover { border-color: var(--blue-500); }
.option.is-selected { border-color: var(--blue-700); background: var(--blue-50); box-shadow: 0 0 0 1px var(--blue-700) inset; }
.option.is-disabled { opacity: .45; pointer-events: none; }
.option input { position: absolute; opacity: 0; pointer-events: none; }

/* Segmented control */
.seg { display: inline-flex; padding: 4px; background: var(--muted-bg); border-radius: 12px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: .88rem; color: var(--ink-2); cursor: pointer; }
.seg button.is-active { background: var(--surface); color: var(--blue-700); box-shadow: var(--shadow-sm); }

/* Stepper (− n +) */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--surface); }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; color: var(--blue-700); }
.stepper button:disabled { color: var(--line-2); }
.stepper output { min-width: 40px; text-align: center; font-weight: 700; }

/* Toggle switch */
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); transition: .2s; }
.switch input:checked + span { background: var(--blue-700); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.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(--ink-3); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover { background: var(--blue-50); }

/* ---------- stat tiles ---------- */
.stat { padding: 18px; }
.stat .k { font-size: .78rem; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--ink); line-height: 1.15; margin-top: 4px; }

/* ---------- modal / sheet ---------- */
.overlay { position: fixed; inset: 0; background: rgba(2, 18, 64, .5); backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; animation: pop .18s ease; }
.modal-lg { max-width: 820px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 600px) {
  .overlay { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 22px 22px 0 0; max-height: 92dvh; animation: sheet .22s ease; }
  .modal-foot .btn { flex: 1; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes sheet { from { transform: translateY(100%); } }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(20px + var(--safe-b)); transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 500; display: flex; gap: 10px; align-items: center; animation: pop .2s ease; }
.toast.ok { background: #0b6b3d; } .toast.err { background: #a8231b; }

/* ---------- empty state / skeleton ---------- */
.empty { text-align: center; padding: 40px 16px; color: var(--ink-3); }
.empty .ico { font-size: 2.2rem; margin-bottom: 8px; }

/* ---------- brand bits ---------- */
.brand-bg { background: radial-gradient(1200px 500px at 80% -10%, #2a59e8 0%, transparent 60%), linear-gradient(160deg, var(--blue-800), var(--blue-950)); color: #fff; }
.dots-bg { background-image: radial-gradient(rgba(255,255,255,.18) 1.2px, transparent 1.3px); background-size: 14px 14px; }
.logo-wide { height: 40px; width: auto; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Demo view switcher (remove for production) ---------- */
#demo-bar {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 7px var(--gutter); background: var(--blue-950); color: #fff; font-size: .8rem;
  border-bottom: 1px solid rgba(255,255,255,.08); position: relative; z-index: 60;
}
.demo-tag { background: var(--orange-500); color: #fff; font-weight: 800; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.demo-label { color: rgba(255,255,255,.7); font-weight: 600; }
.demo-seg { display: inline-flex; gap: 2px; padding: 3px; background: rgba(255,255,255,.1); border-radius: 10px; }
.demo-seg button {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: rgba(255,255,255,.85);
  font-weight: 700; font-size: .8rem; padding: 6px 12px; min-height: 32px; border-radius: 8px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background .15s, color .15s;
}
.demo-seg button:hover { background: rgba(255,255,255,.12); color: #fff; }
.demo-seg button.is-active { background: #fff; color: var(--blue-800); box-shadow: var(--shadow-sm); }
.demo-short { display: none; }
@media (max-width: 560px) {
  #demo-bar { gap: 8px; }
  .demo-label { display: none; }
  .demo-long { display: none; }
  .demo-short { display: inline; }
  .demo-seg button { padding: 6px 10px; }
}
@media print { #demo-bar { display: none; } }

/* ---------- payment chip (shared) ---------- */
.pay-chip { display: inline-grid; place-items: center; flex: none; border-radius: 10px; background: var(--pc, #475569); color: #fff; font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }

.pay-chip-logo { background: #fff; border: 1px solid var(--line); box-shadow: none; padding: 4px 6px; color: var(--pc); }
.pay-chip-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
