/* קבלה בהצמדה - mobile first, RTL, IS 5568 / WCAG 2.1 AA.
   Contrast (text on background): body 17:1, muted 10:1, buttons 6.7:1, delivered 7.1:1,
   amber 14:1, demo banner 6.4:1. Touch targets >= 48px. No inline styles (CSP). */
:root {
  --text: #111827;
  --muted: #374151;
  --bg: #ffffff;
  --surface: #f3f4f6;
  --border: #9ca3af;
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --ok: #166534;
  --warn-bg: #fde68a;
  --warn-border: #92400e;
  --danger: #b91c1c;
  --error-bg: #fef2f2;
  --error-text: #991b1b;
  --focus: #1d4ed8;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 112.5%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Hebrew", Arial, sans-serif;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--primary); text-underline-offset: 0.15em; }
a:hover { color: var(--primary-dark); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip-link {
  position: absolute;
  inset-inline-start: 0.5rem;
  top: -4rem;
  background: var(--bg);
  color: var(--primary);
  padding: 0.75rem 1rem;
  z-index: 10;
}
.skip-link:focus { top: 0.5rem; }

.demo-banner {
  background: var(--danger);
  color: #ffffff;
  font-weight: 700;
  text-align: center;
  padding: 0.6rem 1rem;
}

.page { max-width: 34rem; margin: 0 auto; padding: 1rem 1rem 2rem; }
.page.wide { max-width: 72rem; }
main:focus { outline: none; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0.25rem 0 0.75rem; }
h2 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; }
.lead { font-size: 1.15rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  margin: 1rem 0;
}
.card.tone-error { background: var(--error-bg); border-color: var(--error-text); color: var(--error-text); }
.card.tone-ok { border-color: var(--ok); }

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 0.7rem 1.4rem;
  border: 2px solid var(--primary);
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, button:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #ffffff; }
.button.secondary, button.secondary { background: var(--bg); color: var(--primary); }
.button.secondary:hover, button.secondary:hover { background: var(--surface); color: var(--primary-dark); }
.button.block, button.block { display: flex; width: 100%; font-size: 1.15rem; }
button.danger { background: var(--danger); border-color: var(--danger); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 0.5rem 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.amount { font-size: 2rem; font-weight: 800; }

.consent {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  margin: 1rem 0;
  cursor: pointer;
}
.consent input { width: 1.6rem; height: 1.6rem; margin: 0.15rem 0 0; flex: none; accent-color: var(--primary); }
.field-error { color: var(--error-text); font-weight: 700; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { border-bottom: 1px solid var(--border); padding: 0.75rem 0; }
.list a { display: block; min-height: 44px; }

.spinner {
  width: 3rem;
  height: 3rem;
  margin: 1rem auto;
  border: 0.4rem solid var(--surface);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: center;
  padding: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}
.site-footer a { display: inline-block; min-height: 44px; line-height: 44px; }

/* station screen */
.station-body { background: var(--surface); }
.station {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: 18px;
  border: 4px solid var(--border);
  background: var(--bg);
}
.station-name { font-size: 1.2rem; color: var(--muted); margin: 0; }
.station-state { font-size: clamp(2rem, 7vw, 4.5rem); font-weight: 800; margin: 0.5rem 0; line-height: 1.15; }
.station-detail { font-size: clamp(1.4rem, 4vw, 2.6rem); margin: 0.25rem 0; }
.station-late { font-size: clamp(1.1rem, 3vw, 1.8rem); font-weight: 700; margin: 0.5rem 0 0; }
.station-qr { margin-top: 1rem; }
.station-qr img { width: min(60vw, 18rem); height: auto; background: #ffffff; padding: 0.5rem; border: 1px solid var(--border); }
.station.state-delivered { background: var(--ok); border-color: var(--ok); color: #ffffff; }
.station.state-delivered .station-name { color: #ffffff; }
.station.state-not_delivered { background: var(--warn-bg); border-color: var(--warn-border); }
.hidden { display: none !important; }

/* admin */
table { border-collapse: collapse; width: 100%; margin: 0.5rem 0 1rem; font-size: 0.95rem; }
th, td { border-bottom: 1px solid var(--border); padding: 0.5rem; text-align: start; vertical-align: top; }
th { background: var(--surface); }
.table-wrap { overflow-x: auto; }
label { display: block; font-weight: 700; margin: 0.5rem 0 0.25rem; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="url"], select {
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: var(--bg);
  color: var(--text);
}
input[readonly] { background: var(--surface); direction: ltr; text-align: left; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85rem; }
.inline-form { display: inline; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.notice { padding: 0.75rem 1rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.nav { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.5rem 0 1rem; }
.nav a { min-height: 44px; display: inline-flex; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .spinner { border-top-color: var(--primary); }
}
