/* Festival mini sistemi. Rənglərin işi:
   --brand (nar qırmızısı) — başlıq və əsas düymələr, festival istiliyi;
   --pay (yaşıl) — yalnız ödəniş/uğur; --warn (zəfəran) — az qalıq, gözləyən növbə;
   --danger — ləğv/səhv; --ink — mətn, qiymət ən qalın element. */
@font-face { font-family: Onest; src: url(/shared/fonts/Onest_500Medium.ttf); font-weight: 400 500; font-display: swap; }
@font-face { font-family: Onest; src: url(/shared/fonts/Onest_700Bold.ttf); font-weight: 600 800; font-display: swap; }

:root {
  --brand: #b3203a; --brand-deep: #8a1328; --brand-tint: #fbe9ec;
  --pay: #1f8a52; --pay-tint: #e3f4ea;
  --warn: #d98b0b; --warn-tint: #fdf1dc;
  --danger: #c62828;
  --ink: #1d1a1f; --muted: #6d6670; --line: #e7e1e3;
  --bg: #f6f2ef; --card: #ffffff;
  --r: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
button, a, input, select, label { touch-action: manipulation; } /* toxunuşda gecikmə və təsadüfi böyütmə olmasın */
body { font: 500 16px/1.4 Onest, system-ui, sans-serif; color: var(--ink); background: var(--bg); -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: var(--ink); }
.hidden { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; font-weight: 700; background: var(--brand); color: #fff; transition: filter .15s, transform .05s; }
a.btn { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn.pay { background: var(--pay); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid #f0c9c9; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }

.field { display: grid; gap: 6px; min-width: 0; font-size: 14px; color: var(--muted); }
.field input, .field select, .field textarea { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; width: 100%; min-width: 0; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; min-height: 40px; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }

.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: var(--brand); color: #fff; }
.topbar .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: .2px; }
.topbar .logo small { font-weight: 500; font-size: 13px; opacity: .8; display: block; letter-spacing: 0; }
.topbar .sp { flex: 1; }
.topbar .btn.ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.25); }
.flake { width: 34px; height: 34px; flex: none; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.16); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #7ee2a8; }
.pill.off .dot { background: #ffcf70; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px;
  border-radius: 12px; font-weight: 700; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: calc(100vw - 32px); }
.toast.err { background: var(--danger); }

/* PIN ekranı */
.pin-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(circle at 20% 10%, #c83a52 0, transparent 45%), var(--brand-deep); }
.pin-card { background: var(--card); border-radius: 22px; padding: 28px 24px; width: min(360px, 100%); text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.pin-card h1 { margin: 8px 0 2px; font-size: 22px; }
.pin-card p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin-bottom: 18px; height: 16px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); }
.pin-dots i.on { background: var(--brand); border-color: var(--brand); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { height: 62px; border-radius: 14px; background: var(--bg); font-size: 24px; font-weight: 700; }
.keypad button:active { background: var(--brand-tint); }
.pin-err { color: var(--danger); min-height: 22px; font-size: 14px; margin-top: 10px; }

/* çek (yalnız çapda görünür) */
#receipt { display: none; }
@media print {
  @page { size: 80mm auto; margin: 0; }
  body { background: #fff; }
  body > *:not(#receipt) { display: none !important; }
  #receipt { display: block; width: 72mm; margin: 0 auto; padding: 4mm 0; font: 500 12px/1.35 Onest, sans-serif; color: #000; }
  #receipt h2 { text-align: center; margin: 0; font-size: 17px; }
  #receipt .c { text-align: center; }
  #receipt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
  #receipt table { width: 100%; border-collapse: collapse; }
  #receipt td { padding: 1px 0; vertical-align: top; }
  #receipt td.r { text-align: right; white-space: nowrap; }
  #receipt .big { font-size: 16px; font-weight: 800; }
  #receipt section + section { break-before: page; }
  #receipt .kitchen .big td { padding: 3px 0; font-size: 18px; }
}
