/* ============================================================
   Gallipoli Funeral Fund - one-question-at-a-time application
   (apply2.html). Reuses tokens and components from styles.css.
   ============================================================ */

.join-page { background: var(--cream); }
.join-shell { max-width: 640px; margin: 0 auto; padding: 0 1.25rem 3rem; display: flex; flex-direction: column; }
/* On phones the action sits at the bottom of the screen (thumb reach); on larger
   screens it follows the content so a tall window does not leave a gap. */
@media (max-width: 640px) {
  .join-shell { min-height: calc(100vh - var(--nav-h)); }
  .join-foot { margin-top: auto; }
}

/* ---------- Sticky progress under the site header ---------- */
.join-bar {
  position: sticky; top: var(--nav-h); z-index: 5; background: var(--cream);
  padding: 0.9rem 0 0.6rem; margin-bottom: 0.4rem;
}
.join-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; min-height: 34px; }
.join-back {
  width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--paper);
  display: grid; place-items: center; cursor: pointer; color: var(--blue-800); padding: 0;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.join-back:hover { border-color: var(--teal-300); background: var(--teal-50); }
.join-back svg { width: 18px; height: 18px; }
.join-back[hidden] { display: none; }
.join-steplabel { font-size: 0.86rem; font-weight: 700; color: var(--blue-800); flex: 1; }
.join-save { background: none; border: 0; color: var(--teal-800); font-weight: 700; font-size: 0.8rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0.3rem 0; }
.join-save[hidden] { display: none; }
.join-progress { margin-top: 0.6rem; display: flex; align-items: center; gap: 0.7rem; }
.join-progress[hidden] { display: none; }
.join-track { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--sand-2); overflow: hidden; }
.join-fill { height: 100%; width: 0; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--teal-500), var(--teal-700)); transition: width .45s var(--ease); }
.join-count { font-size: 0.76rem; font-weight: 800; color: var(--muted); letter-spacing: 0.04em; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Screen ---------- */
.join-viewport { flex: 1; position: relative; }
.join-screen { padding: 0.6rem 0 1.6rem; animation: joinEnter .38s var(--ease) both; }
.join-screen.back { animation-name: joinEnterBack; }
@keyframes joinEnter { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes joinEnterBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .join-screen, .join-screen.back { animation: none; } .join-fill { transition: none; } }

.q-label { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-700); margin-bottom: 0.5rem; }
.join-screen h1 { font-size: clamp(1.55rem, 4.5vw, 2rem); margin: 0 0 0.45rem; line-height: 1.15; }
.join-screen .hint { color: var(--muted); font-size: 0.98rem; margin: 0 0 1.3rem; max-width: 40ch; }
.fine { font-size: 0.78rem; color: var(--muted); line-height: 1.55; margin-top: 1rem; }
.entry-amt { font-family: var(--display); font-size: 1.15rem; color: var(--teal-800); margin: 0 0 0.3rem; font-variant-numeric: tabular-nums; }
.fine a, .hint a { color: var(--teal-800); }

/* Choice cards */
.choices { display: grid; gap: 0.7rem; }
.choice {
  width: 100%; text-align: left; cursor: pointer; margin: 0; font: inherit;
  border: 1.5px solid var(--line-2); border-radius: var(--r-md); background: var(--paper);
  padding: 0.95rem 1.05rem; display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 0.8rem; align-items: center;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
  color: var(--ink-2); position: relative;
}
.choice:hover { border-color: var(--teal-300); }
.choice:focus-visible { outline: 3px solid var(--teal-400); outline-offset: 2px; }
.choice .t { font-family: var(--display); font-size: 1.12rem; color: var(--blue-800); font-weight: 500; }
.choice .s { font-size: 0.86rem; color: var(--muted); grid-column: 1; }
.choice .r { grid-column: 2; grid-row: 1 / span 2; text-align: right; }
.choice .r .big { font-family: var(--display); font-size: 1.25rem; color: var(--teal-800); font-weight: 600; font-variant-numeric: tabular-nums; }
.choice .r .sm { display: block; font-size: 0.74rem; color: var(--muted); }
.choice .tag { display: inline-block; margin-left: 0.4rem; padding: 0.1rem 0.5rem; border-radius: var(--r-pill); background: var(--leaf-gold); color: var(--blue-800); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; vertical-align: middle; }
.choice.selected { border-color: var(--teal-500); background: var(--teal-50); box-shadow: inset 0 0 0 1px var(--teal-500); transform: scale(0.99); }
.choice.selected .t::after { content: " \2713"; color: var(--teal-700); }
.choices.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choices.pills .choice { width: auto; display: inline-flex; justify-content: center; padding: 0.62rem 1.05rem; border-radius: var(--r-pill); font-weight: 700; font-size: 0.92rem; color: var(--ink-2); }
.choices.pills .choice.selected { color: var(--teal-800); }

/* Tier cards */
.choice.tier { grid-template-columns: 1fr auto; padding: 1rem 1.05rem 1rem 1.2rem; overflow: hidden; }
.choice.tier .stripe { position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; }
.choice.tier .benefit { font-family: var(--display); font-size: 1.7rem; color: var(--blue-800); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.choice.tier .meta { grid-column: 1 / -1; display: flex; gap: 0.9rem; margin-top: 0.55rem; font-size: 0.82rem; color: var(--ink-2); flex-wrap: wrap; }
.choice.tier .meta b { color: var(--teal-800); font-weight: 800; font-variant-numeric: tabular-nums; }

/* Fields */
.fields { display: grid; gap: 1rem; }
.field label, .field .field-label { display: block; font-weight: 700; color: var(--blue-800); font-size: 0.88rem; margin-bottom: 0.4rem; }
.field label .opt { color: var(--muted); font-weight: 600; font-size: 0.78rem; }
.field input, .field select {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--ink); background: var(--paper);
  padding: 0.82rem 0.95rem; border: 1.5px solid var(--line-2); border-radius: 12px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px var(--teal-100); }
.field.err input, .field.err select { border-color: var(--leaf-coral); box-shadow: 0 0 0 3px rgba(224,89,106,0.14); }
.field .msg { display: none; color: #B23347; font-size: 0.8rem; font-weight: 700; margin-top: 0.35rem; }
.field.err .msg { display: block; }
.field .help { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.row3 { display: grid; grid-template-columns: 1.4fr 1fr 0.8fr; gap: 0.8rem; }
.dob { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 0.6rem; }
.dob input { text-align: center; font-variant-numeric: tabular-nums; font-size: 1.2rem; }
.dob .lbl { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem; display: block; }
.age-echo { margin-top: 0.9rem; font-size: 0.95rem; color: var(--ink-2); min-height: 1.4em; }
.age-echo b { color: var(--teal-800); }
.subtle-toggle { background: none; border: 0; color: var(--teal-800); font-weight: 700; font-size: 0.85rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0.2rem 0; }
.reveal[hidden] { display: none !important; }

/* Checks */
.check { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.85rem 0.95rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin: 0.1rem 0 0; accent-color: var(--teal-600); flex: none; }
.check span { font-size: 0.9rem; color: var(--ink-2); }
.check.err { border-color: var(--leaf-coral); }
.check a { color: var(--teal-800); }
.check-msg { display: none; color: #B23347; font-size: 0.8rem; font-weight: 700; margin: -0.25rem 0 0; margin-inline-start: 0.2rem; }
.check.err + .check-msg { display: block; }

details.agreement { margin: 0.2rem 0 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
details.agreement summary { cursor: pointer; padding: 0.8rem 0.95rem; font-weight: 700; color: var(--teal-800); font-size: 0.9rem; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
details.agreement summary::-webkit-details-marker { display: none; }
details.agreement summary::after { content: "+"; font-size: 1.2rem; color: var(--muted); }
details.agreement[open] summary::after { content: "\2212"; }
details.agreement .body { padding: 0 0.95rem 0.9rem; font-size: 0.84rem; color: var(--ink-2); max-height: 260px; overflow-y: auto; line-height: 1.6; }
details.agreement .body h4 { font-family: var(--display); font-weight: 500; font-size: 0.98rem; color: var(--blue-800); margin: 0.7rem 0 0.25rem; }
details.agreement .body p { margin: 0 0 0.45rem; }
.du-box { border: 1px solid var(--line); border-radius: 10px; background: var(--cream); padding: 0.7rem 0.9rem; margin: 0.6rem 0 0.4rem; font-size: 0.82rem; }
.du-box .du-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.15rem 0; }
.du-box .k { color: var(--muted); }
.du-box .v { font-weight: 600; color: var(--ink); text-align: right; }
.collect-note { font-size: 0.82rem; line-height: 1.6; color: var(--ink-2); background: var(--cream); border: 1px solid var(--line); border-radius: 12px; padding: 0.85rem 1rem; margin: 0 0 1rem; }
.collect-note a { color: var(--teal-800); text-decoration: underline; }
.auth-date { font-weight: 700; color: var(--ink); font-size: 0.95rem; }

/* Review */
.rev { display: grid; gap: 0.9rem; margin-bottom: 1.2rem; }
.rev-group { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); padding: 0.85rem 0.95rem; }
.rev-group .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.35rem; gap: 1rem; }
.rev-group .head h3 { font-size: 1rem; margin: 0; }
.rev-group .head button { background: none; border: 0; color: var(--teal-800); font-weight: 700; font-size: 0.8rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0; font-family: var(--body); }
.rev-group dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.8rem; font-size: 0.88rem; }
.rev-group dt { color: var(--muted); }
.rev-group dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.turnstile-wrap { margin: 1rem 0 0; min-height: 0; }
.submit-status { display: none; margin-top: 0.8rem; font-size: 0.92rem; font-weight: 700; color: #B23347; }
.submit-status.show { display: block; }

/* Sticky footer: fee ribbon + primary action */
.join-foot {
  position: sticky; bottom: 0; z-index: 5; background: var(--cream);
  border-top: 1px solid var(--line); padding: 0.7rem 0 0.9rem; display: grid; gap: 0.7rem;
  margin-top: 1.2rem;
}
.join-foot[hidden] { display: none; }
.ribbon {
  display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; align-items: center;
  padding: 0.55rem 0.85rem; border-radius: 12px;
  background: linear-gradient(165deg, var(--blue-800), #0F2C3E); color: #EAF3F2;
  animation: joinPop .4s var(--ease);
}
.ribbon[hidden] { display: none; }
@keyframes joinPop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ribbon .amt { font-family: var(--display); font-size: 1.35rem; font-weight: 600; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.ribbon .amt small { display: block; font-family: var(--body); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-200); font-weight: 800; margin-top: 3px; }
.ribbon .rest { font-size: 0.78rem; color: #CFE6EA; line-height: 1.35; text-align: right; }
.ribbon .rest b { color: #fff; font-weight: 800; font-variant-numeric: tabular-nums; }
.join-actions { display: flex; gap: 0.6rem; align-items: stretch; }
.join-cta-back {
  border: 0; border-radius: var(--r-pill); padding: 0.95rem 1.3rem; cursor: pointer; font: inherit;
  background: transparent; color: var(--blue-800); font-weight: 800; font-size: 1rem;
  box-shadow: inset 0 0 0 2px var(--line-2); transition: box-shadow .18s var(--ease), background .18s var(--ease);
}
.join-cta-back:hover { box-shadow: inset 0 0 0 2px var(--teal-500); background: var(--teal-50); }
.join-cta-back:focus-visible { outline: 3px solid var(--teal-400); outline-offset: 2px; }
.join-cta-back[hidden] { display: none; }
.join-cta {
  flex: 1; width: 100%; border: 0; border-radius: var(--r-pill); padding: 0.95rem 1.2rem; cursor: pointer; font: inherit;
  background: var(--teal-700); color: #fff; font-weight: 800; font-size: 1rem;
  box-shadow: var(--sh-teal);
  display: flex; justify-content: center; align-items: center; gap: 0.5rem;
  transition: transform .18s var(--ease), background .18s var(--ease);
}
.join-cta:hover { background: #176573; transform: translateY(-1px); }
.join-cta:focus-visible { outline: 3px solid var(--teal-400); outline-offset: 2px; }
.join-cta[hidden] { display: none; }
.join-cta[disabled] { opacity: 0.6; cursor: wait; transform: none; }
.join-cta .kbd { font-size: 0.7rem; font-weight: 700; opacity: 0.75; border: 1px solid rgba(255,255,255,0.4); border-radius: 6px; padding: 0.05rem 0.4rem; }
@media (hover: none) { .join-cta .kbd { display: none; } }

/* Welcome + done */
.welcome { display: grid; gap: 1rem; padding-top: 0.6rem; }
.welcome .mark { width: 64px; height: 64px; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); display: grid; place-items: center; box-shadow: var(--sh-md); }
.welcome .mark img { width: 40px; height: 40px; }
.welcome .facts { display: grid; gap: 0.55rem; margin: 0.2rem 0 0.4rem; }
.welcome .facts div { display: flex; gap: 0.6rem; align-items: center; font-size: 0.94rem; color: var(--ink-2); }
.welcome .facts svg { width: 18px; height: 18px; color: var(--teal-700); flex: none; }

.done { text-align: center; padding-top: 1.4rem; display: grid; gap: 0.8rem; justify-items: center; }
.done .tick { width: 76px; height: 76px; border-radius: 50%; background: var(--teal-50); color: var(--teal-700); display: grid; place-items: center; animation: joinPop .5s var(--ease); }
.done .tick svg { width: 38px; height: 38px; }
.done .ref { font-family: var(--display); font-size: 1.2rem; color: var(--teal-800); padding: 0.55rem 1.2rem; border: 1px solid var(--teal-200); background: var(--teal-50); border-radius: var(--r-pill); letter-spacing: 0.02em; }
.done p { color: var(--ink-2); font-size: 0.95rem; max-width: 36ch; margin: 0; }

.join-toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%) translateY(10px);
  background: var(--blue-800); color: #fff; padding: 0.6rem 1rem; border-radius: var(--r-pill);
  font-size: 0.84rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease);
  z-index: 50; max-width: min(90vw, 480px); text-align: center;
}
.join-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Honeypot */
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 480px) {
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 .field:first-child { grid-column: 1 / -1; }
}
[dir="rtl"] .choice { text-align: right; }
[dir="rtl"] .choice .r, [dir="rtl"] .ribbon .rest, [dir="rtl"] .du-box .v { text-align: left; }


/* ============================================================
   Price-first form + landing screen (18 Sep 2026)
   ============================================================ */
body.join-page { --nav-h: 60px; }
.join-shell { padding-top: 0; }
.join-bar[hidden] { display: none; }

/* Slim header on this page: logo, language switch (full words), call link. */
.join-header .nav { height: var(--nav-h); }
.join-header .nav-logo { margin-left: 0; }
.join-header .nav-logo img { height: 44px; }
.join-header .nav-cta { gap: 0.5rem; }
.nav-call { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 800; font-size: 0.86rem; color: var(--teal-800); white-space: nowrap; padding: 0.3rem 0; }
.nav-call svg { width: 16px; height: 16px; }
.lang-switch.words button { font-size: 0.8rem; padding: 0.4rem 0.6rem; letter-spacing: 0; }
.lang-switch.words [lang="ar"] { font-size: 0.95rem; padding: 0.3rem 0.55rem; }
@media (max-width: 400px) {
  .join-header .nav-logo img { height: 38px; }
  .lang-switch.words button { padding: 0.35rem 0.42rem; font-size: 0.74rem; }
  .nav-call span { display: none; }
}

/* Landing screen (static HTML in apply.html) */
.land { padding-top: 0.5rem; }
.land .eyebrow { font-size: 0.7rem; letter-spacing: 0.12em; margin-bottom: 0.45rem; }
.land h1 { font-size: clamp(1.7rem, 6vw, 2.3rem); margin: 0 0 0.5rem; line-height: 1.14; }
.land h1 .amt { color: var(--teal-700); }
.land-lead { color: var(--ink-2); font-size: 1rem; margin: 0 0 0.9rem; }
.ticks { display: grid; gap: 0.45rem; margin: 0.2rem 0 1rem; }
.ticks div { display: flex; gap: 0.55rem; align-items: flex-start; font-size: 0.95rem; color: var(--ink-2); }
.ticks svg { width: 20px; height: 20px; flex: none; color: var(--teal-700); margin-top: 2px; }
.ticks b { color: var(--ink); }
.qual { font-size: 0.8rem; color: var(--muted); line-height: 1.5; margin: 0.6rem 0 0; }
.qual a { color: var(--teal-800); text-decoration: underline; }
.land-cta { display: grid; gap: 0.55rem; margin-top: 1rem; }
.land-btn { width: 100%; }
.land .sub { font-size: 0.85rem; color: var(--muted); text-align: center; margin: 0; }
.talk { margin: 0.9rem 0 0; font-size: 0.9rem; color: var(--ink-2); text-align: center; }
.talk a { font-weight: 800; white-space: nowrap; }
.talk .small { font-size: 0.8rem; color: var(--muted); }
.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 1.6rem 0 1rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.strip strong { display: block; font-family: var(--display); font-size: 1.15rem; color: var(--blue-700); font-weight: 600; line-height: 1.1; }
.strip span { font-size: 0.74rem; color: var(--muted); display: block; margin-top: 0.25rem; line-height: 1.3; }
.prov { display: flex; gap: 0.8rem; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0.85rem 0.95rem; margin: 0.6rem 0 1.2rem; }
.prov img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; }
.prov p { font-size: 0.86rem; color: var(--ink-2); line-height: 1.45; margin: 0; }
.prov p b { color: var(--ink); }
.faq { margin: 0.6rem 0 1.2rem; }
.faq h2 { font-size: 1.1rem; margin: 0 0 0.4rem; }
.faq details { border-top: 1px solid var(--line); padding: 0.55rem 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 0.93rem; color: var(--blue-800); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); }
.faq details[open] summary::after { content: "\2212"; }
.faq p { font-size: 0.88rem; color: var(--ink-2); margin: 0.3rem 0 0; }
.lang-offer { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; justify-content: space-between; background: var(--teal-50); border: 1px solid var(--teal-200); border-radius: 12px; padding: 0.6rem 0.85rem; margin: 0.2rem 0 1rem; font-size: 0.9rem; color: var(--ink-2); }
.lang-offer button { background: var(--teal-700); color: #fff; border-radius: var(--r-pill); padding: 0.45rem 0.9rem; font-weight: 800; font-size: 0.85rem; }

/* Question screens */
.sub-lbl { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue-700); margin: 0.2rem 0 0.5rem; }
.dobset { border: 0; padding: 0; margin: 0; min-width: 0; }
.dob label.lbl { display: block; margin-bottom: 0.3rem; }
.field input, .field select { font-size: max(1.05rem, 16px); } /* never below 16px: iOS zooms otherwise */
.field { scroll-margin-top: 170px; scroll-margin-bottom: 200px; }
.field .choices { margin-top: 0.2rem; }
.share-row { display: flex; gap: 0.5rem; margin-top: 0.9rem; }
.share-btn { flex: 1; text-align: center; text-decoration: none; font-size: 0.9rem; padding: 0.75rem 0.8rem; display: flex; align-items: center; justify-content: center; }
.choice .meta .week { font-family: var(--display); font-size: 1.05rem; }
.sub-block { margin-top: 1rem; }

/* Sticky footer: a one-line ribbon on typed screens so it never covers the field. */
.ribbon.compact { grid-template-columns: auto 1fr; padding: 0.35rem 0.75rem; gap: 0.6rem; }
.ribbon.compact .amt { font-size: 1rem; }
.ribbon.compact .amt small { display: none; }
.ribbon.compact .rest { font-size: 0.74rem; }
.join-contact { font-size: 0.78rem; color: var(--muted); text-align: center; margin: 0; }
.join-contact a { font-weight: 800; }
.join-foot { padding-bottom: 0.6rem; }
[dir="rtl"] .land h1, [dir="rtl"] .land-lead, [dir="rtl"] .qual { text-align: right; }
