/* Hakhel — dignified, warm. Deep blue + warm gold. Mobile-first (375px). */

:root {
  --blue: #1f3a5f;
  --blue-dark: #162c49;
  --gold: #d4a945;
  --gold-soft: #f3e3bb;
  --cream: #faf6ee;
  --ink: #26282c;
  --muted: #6b7280;
  --card: #ffffff;
  --border: #e5e0d5;
  --error: #a33a2e;
  --ok: #2e6b46;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Georgia, "Times New Roman", "Noto Serif Hebrew", "SBL Hebrew", serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
}

h1, h2, h3 { line-height: 1.2; }

/* ---------- Welcome-back banner ---------- */
.welcome-back {
  background: linear-gradient(180deg, #fff7e4, #fdfbf5);
  border-bottom: 1px solid var(--gold);
}
.welcome-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.welcome-text { color: var(--blue-dark); font-size: 0.98rem; }
.welcome-text strong { color: var(--blue); }
.welcome-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.welcome-dismiss {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.welcome-dismiss:hover { color: var(--blue-dark); }
@media (max-width: 520px) {
  .welcome-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  /* base blue gradient + soft candlelight glow behind the title for depth */
  background:
    radial-gradient(ellipse 70% 55% at 50% 30%, rgba(212, 169, 69, 0.22), rgba(212, 169, 69, 0) 70%),
    linear-gradient(175deg, var(--blue-dark) 0%, var(--blue) 70%);
  color: #fff;
  text-align: center;
  padding: 56px 20px 40px;
}
/* Soft fade of the blue into the cream section below, so the edge
   isn't a hard line. Sits above the pattern, below the text. */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  background: linear-gradient(to bottom, rgba(31, 58, 95, 0), rgba(31, 58, 95, 0.35));
  z-index: 0;
  pointer-events: none;
}
/* Subtle Judaica lattice, tiled behind the hero content. Kept faint and
   masked to fade at the edges so text stays the focus. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("assets/hero-pattern.svg");
  background-repeat: repeat;
  background-size: 76px 76px;
  opacity: 0.12;
  -webkit-mask-image: radial-gradient(ellipse 85% 80% at 50% 45%, #000 55%, transparent 100%);
          mask-image: radial-gradient(ellipse 85% 80% at 50% 45%, #000 55%, transparent 100%);
  pointer-events: none;
}
/* Keep all hero content above the pattern layer. */
.hero > * { position: relative; z-index: 1; }
.hero-logo-badge {
  width: 150px;
  height: 150px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}
.hero-logo {
  height: 104px;
  width: auto;
  display: block;
}
.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--gold-soft);
  margin-bottom: 10px;
}
.hero-title {
  font-size: 3.2rem;
  color: var(--gold);
  font-weight: normal;
}
.hero-tagline {
  font-size: 1rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-top: 8px;
}
.hero-subtitle { font-size: 1.15rem; margin-top: 6px; color: #e8ecf3; }
.hero-memorial { margin-top: 22px; font-size: 0.95rem; color: #cfd8e6; }
.memorial-he { font-size: 1.05rem; display: inline-block; margin-top: 4px; }
.hero-cta { margin-top: 28px; display: inline-block; }

/* Hakhel wordmark logo, seated on a warm plate so the navy lettering
   stays legible on the dark hero. Sits under the kicker. */
.hero-wordmark {
  display: inline-block;
  margin: 8px auto 2px;
  border-radius: 20px;
  overflow: hidden;
  background: #faeee2;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  line-height: 0;
}
.hero-wordmark-img {
  display: block;
  width: 200px;
  max-width: 66vw;
  height: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 6px;
  padding: 13px 26px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn-gold { background: var(--gold); color: var(--blue-dark); font-weight: bold; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-small { padding: 8px 16px; font-size: 0.9rem; background: var(--blue); color: #fff; }

/* ---------- Flame gauge ---------- */
.gauge-section {
  max-width: 720px;
  margin: 34px auto 0;
  padding: 0 16px;
}
.flame-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(31, 58, 95, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 32px 22px 28px;
}
.flame-svg { width: 150px; min-width: 150px; height: 196px; }
.flame-outline {
  fill: #f0ead9;
  stroke: var(--gold);
  stroke-width: 2.5;
}
.flame-fill {
  fill: var(--gold);
  transition: y 1.2s ease, height 1.2s ease;
}
/* Living flame: a gentle candle sway + a soft pulsing glow. */
.flame-svg {
  transform-origin: 50% 92%;
  animation: flame-sway 3.8s ease-in-out infinite, flame-glow 2.6s ease-in-out infinite;
}
@keyframes flame-sway {
  0%, 100% { transform: scale(1, 1) rotate(0deg); }
  25%      { transform: scale(1.015, 0.99) rotate(-0.7deg); }
  50%      { transform: scale(0.99, 1.02) rotate(0.5deg); }
  75%      { transform: scale(1.01, 1) rotate(-0.35deg); }
}
@keyframes flame-glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(212, 169, 69, 0.40)); }
  50%      { filter: drop-shadow(0 0 17px rgba(232, 184, 96, 0.75)); }
}
@media (prefers-reduced-motion: reduce) {
  .flame-svg { animation: none; }
}
.flame-share { margin-top: 22px; align-self: center; }
.gauge-numbers { display: flex; flex-direction: column; align-items: center; }
.gauge-pct { font-size: 3.6rem; color: var(--blue); font-weight: bold; line-height: 1; }
.gauge-label { color: var(--muted); font-size: 1.02rem; margin-top: 2px; }
.gauge-sub { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

.activity-strip {
  margin-top: 10px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  min-height: 1.3em;
}

/* ---------- Collective milestone ---------- */
.milestone {
  width: 100%;
  margin: 20px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.milestone-headline { line-height: 1.1; }
.milestone-count {
  font-size: 2.4rem; font-weight: bold; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.milestone-goal { font-size: 1.3rem; color: var(--muted); }
.milestone-caption { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
/* Compact contribution-style matrix: tiny squares that scale to any count. */
.milestone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 15px);
  justify-content: center;
  gap: 5px;
  margin: 18px auto 8px;
  max-width: 460px;
}
.mile-tile {
  position: relative;
  width: 15px;
  height: 15px;
  border-radius: 3px;
  background: #ece7d9;
  border: 1px solid rgba(31, 58, 95, 0.16); /* subtle dark outline when empty */
  cursor: default;
  transition: background-color 0.9s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.3s ease;
}
.mile-tile.is-done {
  border-color: var(--gold);
  box-shadow: 0 0 6px rgba(212, 169, 69, 0.75);
}
.milestone-more { color: var(--muted); font-size: 0.82rem; margin-top: 6px; }

/* Hover / focus tooltip previewing the commitment. */
.mile-tile::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translate(-50%, 4px);
  width: max-content;
  max-width: 210px;
  background: var(--blue-dark);
  color: #fdf6e6;
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: center;
  padding: 6px 10px;
  border-radius: 7px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 30;
}
.mile-tile::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--blue-dark);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 30;
}
.mile-tile:hover::after,
.mile-tile:focus::after { opacity: 1; transform: translate(-50%, 0); }
.mile-tile:hover::before,
.mile-tile:focus::before { opacity: 1; }
.milestone-empty { color: var(--muted); font-size: 0.9rem; }
.milestone-legend { color: var(--muted); font-size: 0.82rem; font-style: italic; margin-top: 4px; }
@media (prefers-reduced-motion: reduce) {
  .mile-tile { transition: none; }
}

/* ---------- Sections ---------- */
.card-section {
  max-width: 720px;
  margin: 34px auto;
  padding: 30px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.card-section.alt { background: #fdfbf5; }

/* Featured card — the #1 conversion goal (Join) stands out. */
.card-featured {
  border: 2px solid var(--gold);
  background: linear-gradient(180deg, #fffdf6 0%, #ffffff 55%);
  box-shadow: 0 8px 26px rgba(212, 169, 69, 0.16);
}
.card-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: bold;
  color: var(--gold);
  margin-bottom: 6px;
}

/* Accessible-only heading (kept for screen readers / anchors) */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Update: collapsible drawer so returning users don't clutter the main flow. */
.update-drawer { padding: 0; overflow: hidden; }
.drawer-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fdfbf5;
  border: none;
  padding: 16px 22px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--blue);
  cursor: pointer;
  text-align: left;
}
.drawer-toggle:hover { background: #f6efe0; }
.drawer-toggle strong { color: var(--blue-dark); }
.drawer-caret { color: var(--gold); font-size: 0.85rem; transition: transform 0.2s ease; }
.drawer-toggle[aria-expanded="true"] .drawer-caret { transform: rotate(180deg); }
.drawer-body { padding: 6px 22px 26px; }
.card-section h2 {
  color: var(--blue);
  font-size: 1.5rem;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
  padding-bottom: 4px;
}
.section-intro { color: var(--muted); margin: 10px 0 20px; font-size: 0.97rem; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { font-weight: bold; font-size: 0.93rem; margin-top: 12px; }
.hint { font-weight: normal; color: var(--muted); font-size: 0.85rem; }
.form input, .form select {
  padding: 11px 12px;
  border: 1px solid #c9c2b2;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}
.form input:focus, .form select:focus {
  outline: 2px solid var(--gold);
  border-color: var(--gold);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row > div { display: flex; flex-direction: column; gap: 6px; }
.checkbox-label {
  display: flex; align-items: center; gap: 10px;
  font-weight: normal !important; margin-top: 14px !important;
}
.checkbox-label input { width: 18px; height: 18px; }
.form .btn { margin-top: 20px; align-self: flex-start; }
.form-error { color: var(--error); font-size: 0.92rem; min-height: 1.2em; margin-top: 6px; }
.form-success { color: var(--ok); font-size: 0.95rem; margin-top: 6px; }
.code-input { text-transform: uppercase; letter-spacing: 0.12em; }
.current-progress { font-size: 1.05rem; color: var(--blue); margin-bottom: 8px; }

/* ---------- Progress stepper (slider + quick-add chips) ---------- */
.stepper-label { }
.stepper { margin: 6px 0 4px; }
.stepper-readout {
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--blue-dark);
  margin-bottom: 10px;
  min-height: 1.4em;
}
.stepper-readout.pulse { animation: readout-pulse 0.4s ease; }
@keyframes readout-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.12); color: var(--gold); }
  100% { transform: scale(1); }
}
.stepper-bar {
  height: 12px;
  background: #eee7d6;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 14px;
}
.stepper-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), #e6c169);
  border-radius: 20px;
  transition: width 0.25s ease;
}
.stepper-slider {
  width: 100%;
  margin: 0 0 14px;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 20px;
  background: #eaddb0;
  outline: none;
}
.stepper-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.stepper-slider::-moz-range-thumb {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.stepper-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stepper-controls #up-new { width: 100px; }
.chips { display: flex; gap: 8px; }
.chip {
  border: 1px solid var(--gold);
  background: var(--gold-soft);
  color: var(--blue-dark);
  font-family: inherit;
  font-weight: bold;
  font-size: 0.95rem;
  border-radius: 20px;
  padding: 8px 16px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
.chip:hover { background: #f0dfb0; }
.chip:active { transform: scale(0.92); background: var(--gold); }
@media (prefers-reduced-motion: reduce) {
  .stepper-readout.pulse { animation: none; }
  .stepper-bar-fill { transition: none; }
}

/* ---------- Sign-up wizard (2 steps) ---------- */
.wizard-progress { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wizard-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--border); transition: background 0.25s ease;
}
.wizard-dot.is-active { background: var(--gold); }
.wizard-bar { width: 44px; height: 2px; background: var(--border); transition: background 0.25s ease; }
.wizard-bar.is-active { background: var(--gold); }
.wizard-steplabel {
  font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 6px;
}
.wizard-step { display: flex; flex-direction: column; gap: 6px; }
.wizard-step[hidden] { display: none; }  /* ensure a hidden step is truly hidden */
#wizard-next { align-self: stretch; min-width: 0; text-align: center; }
.wizard-actions { display: flex; gap: 12px; margin-top: 20px; }
.wizard-actions .btn { flex: 1; margin-top: 0; align-self: auto; min-width: 0; text-align: center; }
.btn-ghost { background: transparent; border: 1px solid #c9c2b2; color: var(--blue); }
.btn-ghost:hover { filter: none; background: #f3efe6; }

/* ---------- Change password ---------- */
.change-pw { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.change-pw-toggle {
  background: none;
  border: none;
  color: var(--blue);
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.change-pw-toggle:hover { color: var(--gold); }
#change-pw-form { margin-top: 6px; }

/* ---------- Share My Progress prompt ---------- */
.share-update {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: 8px;
  text-align: center;
}
.share-update-text { color: var(--blue-dark); font-size: 0.9rem; margin-bottom: 10px; }
.share-update .btn { margin-top: 0; align-self: center; }

/* ---------- Success panel ---------- */
.success-panel {
  margin-top: 24px;
  border-top: 2px solid var(--gold);
  padding-top: 20px;
}
.success-panel h3 { color: var(--blue); margin-bottom: 8px; }
.code-box {
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 14px;
}
.code-box-label { font-size: 0.9rem; margin-bottom: 8px; }
.code-value {
  font-size: 1.9rem;
  letter-spacing: 0.25em;
  font-weight: bold;
  color: var(--blue-dark);
  margin-bottom: 10px;
  font-family: "Courier New", monospace;
}
.ref-link {
  font-size: 0.9rem;
  word-break: break-all;
  color: var(--blue);
  margin-bottom: 10px;
  font-family: "Courier New", monospace;
}

/* ---------- Wall ---------- */
.wall-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.wall-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.wall-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(31, 58, 95, 0.13);
  border-color: var(--gold);
}
/* Circular progress ring */
.wall-ring { position: relative; width: 52px; min-width: 52px; height: 52px; }
.wall-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: #eee7d6; stroke-width: 4; }
.ring-value {
  fill: none;
  stroke: var(--gold);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--pct, 0));
  transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.ring-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: bold;
  color: var(--blue);
}
.wall-body { flex: 1; min-width: 0; }
.wall-name { font-weight: bold; color: var(--blue-dark); }
.wall-pct { color: var(--muted); font-size: 0.85rem; }
.wall-sefer { color: var(--ink); font-size: 0.95rem; margin: 2px 0 4px; }
.chavruta-badge {
  display: inline-block;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  color: var(--blue-dark);
  border-radius: 20px;
  font-size: 0.72rem;
  padding: 2px 10px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ---------- Recruiting Race: personal link + sharing ---------- */
.race-share { margin: 4px 0 20px; }
.race-share-label { font-size: 0.9rem; color: var(--muted); margin-bottom: 8px; }
.race-link-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--blue-dark);
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.race-share-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btn { flex: 1; min-width: 150px; text-align: center; }
.race-share-prompt { color: var(--muted); font-size: 0.92rem; margin: 4px 0 16px; }
.race-share-prompt a { color: var(--blue); font-weight: bold; }

/* ---------- Celebration: gold embers + card glow on a progress update ---------- */
.ember-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.ember {
  position: fixed;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #ffe9a8, var(--gold) 70%, #c79a35);
  box-shadow: 0 0 8px rgba(212, 169, 69, 0.85);
  opacity: 0;
  will-change: transform, opacity;
}
@keyframes ember-rise {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.6); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
}
.wall-card.celebrate { animation: card-glow 1.6s ease-out; }
@keyframes card-glow {
  0%   { box-shadow: 0 0 0 rgba(212, 169, 69, 0); border-color: var(--gold); }
  25%  { box-shadow: 0 0 22px 4px rgba(212, 169, 69, 0.65); border-color: var(--gold); }
  100% { box-shadow: 0 0 0 rgba(212, 169, 69, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .ember { display: none; }
  .wall-card.celebrate { animation: none; }
}

/* ---------- Leaderboard ---------- */
.leaderboard { list-style: none; counter-reset: rank; }
.leaderboard li {
  counter-increment: rank;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
}
.leaderboard li::before {
  content: counter(rank);
  background: var(--blue);
  color: var(--gold);
  font-weight: bold;
  width: 30px; height: 30px;
  min-width: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}
.leaderboard li:first-child::before { background: var(--gold); color: var(--blue-dark); }
.lb-name { flex: 1; font-weight: bold; }
.lb-count { color: var(--muted); font-size: 0.9rem; }

/* ---------- Ambassador recruiting goals ---------- */
.ambassador-fields { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }

.recruit-box { margin-top: 22px; border-top: 2px solid var(--gold); padding-top: 18px; }
.recruit-box-title { color: var(--blue); font-size: 1.05rem; margin-bottom: 6px; }
.recruit-status { color: var(--ink); font-size: 0.95rem; margin-bottom: 10px; }
.recruit-status strong { color: var(--blue); }
.recruit-track { background: #eee7d6; border-radius: 20px; height: 12px; overflow: hidden; margin-bottom: 14px; }
.recruit-bar { background: linear-gradient(90deg, var(--gold), #e6c169); height: 100%; border-radius: 20px; width: 0; transition: width 0.8s ease; }
.recruit-box.reached .recruit-bar { background: linear-gradient(90deg, var(--ok), #3f8f5e); }

/* Leaderboard rows: ambassadors carry a goal progress bar */
.lb-main { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lb-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lb-track { background: #eee7d6; border-radius: 20px; height: 8px; overflow: hidden; }
.lb-bar { background: linear-gradient(90deg, var(--gold), #e6c169); height: 100%; border-radius: 20px; transition: width 0.8s ease; }
.leaderboard li.lb-reached .lb-bar { background: linear-gradient(90deg, var(--ok), #3f8f5e); }
.leaderboard li.lb-reached .lb-count { color: var(--ok); font-weight: bold; }

/* ---------- Empty states / footer ---------- */
.empty-state { color: var(--muted); font-style: italic; text-align: center; padding: 18px 0; }

.footer {
  background: var(--blue-dark);
  color: #cfd8e6;
  text-align: center;
  padding: 38px 20px;
  margin-top: 44px;
}
.footer-line { font-size: 1rem; }
.footer-line[lang="he"] { font-size: 1.1rem; color: var(--gold-soft); margin-bottom: 6px; }
.footer-powered { margin-top: 18px; font-size: 0.8rem; color: #8fa0b8; }
.footer-powered strong { color: var(--gold); }
.footer-demo {
  margin-top: 14px;
  font-size: 0.78rem;
  color: #8fa0b8;
  border: 1px dashed #3d5578;
  border-radius: 6px;
  display: inline-block;
  padding: 6px 12px;
}

/* ---------- Desktop ---------- */
@media (min-width: 700px) {
  .hero { padding: 80px 20px 48px; }
  .hero-title { font-size: 4.2rem; }
  .hero-wordmark-img { width: 250px; }
  .wall-grid { grid-template-columns: 1fr 1fr; }
  .form .btn { align-self: center; min-width: 260px; }
  /* Flame is the centerpiece — go bigger on larger screens. */
  .flame-svg { width: 190px; min-width: 190px; height: 248px; }
  .gauge-pct { font-size: 4.4rem; }
  .gauge-label { font-size: 1.1rem; }
}

/* ---------- Sticky top nav ---------- */
html { scroll-behavior: smooth; }

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--blue-dark);
  border-bottom: 1px solid rgba(212, 169, 69, 0.35); /* soft gold hairline */
  transition: padding 0.25s ease, box-shadow 0.25s ease;
}
.topnav-brand {
  color: var(--gold);
  font-size: 1.3rem;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: font-size 0.25s ease;
}
.topnav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 16px;
}
.topnav-links a {
  color: #fdf6e6; /* warm near-white — stronger contrast on the navy bar */
  text-decoration: none;
  font-size: 0.9rem;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.topnav-links a:hover,
.topnav-links a:focus { color: #fff; border-bottom-color: var(--gold); }
.topnav-right { display: flex; align-items: center; gap: 16px; }
.topnav-cta {
  padding: 8px 18px;
  font-size: 0.9rem;
  border-radius: 6px;
  white-space: nowrap;
  transition: padding 0.25s ease, font-size 0.25s ease, filter 0.15s ease;
}
.topnav.is-scrolled .topnav-cta { padding: 6px 14px; font-size: 0.85rem; }

/* Condensed state, toggled by app.js once the page is scrolled. */
.topnav.is-scrolled {
  padding: 7px 18px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.28);
}
.topnav.is-scrolled .topnav-brand { font-size: 1.05rem; }
.topnav.is-scrolled .topnav-links a { font-size: 0.85rem; }

/* Keep section headings clear of the pinned bar when jumped to. */
.card-section { scroll-margin-top: 72px; }

/* Very small phones: tighten so all four links fit at ~375px. */
@media (max-width: 400px) {
  .topnav { padding: 12px; gap: 8px; }
  .topnav-brand { font-size: 1.15rem; }
  .topnav-right { gap: 9px; }
  .topnav-links { gap: 10px; }
  .topnav-links a { font-size: 0.82rem; }
  .topnav-cta { padding: 6px 11px; font-size: 0.82rem; }
}

/* Desktop: a bit more room in the bar. */
@media (min-width: 700px) {
  .topnav { padding: 22px 44px; }
  .topnav.is-scrolled { padding: 12px 44px; }
  .topnav-brand { font-size: 1.5rem; }
  .topnav-right { gap: 26px; }
  .topnav-links { gap: 30px; }
  .topnav-links a { font-size: 1.08rem; }
  .topnav-cta { padding: 10px 22px; font-size: 1rem; }
  .card-section { scroll-margin-top: 92px; }
}


/* ---------- Brand logo in top nav (cream bar, full-color logo) ---------- */
.topnav {
  background: var(--cream);
  border-bottom: 1px solid rgba(212, 169, 69, 0.55);
}
.topnav-links a { color: var(--blue); }
.topnav-links a:hover,
.topnav-links a:focus { color: var(--blue-dark); border-bottom-color: var(--gold); }
.topnav-brand { display: flex; align-items: center; line-height: 0; }
.topnav-logo { height: 40px; width: auto; display: block; }
.topnav.is-scrolled .topnav-logo { height: 34px; }
@media (max-width: 400px) { .topnav-logo { height: 34px; } }
@media (min-width: 700px) {
  .topnav-logo { height: 50px; }
  .topnav.is-scrolled .topnav-logo { height: 42px; }
}

/* Hero: the wordmark now lives in the nav logo, so the subtitle carries the H1 */
.hero-h1 { font-weight: normal; }

/* ---------- Participation goal (learners toward 1,000) ---------- */
.learners-goal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(31, 58, 95, 0.12);
  padding: 16px 22px;
  margin-top: 12px;
}
.learners-goal-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.learners-goal-count { color: var(--blue); font-weight: bold; font-size: 1.05rem; }
.learners-goal-pct { color: var(--gold); font-weight: bold; font-size: 1.05rem; }
.learners-track {
  background: #eee7d6;
  border-radius: 20px;
  height: 14px;
  overflow: hidden;
}
.learners-bar {
  background: linear-gradient(90deg, var(--blue), #3a6ea5);
  height: 100%;
  border-radius: 20px;
  transition: width 1s ease;
}
.learners-goal-caption {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 8px;
  text-align: center;
}

/* ---------- Sefer selector (searchable catalog + amount) ---------- */
.combo { position: relative; }
.combo-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 26px rgba(31, 58, 95, 0.18); max-height: 320px; overflow-y: auto;
}
.combo-group {
  padding: 8px 12px 4px; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--gold); font-weight: bold;
  background: #fdfbf5; position: sticky; top: 0;
}
.combo-item {
  padding: 9px 12px; cursor: pointer; display: flex;
  justify-content: space-between; align-items: baseline; gap: 10px; font-size: 0.98rem;
}
.combo-item:hover, .combo-item.active { background: var(--gold-soft); }
.combo-size { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.combo-other {
  padding: 11px 12px; cursor: pointer; font-size: 0.95rem; color: var(--blue);
  border-top: 1px solid var(--border); background: #fdfbf5;
}
.combo-other:hover { background: var(--gold-soft); }
.combo-empty { padding: 12px; color: var(--muted); font-style: italic; font-size: 0.92rem; }
.chosen {
  margin-top: 10px; background: var(--gold-soft); border: 1px solid var(--gold);
  border-radius: 8px; padding: 12px 14px;
}
.chosen-name { font-weight: bold; color: var(--blue-dark); }
.chosen-meta { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.chosen-change {
  background: none; border: none; color: var(--blue); font-family: inherit;
  font-size: 0.85rem; text-decoration: underline; cursor: pointer; padding: 0; margin-top: 6px;
}
.amount { margin-top: 18px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.seg button {
  flex: 1; min-width: 96px; padding: 10px 8px; border: 1px solid #c9c2b2;
  border-radius: 8px; background: #fff; font-family: inherit; font-size: 0.92rem;
  cursor: pointer; color: var(--ink);
}
.seg button.active { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: bold; }
.amount-body { margin-top: 12px; }
.pct-chips { display: flex; gap: 8px; margin: 4px 0 12px; flex-wrap: wrap; }
.pct-chips button {
  padding: 7px 14px; border: 1px solid var(--gold); border-radius: 20px; background: #fff;
  font-family: inherit; font-size: 0.9rem; cursor: pointer; color: var(--blue-dark);
}
.pct-chips button.active { background: var(--gold); font-weight: bold; }
.pct-readout { text-align: center; font-size: 1.05rem; color: var(--blue); margin: 8px 0 2px; }
.pct-readout b { font-size: 1.3rem; }
.amount-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.amount-row2 > div { display: flex; flex-direction: column; gap: 6px; }
.commit-helper { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
.commit-summary {
  margin-top: 16px; background: #fdfbf5; border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; font-size: 1.02rem; color: var(--blue-dark);
}
.commit-summary b { color: var(--blue); }

/* ---------- Commit-type toggle (sefer vs learning time) ---------- */
.commit-type { margin-bottom: 16px; }
.commit-type button { min-width: 130px; }
/* Mirror .wizard-step so the time fields stack full-width like the name/password step */
#time-mode { display: flex; flex-direction: column; gap: 6px; }
