/* בר מצווה עילאי — כחול עמוק, תכלת ולבן
   מערכת: כותרות Frank Ruhl Libre (קלאסי), גוף Heebo */
:root {
  --night: #051a42;
  --navy: #0a2c6b;
  --blue: #1f66d6;
  --sky: #9fd0ff;
  --mist: #d6eaff;
  --ice: #eef6ff;
  --white: #ffffff;
  --ink: #0a2250;
  --muted: #5f78a3;
  --ok: #17895a;
  --no: #b8465b;

  --serif: "Frank Ruhl Libre", "David Libre", Georgia, serif;
  --sans: "Heebo", "Assistant", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--night);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ================= HERO ================= */
.hero {
  position: relative;
  overflow: hidden;
  padding: max(28px, env(safe-area-inset-top)) 22px 118px;
  text-align: center;
  color: var(--white);
  background:
    radial-gradient(520px 340px at 50% 30%, rgba(80, 150, 255, .38), rgba(80, 150, 255, 0) 70%),
    linear-gradient(180deg, var(--night) 0%, #0a2f78 58%, #2a76e0 100%);
}

.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 9% 14%, #fff 99%, transparent),
    radial-gradient(1.2px 1.2px at 21% 41%, var(--sky) 99%, transparent),
    radial-gradient(2px 2px at 88% 12%, #fff 99%, transparent),
    radial-gradient(1.4px 1.4px at 76% 36%, var(--sky) 99%, transparent),
    radial-gradient(1.6px 1.6px at 94% 58%, #fff 99%, transparent),
    radial-gradient(1.2px 1.2px at 6% 66%, #fff 99%, transparent),
    radial-gradient(2px 2px at 64% 8%, var(--sky) 99%, transparent),
    radial-gradient(1.2px 1.2px at 36% 22%, #fff 99%, transparent),
    radial-gradient(1.4px 1.4px at 14% 84%, var(--sky) 99%, transparent),
    radial-gradient(1.6px 1.6px at 84% 80%, #fff 99%, transparent);
  animation: twinkle 5s ease-in-out infinite alternate;
}

@keyframes twinkle { from { opacity: .45; } to { opacity: 1; } }

.eyebrow {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 8px auto 26px;
  max-width: 280px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .42em;
  padding-inline-start: .42em;
  color: var(--sky);
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(159, 208, 255, .7));
}

.eyebrow::after { transform: scaleX(-1); }

.arch {
  position: relative;
  width: min(290px, 100%);
  margin: 0 auto;
  padding: 38px 18px 40px;
  border-radius: 999px 999px 28px 28px;
  border: 1.5px solid rgba(159, 208, 255, .55);
  background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .03));
  box-shadow: inset 0 0 40px rgba(159, 208, 255, .12), 0 30px 60px rgba(2, 12, 36, .35);
}

.arch::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 999px 999px 20px 20px;
  border: 1px solid rgba(159, 208, 255, .22);
  pointer-events: none;
}

.star {
  display: block;
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  filter: drop-shadow(0 0 14px rgba(159, 208, 255, .65));
}

.kind {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 30px;
  letter-spacing: .14em;
  padding-inline-start: .14em;
  color: var(--mist);
}

.bigname {
  margin: -4px 0 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(88px, 27vw, 112px);
  line-height: 1.02;
  letter-spacing: -.01em;
  color: var(--white);
  text-shadow: 0 6px 30px rgba(120, 180, 255, .45);
}

.hero-sub {
  position: relative;
  margin: 22px 0 0;
  font-size: 14px;
  color: rgba(214, 234, 255, .85);
}

/* ================= SHEET ================= */
body { display: flex; flex-direction: column; }

.sheet {
  position: relative;
  flex: 1;
  margin-top: -64px;
  border-radius: 40px 40px 0 0;
  background: var(--white);
  box-shadow: 0 -20px 50px rgba(5, 26, 66, .28);
}

.sheet-inner {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 44px 22px max(60px, calc(30px + env(safe-area-inset-bottom)));
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 22px;
  color: var(--sky);
}

.ornament::before,
.ornament::after {
  content: "";
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sky));
}

.ornament::after { transform: scaleX(-1); }
.ornament svg { width: 14px; height: 14px; }

.lead {
  margin: 0 auto 34px;
  max-width: 24em;
  text-align: center;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(22px, 6.2vw, 26px);
  line-height: 1.55;
  color: var(--navy);
}

.lead span { display: block; }
.lead span:nth-child(2) { color: var(--blue); }

/* date + place */
.ticket {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  gap: 0 8px;
  margin: 0 0 18px;
  padding: 22px 12px;
  border-radius: 26px;
  background: linear-gradient(180deg, var(--ice), var(--white));
  border: 1px solid var(--mist);
  text-align: center;
}

.ticket .rule {
  align-self: stretch;
  background: repeating-linear-gradient(180deg, var(--sky) 0 5px, transparent 5px 10px);
}

.ticket .cap {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .22em;
  padding-inline-start: .22em;
  color: var(--blue);
}

.ticket .big {
  display: block;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(30px, 8.6vw, 38px);
  line-height: 1.1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

.ticket .mid {
  display: block;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(22px, 6vw, 26px);
  line-height: 1.2;
  color: var(--navy);
}

.ticket .small {
  display: block;
  margin-top: 4px;
  font-size: 14.5px;
  color: var(--muted);
}

.parking {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--navy);
  color: var(--white);
  font-size: 15.5px;
  font-weight: 500;
  text-align: right;
}

.parking svg { flex: none; width: 24px; height: 24px; color: var(--sky); }

/* ================= RSVP ================= */
.rsvp {
  margin-top: 40px;
  scroll-margin-top: 20px;
}

.rsvp-head { text-align: center; margin-bottom: 20px; }

.rsvp-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 34px;
  color: var(--navy);
}

.rsvp-head p { margin: 4px 0 0; color: var(--muted); font-size: 15.5px; }

.panel {
  padding: 22px 18px 20px;
  border-radius: 30px;
  background: var(--ice);
  border: 1px solid var(--mist);
}

.field { margin-bottom: 18px; }

.field > label,
.field > .lbl {
  display: block;
  margin: 0 4px 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}

.input {
  width: 100%;
  padding: 15px 16px;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--mist);
  border-radius: 16px;
  outline: none;
  box-shadow: 0 2px 8px rgba(10, 44, 107, .05);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.input::placeholder { color: #9db3d4; }

.input:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(31, 102, 214, .16);
}

.input.bad { border-color: var(--no); box-shadow: 0 0 0 4px rgba(184, 70, 91, .12); }

.seg {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 5px;
  border-radius: 18px;
  background: var(--white);
  border: 1.5px solid var(--mist);
}

.seg input { position: absolute; opacity: 0; pointer-events: none; }

.seg label {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 12px 8px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 13px;
  cursor: pointer;
  transition: color .2s ease;
}

.seg .thumb {
  position: absolute;
  inset: 5px;
  width: calc(50% - 5px);
  border-radius: 13px;
  background: var(--navy);
  box-shadow: 0 6px 16px rgba(10, 44, 107, .3);
  transition: transform .32s var(--ease-out);
}

#att-yes:checked ~ .thumb { transform: translateX(0); }
#att-no:checked ~ .thumb { transform: translateX(-100%); }
#att-yes:checked ~ label[for="att-yes"],
#att-no:checked ~ label[for="att-no"] { color: var(--white); }
.seg input:focus-visible ~ .thumb { outline: 3px solid var(--sky); outline-offset: 2px; }

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  border-radius: 20px;
  background: var(--white);
  border: 1.5px solid var(--mist);
}

.stepper button {
  flex: none;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--blue);
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(31, 102, 214, .32);
  transition: transform .16s var(--ease-out), background .2s ease;
}

.stepper button svg { width: 22px; height: 22px; }
.stepper button:active { transform: scale(.94); }
.stepper button:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.stepper button:disabled { background: var(--mist); box-shadow: none; cursor: default; }

.stepper .num { text-align: center; line-height: 1.1; }

.stepper output {
  display: block;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 40px;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.stepper output.pop { animation: pop .22s var(--ease-out); }
@keyframes pop { from { transform: scale(.82); opacity: .5; } to { transform: scale(1); opacity: 1; } }

.stepper small { font-size: 13px; color: var(--muted); }

.send {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
  padding: 18px;
  font: inherit;
  font-size: 19px;
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(180deg, #1c4fb3, var(--navy));
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(10, 44, 107, .34);
  transition: transform .16s var(--ease-out), opacity .2s ease;
}

.send svg { width: 20px; height: 20px; color: var(--sky); }
.send:active { transform: scale(.97); }
.send:disabled { opacity: .65; cursor: default; }
.send:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }

.msg { min-height: 1.5em; margin: 12px 0 0; font-size: 15px; text-align: center; color: var(--muted); }
.msg.err { color: var(--no); font-weight: 500; }

.thanks {
  padding: 34px 18px 30px;
  text-align: center;
  border-radius: 30px;
  background: var(--ice);
  border: 1px solid var(--mist);
  animation: rise .5s var(--ease-out) both;
}

.thanks .check {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--navy);
  display: grid;
  place-items: center;
  box-shadow: 0 14px 30px rgba(10, 44, 107, .3);
}

.thanks .check path {
  stroke: var(--sky);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: draw .5s .2s var(--ease-out) forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }

.thanks h2 { margin: 0; font-family: var(--serif); font-weight: 900; font-size: 34px; color: var(--navy); }
.thanks p { margin: 6px 0 0; font-size: 18px; color: var(--ink); }

/* floating call-to-action */
.fab {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(5, 26, 66, .35);
  transform: translate(-50%, 0);
  transition: transform .35s var(--ease-out), opacity .25s ease;
}

.fab.away { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
.fab:active { transform: translate(-50%, 0) scale(.96); }
.fab svg { width: 18px; height: 18px; color: var(--blue); }

/* ================= entrance ================= */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.in { animation: rise .7s var(--ease-out) both; }
.in.d1 { animation-delay: .08s; }
.in.d2 { animation-delay: .18s; }
.in.d3 { animation-delay: .3s; }
.in.d4 { animation-delay: .42s; }

/* ================= PARENTS ================= */
.dash-hero {
  position: relative;
  overflow: hidden;
  padding: max(26px, env(safe-area-inset-top)) 22px 96px;
  text-align: center;
  color: var(--white);
  background:
    radial-gradient(480px 300px at 50% 0%, rgba(80, 150, 255, .38), rgba(80, 150, 255, 0) 70%),
    linear-gradient(180deg, var(--night), #0a2f78 70%, #2a76e0);
}

.dash-hero .eyebrow { margin-bottom: 14px; }

.dash-hero h1 {
  position: relative;
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 44px;
  line-height: 1.1;
}

.dash-hero p { position: relative; margin: 6px 0 0; color: var(--mist); font-size: 15px; }

.dash { margin-top: -62px; }
.dash .sheet-inner { padding-top: 22px; }

.totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 22px;
}

.stat {
  padding: 16px 6px 14px;
  text-align: center;
  border-radius: 22px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 12px 26px rgba(10, 44, 107, .22);
}

.stat:nth-child(2) { background: var(--blue); }
.stat:nth-child(3) { background: var(--sky); color: var(--navy); box-shadow: 0 12px 26px rgba(120, 170, 235, .35); }

.stat b {
  display: block;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 42px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.stat span { font-size: 13.5px; font-weight: 500; }

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 16px;
  padding: 5px;
  border-radius: 18px;
  background: var(--ice);
  border: 1px solid var(--mist);
}

.tabs button {
  padding: 11px 6px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.tabs button[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.tabs button:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--mist);
  box-shadow: 0 6px 18px rgba(10, 44, 107, .06);
}

.row .who { font-size: 18px; font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.row .tel { color: var(--muted); direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.row .tel a { color: inherit; text-decoration: none; }

.row .count {
  grid-row: 1 / span 2;
  grid-column: 2;
  min-width: 68px;
  padding: 8px 10px;
  text-align: center;
  border-radius: 16px;
  background: var(--ice);
  color: var(--blue);
  font-weight: 600;
  line-height: 1.2;
}

.row .count b { display: block; font-family: var(--serif); font-weight: 900; font-size: 28px; }
.row .count small { font-size: 12.5px; }
.row.no .count { background: #fbebef; color: var(--no); }

.empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--muted);
  border: 1.5px dashed var(--sky);
  border-radius: 20px;
}

.updated { margin: 20px 0 0; text-align: center; font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
