/* =====================================================================
   The CA Challenge page.

   One page, three screens. Sized for a phone held in one hand at a stall or
   on a sofa after an Instagram ad, so the tap targets are large and the
   question never shares the fold with anything competing for attention.
   ===================================================================== */

.ch__screen { display: none; }
.ch__screen.is-on { display: block; animation: ch-in .28s ease both; }
@keyframes ch-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ch__screen.is-on { animation: none; } }

.ch__wrap { max-width: 720px; padding-top: var(--s8, 56px); padding-bottom: var(--s8, 56px); }

.ch__kicker {
  font-size: .8125rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red, #C8322B); margin: 0 0 var(--s3);
}
.ch__title { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.08; margin: 0 0 var(--s4); }
.ch__sub { font-size: 1.0625rem; line-height: 1.6; color: var(--ink-mut); margin: 0 0 var(--s6); }

/* --- the details ------------------------------------------------------ */
.ch__form { display: flex; flex-direction: column; gap: var(--s5); }
.ch__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.ch__field { display: flex; flex-direction: column; gap: 6px; }
.ch__field--wide { grid-column: 1 / -1; }
.ch__field > span { font-size: .9375rem; font-weight: 600; }
.ch__field em { font-style: normal; font-weight: 400; color: var(--ink-mut); }
.ch__field .input { min-height: 52px; font-size: 1rem; }
.ch__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ch__err {
  margin: 0; padding: 12px 14px; border-radius: 12px; font-size: .9375rem;
  background: var(--wrong-bg, #FBE9E7); color: var(--wrong, #B3261E);
}
.ch__fine { font-size: .875rem; color: var(--ink-mut); margin: 0; line-height: 1.5; }
@media (max-width: 560px) {
  .ch__grid { grid-template-columns: 1fr; }
}

/* --- the paper -------------------------------------------------------- */
.ch__bar { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.ch__count { font-size: .9375rem; color: var(--ink-mut); white-space: nowrap; }
.ch__count b { color: inherit; }
.ch__topic {
  font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--red, #C8322B); text-align: right; min-width: 0;
}

.ch__rail { display: flex; gap: 5px; margin: var(--s3) 0 var(--s6); }
.ch__rail i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); transition: background .2s; }
.ch__rail i.now { background: var(--ink-mut); }
.ch__rail i.ok  { background: #1F7A4D; }
.ch__rail i.no  { background: var(--wrong, #B3261E); }

.ch__q { font-size: clamp(1.375rem, 4vw, 1.875rem); line-height: 1.3; margin: 0 0 var(--s6); }

.ch__opts { list-style: none; margin: 0 0 var(--s5); padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.ch__opt {
  width: 100%; display: flex; align-items: center; gap: var(--s3); text-align: left;
  min-height: 64px; padding: 14px 18px; border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--white, #fff); font: inherit; font-size: 1.0625rem; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ch__opt:hover { border-color: var(--ink-mut); }
.ch__key {
  flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  background: var(--paper, #FAF9F6); font-size: .9375rem; font-weight: 700; color: var(--ink-mut);
}
.ch__opts.is-locked .ch__opt { cursor: default; }
.ch__opts.is-locked .ch__opt:hover { border-color: var(--line); }
.ch__opt.is-right { border-color: #1F7A4D; background: #F2F8F5; }
.ch__opt.is-right .ch__key { background: #1F7A4D; color: #fff; }
.ch__opt.is-wrong { border-color: var(--wrong, #B3261E); background: var(--wrong-bg, #FBE9E7); }
.ch__opt.is-wrong .ch__key { background: var(--wrong, #B3261E); color: #fff; }

.ch__why {
  padding: var(--s4); border-radius: 14px; background: var(--paper, #FAF9F6);
  border: 1px solid var(--line); margin-bottom: var(--s5);
}
.ch__why-head { margin: 0 0 4px; font-weight: 700; font-size: .9375rem; }
.ch__why-text { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--ink-mut); }

/* --- the close -------------------------------------------------------- */
#ch-done.is-on {
  background: var(--navy, #10294C); color: #fff;
  display: flex; align-items: center; min-height: calc(100vh - 72px);
}

/* The theme's ghost button is a dark outline for light pages. On the navy
   closing screen it rendered as dark text on dark and all but disappeared,
   so this screen carries its own. */
#ch-done .btn--ghost {
  color: #fff; border-color: rgba(255, 255, 255, .45); background: transparent;
}
#ch-done .btn--ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.ch__wrap--close { padding-top: var(--s9, 72px); padding-bottom: var(--s9, 72px); }
.ch__kicker--light { color: var(--gold, #E4A33A); }
.ch__done-title { font-size: clamp(2.25rem, 7vw, 3.5rem); line-height: 1.06; margin: 0 0 var(--s5); color: #fff; }
.ch__done-line { font-size: clamp(1.125rem, 3vw, 1.4375rem); line-height: 1.5; margin: 0 0 var(--s7, 48px); color: #DCE6F2; max-width: 36ch; }
.ch__cta { display: flex; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s6); }
.ch__cta .btn { flex: 1 1 auto; justify-content: center; }
.ch__fine--light { color: #93A9C6; }

/* --- the footer call to action ---------------------------------------- */
.site-foot__challenge {
  display: inline-flex; align-items: center; gap: 10px;
}


/* --- phones -----------------------------------------------------------
   Two things break below about 560px if left alone: "Question 1 of 10"
   splits across lines because the category beside it is long enough to
   squeeze it, and a category like "Elimination & choice strategy" wraps
   into a right-aligned ragged block. Both read as broken rather than
   tight, so the two stack and the category goes left with everything
   else. */
@media (max-width: 560px) {
  .ch__wrap { padding-top: var(--s6, 24px); padding-bottom: var(--s7, 48px); }

  .ch__bar { flex-direction: column; align-items: flex-start; gap: 4px; }
  .ch__topic { text-align: left; font-size: .75rem; letter-spacing: .06em; }
  .ch__rail { margin-top: var(--s4); margin-bottom: var(--s5); }

  .ch__q { font-size: 1.3125rem; margin-bottom: var(--s5); }
  .ch__opt { min-height: 60px; padding: 12px 14px; font-size: 1rem; gap: var(--s2); }
  .ch__key { flex-basis: 30px; height: 30px; font-size: .875rem; }

  /* The submit and Next buttons are the whole point of the screen, and a
     thumb reaching for them should not have to aim. */
  #ch-go, #ch-next { width: 100%; }
  .ch__cta { flex-direction: column; }
  .ch__cta .btn { width: 100%; }

  .ch__done-line { max-width: none; }
}

/* A phone in landscape, and the small tablets people hand round at a
   stall: the form is wide enough for two columns but the page is not
   wide enough for the generous desktop spacing. */
@media (min-width: 561px) and (max-width: 860px) {
  .ch__wrap { padding-top: var(--s7, 48px); padding-bottom: var(--s7, 48px); }
}
