/* ============================================================
   CCC Serving Match — warm, invitational, fast.
   Palette + type pulled to echo the CCC Volunteer Roles booklet.
   ============================================================ */

:root {
  /* CCC brand palette — Dark Emerald primary, brand greens as accents, orange as a warm pop. */
  --forest-deep:  #002E23;  /* Dark Emerald (brand) — headings, darkest surfaces */
  --forest:       #0a4636;  /* deep emerald — structural text */
  --forest-mid:   #1c7a57;  /* mid emerald — tags, small labels */
  --emerald:      #0b5c44;  /* vibrant emerald — primary buttons / interactive */
  --emerald-bright:#12805e; /* emerald hover */
  --leaf:         #64C084;  /* brand Green — bright accent, progress */
  --mint:         #9BD3AE;  /* brand Mint — soft tints */
  --teal:         #73CAC6;  /* brand Teal */
  --gold:         #E5BD5C;  /* brand Yellow */
  --coral:        #E96947;  /* brand Orange — sparing warm accent */
  --coral-deep:   #c34a2c;
  --coral-soft:   #fdece4;
  --tint-green:   rgba(100,192,132,0.16); /* selected + callout backgrounds */
  --tint-green-ln:#bfe3ca;
  --french-gray:  #BEB7A6;  /* brand French Gray */
  --cream:        #FBF9EF;  /* brand Cream — background */
  --cream-2:      #efe9d7;
  --paper:        #FFFFFF;  /* brand White — cards */
  --ink:          #17211c;
  --ink-soft:     #586a5f;
  --line:         #e7e1d1;
  --shadow:       28px 28px 60px -30px rgba(0,46,35,0.42);
  --shadow-sm:    0 10px 24px -14px rgba(0,46,35,0.38);
  --radius:       22px;
  --radius-lg:    30px;
  --ease:         cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Figtree", -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  background-image:
    radial-gradient(120% 80% at 100% 0%, rgba(100,192,132,0.14), transparent 55%),
    radial-gradient(120% 90% at 0% 100%, rgba(0,46,35,0.09), transparent 55%);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);
}

.stage {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

/* ---------- Brand mark ---------- */
.brandbar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: clamp(20px, 4vh, 40px);
}
.brandbar .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(224,87,58,0.16);
}
.brandbar .wordmark {
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--forest);
}

/* ---------- Screens ---------- */
.screen { display: none; }
.screen.active { display: block; animation: screenIn 0.5s var(--ease) both; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Welcome ---------- */
.hero {
  text-align: center;
}
.hero .eyebrow {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--forest);
  background: var(--tint-green);
  padding: 7px 14px;
  border-radius: 100px;
  margin-bottom: 22px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 560;
  font-optical-sizing: auto;
  font-size: clamp(2.4rem, 8vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--forest-deep);
  margin-bottom: 18px;
}
.hero h1 em {
  font-style: italic;
  color: var(--leaf);
}
.hero p.lead {
  font-size: clamp(1.02rem, 3.4vw, 1.18rem);
  color: var(--ink-soft);
  max-width: 30ch;
  margin: 0 auto 34px;
}
.meta-chips {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.chip {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--forest);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.chip svg { width: 15px; height: 15px; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.04rem;
  border: none;
  cursor: pointer;
  border-radius: 100px;
  padding: 17px 34px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn-primary {
  background: linear-gradient(160deg, var(--emerald-bright), var(--emerald) 60%, var(--forest-deep));
  color: #fff;
  box-shadow: 0 14px 28px -12px rgba(11,92,68,0.72);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 36px -12px rgba(11,92,68,0.82); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  color: var(--forest);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { background: var(--paper); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-arrow { transition: transform 0.2s var(--ease); }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

/* ---------- Progress ---------- */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}
.progress-track {
  flex: 1;
  height: 7px;
  background: var(--cream-2);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--leaf), var(--emerald));
  border-radius: 100px;
  transition: width 0.45s var(--ease);
}
.progress-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Question card ---------- */
.q-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 40px);
  box-shadow: var(--shadow);
}
.q-index {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--forest-mid);
  margin-bottom: 10px;
}
.q-prompt {
  font-family: var(--font-display);
  font-weight: 540;
  font-size: clamp(1.55rem, 5.5vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--forest-deep);
  margin-bottom: 8px;
}
.q-help {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.q-prompt + .options { margin-top: 26px; }

.options { display: grid; gap: 12px; }
.options.two { grid-template-columns: 1fr; }
@media (min-width: 480px) {
  .options.two { grid-template-columns: 1fr 1fr; }
}

.opt {
  position: relative;
  text-align: left;
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform 0.18s var(--ease), border-color 0.18s, background 0.18s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 84px;
  justify-content: center;
}
.opt:hover {
  transform: translateY(-3px);
  border-color: var(--forest-mid);
  box-shadow: var(--shadow-sm);
  background: var(--paper);
}
.opt .opt-label {
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--forest-deep);
}
.opt .opt-sub {
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.opt .opt-icon {
  font-size: 1.4rem;
  color: var(--forest-mid);
  line-height: 1;
  margin-bottom: 4px;
}
.opt.selected {
  border-color: var(--emerald);
  background: var(--tint-green);
  box-shadow: 0 12px 26px -14px rgba(11,92,68,0.55);
}
.opt.selected .opt-label { color: var(--forest-deep); }

.q-back {
  margin-top: 22px;
  background: none;
  border: none;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.q-back:hover { color: var(--forest); }
.q-back[hidden] { display: none; }

/* ---------- Contact form ---------- */
.form-card { }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--forest);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}
.field label .opt-flag { color: var(--ink-soft); font-weight: 500; }
.field input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px;
  transition: border-color 0.18s, background 0.18s;
}
.field input:focus {
  outline: none;
  border-color: var(--emerald);
  background: var(--paper);
}
.field input::placeholder { color: #a9b0a6; }
.form-actions { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.form-actions .btn { width: 100%; justify-content: center; }
.privacy-note {
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 4px;
}

/* ---------- Results ---------- */
.results-head { text-align: center; margin-bottom: 30px; }
.results-head .eyebrow {
  font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  font-size: 0.7rem; color: var(--forest-mid);
}
.results-head h2 {
  font-family: var(--font-display);
  font-weight: 540;
  font-size: clamp(1.9rem, 6vw, 2.7rem);
  line-height: 1.05;
  color: var(--forest-deep);
  margin: 10px 0 8px;
}
.results-head h2 span { color: var(--leaf); font-style: italic; }
.results-head p { color: var(--ink-soft); font-size: 1rem; }

.cards { display: grid; gap: 16px; }
.role-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 24px 22px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
}
.role-card.reveal { animation: cardIn 0.6s var(--ease) forwards; }

/* Cards are buttons — the person picks the one that fits. */
button.role-card {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s, opacity 0.3s;
}
button.role-card:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: var(--emerald);
  box-shadow: 0 18px 34px -20px rgba(0,46,35,0.5);
}
button.role-card:focus-visible {
  outline: 3px solid var(--leaf);
  outline-offset: 3px;
}
.role-choose {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--emerald);
}
.role-choose svg { width: 15px; height: 15px; transition: transform 0.2s var(--ease); }
button.role-card:hover:not(:disabled) .role-choose svg { transform: translateX(4px); }

/* After a pick: the chosen card stays lit, the others recede.
   !important is required — the reveal animation's `forwards` fill sets opacity:1 and would
   otherwise win over this rule in the cascade. */
.cards.has-choice .role-card:not(.chosen) { opacity: 0.42 !important; }
.cards.has-choice .role-card { cursor: default; }
.role-card.chosen {
  border-color: var(--emerald);
  box-shadow: 0 18px 36px -20px rgba(11,92,68,0.65);
}
.role-card.chosen .role-choose { color: var(--forest-deep); }

/* Confirmation panel shown after the person picks a role. */
.choice-confirm {
  display: none;
  gap: 13px;
  align-items: flex-start;
  background: var(--forest-deep);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-top: 20px;
}
.choice-confirm.show { display: flex; animation: screenIn 0.45s var(--ease) both; }
.choice-confirm svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; color: var(--leaf); }
.choice-confirm-title { font-weight: 800; font-size: 1.05rem; margin-bottom: 3px; }
.choice-confirm-body { font-size: 0.92rem; opacity: 0.9; line-height: 1.45; }
@keyframes cardIn { to { opacity: 1; transform: translateY(0); } }

.role-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: linear-gradient(var(--forest-deep), var(--leaf));
}
.role-card:nth-child(2)::before { background: linear-gradient(var(--emerald), var(--mint)); }
.role-card:nth-child(3)::before { background: linear-gradient(var(--forest-mid), var(--teal)); }

.role-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.role-rank {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--forest-mid);
  font-weight: 500;
  white-space: nowrap;
}
.role-ministry {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--forest);
  background: var(--tint-green);
  padding: 5px 10px;
  border-radius: 100px;
}
.role-name {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--forest-deep);
  margin: 6px 0 8px;
}
.role-blurb {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.role-why {
  font-size: 0.9rem;
  color: var(--forest);
  background: var(--tint-green);
  border-radius: 14px;
  padding: 11px 14px;
  margin-bottom: 14px;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.role-why b { color: var(--forest-deep); }
.role-why svg { color: var(--gold); }
.role-why svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.role-why b { font-weight: 800; }
.role-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}
.role-meta span { display: inline-flex; align-items: center; gap: 6px; }
.role-meta svg { width: 14px; height: 14px; opacity: 0.7; }

.results-actions {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.results-actions .btn { width: 100%; justify-content: center; }
.results-footnote {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 16px;
  line-height: 1.5;
}
.sent-banner {
  background: var(--forest);
  color: #fff;
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.sent-banner.show { display: flex; animation: screenIn 0.4s var(--ease) both; }
.sent-banner svg { width: 20px; height: 20px; flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .role-card { opacity: 1; transform: none; }
}
