/* Company retreat registration – Minrav visual language:
   logo blue, red, navy, light blue on white, with half and quarter circles. */
:root {
  --blue: #214CE3;
  --navy: #243F8C;
  --sky: #A2CFEE;
  --red: #E13333;

  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --tint: #EEF4FD;
  --ink: #16224A;
  --muted: #56648C;
  --line: #CFDBF2;
  --accent: var(--blue);
  --accent-ink: #FFFFFF;
  --ok: #1E7A4C;
  --ok-bg: #E3F4EA;
  --err: #C42121;
  --err-bg: #FDECEC;
  --notice-bg: #EAF3FC;
  --focus: #214CE3;
  --row-alt: #F6F9FE;

  --font: "Heebo", "Segoe UI", "Arial Hebrew", Arial, sans-serif;

  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C1430;
    --surface: #131E45;
    --tint: #1A2858;
    --ink: #EEF2FF;
    --muted: #A9B7DD;
    --line: #2A3B72;
    --accent: #4D74FF;
    --accent-ink: #FFFFFF;
    --ok: #6FD3A2;
    --ok-bg: #12382A;
    --err: #FF8A8A;
    --err-bg: #401A22;
    --notice-bg: #1A2858;
    --focus: #A2CFEE;
    --row-alt: #162250;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Brand shapes in the page corners, as on the teasers */
body::before, body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
}
body::before {
  top: -9vmin; left: -9vmin;
  width: 30vmin; height: 30vmin;
  border-radius: 50%;
  background: var(--red);
  opacity: 0.9;
}
body::after {
  bottom: -14vmin; right: -10vmin;
  width: 42vmin; height: 42vmin;
  border-radius: 50%;
  background: var(--sky);
  opacity: 0.55;
}

.shell {
  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(0.75rem, 3vw, 2rem) 1rem 2rem;
}
.shell.wide { max-width: 86rem; }

/* ---------- Hero ---------- */
.hero {
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(22, 34, 74, 0.45);
  margin-bottom: 1.25rem;
}
.hero-banner {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #fff;
}
@media (max-width: 34rem) {
  /* Keep the headline, logos and date readable on phones: crop the sides. */
  .hero-banner { aspect-ratio: 4 / 3; object-position: 50% 50%; }
}
.hero-info {
  padding: 1.25rem 1.5rem 1.5rem;
  text-align: center;
}
.hero-title {
  margin: 0;
  font-weight: 900;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  line-height: 1.15;
  color: var(--accent);
}
.hero-meta {
  display: inline-block;
  margin: 0.4rem 0 0;
  padding-bottom: 0.15rem;
  font-weight: 700;
  border-bottom: 4px solid var(--red);
}

/* Countdown: big brand numbers */
.countdown { margin-top: 1.1rem; }
.countdown-label { margin: 0 0 0.4rem; color: var(--muted); font-weight: 500; }
.countdown-units {
  display: inline-flex;
  direction: rtl;
  gap: clamp(0.4rem, 2vw, 0.9rem);
}
.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 4.2rem;
  padding: 0.5rem 0.4rem 0.35rem;
  border-radius: 14px;
  background: var(--tint);
}
.unit .num {
  font-weight: 900;
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  line-height: 1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.unit:first-child .num { color: var(--red); }
.unit .cap { font-size: 0.8125rem; color: var(--muted); font-weight: 500; }
@media (prefers-color-scheme: dark) { .unit .num { color: var(--ink); } }
.closed-banner {
  display: inline-block;
  margin: 1rem 0 0;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
}

/* ---------- Panels & form ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.5rem;
}
.panel:focus { outline: none; }

.section-title, h2 {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 0.3rem;
}
.lead { color: var(--muted); margin: 0 0 1.1rem; }

label, legend {
  display: block;
  font-weight: 700;
  margin: 1.1rem 0 0.35rem;
}
form > label:first-child { margin-top: 0; }
.optional { font-weight: 400; color: var(--muted); }
.hint { color: var(--muted); font-size: 0.9375rem; margin: 0.25rem 0 0.5rem; }

input[type="text"], input[type="tel"], input[type="email"], input[type="search"],
input[type="datetime-local"], input:not([type]), textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  min-height: 3rem;
}
input[type="tel"], input[type="email"] { text-align: right; }
input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { border-color: var(--focus); }

fieldset.choice { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.choice legend { margin-top: 0; }
.opt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  margin: 0.45rem 0 0;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  background: var(--surface);
}
.opt input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--accent); flex: none; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--tint); font-weight: 700; }
.opt:has(input:disabled) { cursor: default; opacity: 0.7; }

.block {
  margin-top: 1.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
}
.block fieldset + fieldset { margin-top: 1.4rem; }
#mode-set:not([hidden]) + #point-set { margin-top: 1.4rem; }
.block-title { margin: 0; font-size: 1.125rem; font-weight: 800; }
.pick { margin-top: 0.75rem; }

/* Autocomplete */
.combo { position: relative; }
.combo-list {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 4px);
  z-index: 5;
  list-style: none;
  margin: 0;
  padding: 0.25rem;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  max-height: 18rem;
  overflow-y: auto;
  box-shadow: 0 14px 30px -16px rgba(22, 34, 74, 0.5);
}
.combo-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
}
.combo-list li small { color: var(--muted); font-size: 0.875rem; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--tint); }
.combo-list li.none { cursor: default; color: var(--muted); background: none; }

.chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--accent);
  background: var(--tint);
  border-radius: 12px;
}
.chip-text { display: flex; flex-direction: column; line-height: 1.3; }
.chip-text small { color: var(--muted); }

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  margin-top: 1.5rem;
}
.btn {
  font: inherit;
  font-weight: 800;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: 0.7rem 1.6rem;
  min-height: 3rem;
  cursor: pointer;
}
form > .btn { margin-top: 1.25rem; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { min-height: 2.5rem; padding: 0.45rem 1rem; font-size: 0.9375rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.link {
  font: inherit;
  background: none;
  border: 0;
  padding: 0.25rem 0;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link.danger { color: var(--err); }
.link:disabled { opacity: 0.5; cursor: not-allowed; }

/* Messages */
.msg { margin: 1rem 0 0; padding: 0.75rem 1rem; border-radius: 10px; }
.msg.error { background: var(--err-bg); color: var(--err); font-weight: 700; }
.msg.ok { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.msg.notice { background: var(--notice-bg); color: var(--ink); }

/* Confirmation */
.summary {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.25rem;
  margin: 1.25rem 0 0;
}
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

/* Footer */
.foot { text-align: center; margin-top: 2rem; }
.foot-logo { width: 9rem; height: auto; }
@media (prefers-color-scheme: dark) {
  .foot-logo { background: #fff; border-radius: 12px; padding: 0.6rem 0.9rem; }
}
.contact { color: var(--muted); margin: 0.75rem 0 0; font-size: 0.9375rem; }

/* ---------- Admin ---------- */
.admin-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.admin-brand { display: flex; align-items: center; gap: 1rem; }
.admin-logo { width: 7.5rem; height: auto; }
@media (prefers-color-scheme: dark) { .admin-logo { background: #fff; border-radius: 10px; padding: 0.4rem 0.6rem; } }
.admin-title { margin: 0; font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 900; color: var(--accent); line-height: 1.15; }
.admin-meta { margin: 0.15rem 0 0; color: var(--muted); }
.admin-user { margin: 0; color: var(--muted); font-size: 0.9375rem; display: flex; align-items: center; gap: 0.75rem; }
.admin-user a { color: var(--accent); }

.tally {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.tally-item {
  font: inherit;
  text-align: start;
  color: var(--muted);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  cursor: pointer;
}
.tally-item .n { display: block; font-weight: 900; font-size: 2.2rem; line-height: 1.1; color: var(--navy); }
@media (prefers-color-scheme: dark) { .tally-item .n { color: var(--ink); } }
.tally-item.is-alert .n { color: var(--red); }
.tally-item.is-good .n { color: var(--ok); }
.tally-item[aria-pressed="true"] { border-color: var(--accent); background: var(--tint); color: var(--ink); }

.admin-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
}
.card h2, .card h3 { margin: 0 0 0.5rem; font-size: 1.125rem; font-weight: 800; }
.card .row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.card .row input { flex: 1 1 12rem; width: auto; }
.card label { margin-top: 0.5rem; }
.deadline-now { margin: 0 0 0.25rem; font-weight: 700; }
.exports { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mini { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.mini th, .mini td { text-align: start; padding: 0.35rem 0.25rem; border-bottom: 1px solid var(--line); }
.mini td.count { text-align: end; font-weight: 800; font-variant-numeric: tabular-nums; }
.mini tr.total td { font-weight: 800; border-bottom: 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.toolbar input[type="search"] { flex: 1 1 16rem; width: auto; }
.toolbar select { flex: 0 1 14rem; width: auto; }

.table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.grid { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.grid th, .grid td { text-align: start; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { position: sticky; top: 0; background: var(--surface); font-weight: 800; white-space: nowrap; }
.grid tbody tr:nth-child(even) { background: var(--row-alt); }
.grid td.ltr { direction: ltr; text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.grid td.wide { min-width: 8rem; }
.grid td.mid { min-width: 6rem; }
.grid th[scope="row"] { white-space: nowrap; }
.grid .sub.ltr { text-align: right; font-weight: 400; font-variant-numeric: tabular-nums; }
.grid .status + .sub { margin-top: 0.25rem; white-space: nowrap; }
.grid td.when { white-space: nowrap; color: var(--muted); }
.grid td.row-actions { white-space: nowrap; }
.grid td.row-actions .link { display: block; font-size: 0.875rem; text-align: start; }
.grid .empty { text-align: center; color: var(--muted); padding: 2rem; }
.grid .sub { display: block; color: var(--muted); font-size: 0.8125rem; }
.grid .slot { color: var(--muted); }
.grid.preview { font-size: 0.875rem; }
.grid.preview th { position: static; }

.status { display: inline-block; font-weight: 700; font-size: 0.8125rem; padding: 0.1rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.status.yes { background: var(--ok-bg); color: var(--ok); }
.status.no { background: var(--row-alt); color: var(--muted); border: 1px solid var(--line); }
.status.pending { background: var(--err-bg); color: var(--err); }
.flag { display: block; font-size: 0.8125rem; font-weight: 700; }
.flag.good { color: var(--ok); }
.flag.warn { color: var(--err); }

.manage { margin: 0 0 2rem; }
.list-title { margin: 0 0 0.75rem; font-size: 1.375rem; font-weight: 800; }
.manage-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1rem; margin-top: 0.75rem; }
.manage-block { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem; }
.manage-block h3 { margin: 0 0 0.5rem; font-size: 1.125rem; font-weight: 800; }
.manage-block input[type="file"] { font: inherit; font-size: 0.9375rem; max-width: 100%; }
#import-preview .table-wrap { margin: 0.5rem 0 0; }
.table-note { margin-top: 0.6rem; }
#picks-part { margin-top: 1.4rem; }
.grid .pick-line { display: block; }

/* Diagnostics page */
.checks { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.checks li { padding: 0.75rem 1rem; border-radius: 12px; border: 1.5px solid var(--line); display: grid; gap: 0.2rem; }
.checks li.pass { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.checks li.pass strong { color: var(--ok); }
.checks li.fail { border-color: var(--err); background: var(--err-bg); }
.checks li.fail strong { color: var(--err); }
.checks .detail { color: var(--muted); font-size: 0.9375rem; overflow-wrap: anywhere; }
.checks .fix { font-weight: 700; }

a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.gate { max-width: 34rem; margin: 2rem auto; }
.combo-list li.more { font-size: 0.875rem; }
