/**
 * Checkers/shared/af-checkers.css — how the free checkers look.
 *
 * ---------------------------------------------------------------------------
 * IT BORROWS THE SITE'S PALETTE RATHER THAN BRINGING ONE
 * ---------------------------------------------------------------------------
 *
 * Every colour below reads a token from assets/css/site.css with a hard-coded
 * fallback behind it. On atlasfoundry.co.uk the site's own values win, so a
 * checker matches the page it is sitting in and follows the site's light/dark
 * switching without knowing anything about it. Dropped on a bare page with no
 * site.css it still renders correctly, and the fallbacks change with the
 * viewer's colour scheme so that case is not stuck in light either.
 *
 * `--accent-teal-text` and not `--accent-teal` anywhere text is involved. The
 * site defines both deliberately: the brighter teal is for fills and rules and
 * measures about 2.5:1 on white, which is a contrast failure as text. That
 * exact mistake shipped once and was caught by an automated scan; it is written
 * down here so it is not made a second time in a new file.
 *
 * ---------------------------------------------------------------------------
 * EVERYTHING IS PREFIXED AND SCOPED
 * ---------------------------------------------------------------------------
 *
 * Every class starts `af-` and every rule is scoped under `.af-checker`. This
 * stylesheet is going into pages built by somebody else; it must not reach out
 * and restyle their headings, their inputs or their links. Nothing here selects
 * a bare element outside the checker's own container.
 */

.af-checker {
  /* ---- borrowed, with a fallback for standalone use --------------------- */
  --afc-card:    var(--surface-card, #FFFFFF);
  --afc-sunk:    var(--surface-sunk, #F1F3F7);
  --afc-ink:     var(--text-primary, #111827);
  --afc-soft:    var(--text-secondary, #5B6472);
  --afc-rule:    var(--border-hairline, #E5E7EB);
  --afc-accent:  var(--accent-teal-text, #1E766E);
  --afc-navy:    var(--accent-navy, #0F2A4A);
  --afc-warn:    var(--accent-amber-text, #8A5606);
  --afc-stop:    var(--accent-coral, #FF6B5E);
  --afc-ring:    var(--ring, rgba(47,184,172,0.45));
  --afc-shadow:  var(--shadow-card, 0 1px 2px rgba(15,23,42,0.04), 0 8px 24px rgba(15,23,42,0.06));

  --afc-gap: 1.25rem;

  display: flex;
  flex-direction: column;
  gap: var(--afc-gap);
  color: var(--afc-ink);
  font-family: inherit;
  line-height: 1.55;
  max-width: 42rem;
}

@media (prefers-color-scheme: dark) {
  .af-checker {
    --afc-card: var(--surface-card, #101E33);
    --afc-sunk: var(--surface-sunk, #0D1A2C);
    --afc-ink:  var(--text-primary, #F2F5F9);
    --afc-soft: var(--text-secondary, #93A2B8);
    --afc-rule: var(--border-hairline, #1F2E45);
    --afc-accent: var(--accent-teal-text, #5FD3C7);
    --afc-warn: var(--accent-amber-text, #F0BE6B);
  }
}

.af-checker *,
.af-checker *::before,
.af-checker *::after { box-sizing: border-box; }

/* --------------------------------------------------------------- questions */

.af-questions { display: flex; flex-direction: column; gap: var(--afc-gap); }

.af-q { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; padding: 0; border: 0; min-width: 0; }

.af-q__label {
  font-weight: 600;
  font-size: 1rem;
  color: var(--afc-ink);
  padding: 0;
}

.af-q__hint { margin: 0; font-size: 0.875rem; color: var(--afc-soft); }

/* ---- money ---------------------------------------------------------------
   The £ sits inside the field rather than beside it, so the box reads as one
   control and a long number never collides with the symbol. */
.af-money {
  display: flex;
  align-items: stretch;
  background: var(--afc-card);
  border: 1px solid var(--afc-rule);
  border-radius: 8px;
  max-width: 16rem;
  overflow: hidden;
}

.af-money:focus-within { border-color: var(--afc-accent); box-shadow: 0 0 0 3px var(--afc-ring); }

.af-money__symbol {
  display: flex; align-items: center;
  padding: 0 0.7rem;
  background: var(--afc-sunk);
  border-right: 1px solid var(--afc-rule);
  color: var(--afc-soft);
  font-size: 0.95rem;
}

.af-money__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 0;
  background: transparent;
  color: var(--afc-ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

/* The date input, added 26 September 2026 for the landlord dates checker - the
   first question on this site that asks for a date rather than a figure. Built
   from the money field's own tokens so a form holding both looks like one form,
   and sized to the content: a date is eleven characters, not a paragraph. */
.af-date__input {
  padding: 0.65rem 0.75rem;
  background: var(--afc-card);
  border: 1px solid var(--afc-rule);
  border-radius: 8px;
  color: var(--afc-ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
  max-width: 16rem;
}
.af-date__input:focus-visible { outline: 0; border-color: var(--afc-accent); box-shadow: 0 0 0 3px var(--afc-ring); }

/* A count. Narrower than a date, because it holds two or three digits. */
.af-count__input {
  padding: 0.65rem 0.75rem;
  background: var(--afc-card);
  border: 1px solid var(--afc-rule);
  border-radius: 8px;
  color: var(--afc-ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
  max-width: 8rem;
}
.af-count__input:focus-visible { outline: 0; border-color: var(--afc-accent); box-shadow: 0 0 0 3px var(--afc-ring); }

.af-money__input:focus { outline: none; }

/* ---- choices ------------------------------------------------------------- */

.af-choices { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.15rem; }

.af-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  background: var(--afc-card);
  border: 1px solid var(--afc-rule);
  border-radius: 8px;
  cursor: pointer;
}

.af-choice:hover { border-color: var(--afc-accent); }
.af-choice:focus-within { border-color: var(--afc-accent); box-shadow: 0 0 0 3px var(--afc-ring); }

.af-choice__input { margin: 0.25rem 0 0; flex: 0 0 auto; accent-color: var(--afc-accent); }

.af-choice__text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.af-choice__title { font-weight: 500; }
.af-choice__detail { font-size: 0.85rem; color: var(--afc-soft); }

/* ---- twelve months ------------------------------------------------------- */

.af-months {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.6rem;
  margin-top: 0.3rem;
}

.af-month { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.af-month__label { font-size: 0.78rem; color: var(--afc-soft); }

.af-month__input {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.55rem;
  background: var(--afc-card);
  border: 1px solid var(--afc-rule);
  border-radius: 6px;
  color: var(--afc-ink);
  font: inherit;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.af-month__input:focus { outline: none; border-color: var(--afc-accent); box-shadow: 0 0 0 3px var(--afc-ring); }

/* ---- grouping heading ---------------------------------------------------- */

.af-section { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.4rem; }
.af-section:first-child { margin-top: 0; }

.af-section__title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--afc-accent);
}

.af-section__hint { margin: 0; font-size: 0.875rem; color: var(--afc-soft); }

/* ----------------------------------------------------------------- answer */

.af-answer-slot { min-height: 3rem; }

.af-answer__waiting {
  margin: 0;
  padding: 0.9rem 1rem;
  background: var(--afc-sunk);
  border-radius: 8px;
  color: var(--afc-soft);
  font-size: 0.9rem;
}

.af-answer {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem 1.25rem;
  background: var(--afc-card);
  border: 1px solid var(--afc-rule);
  border-left: 4px solid var(--afc-accent);
  border-radius: 8px;
  box-shadow: var(--afc-shadow);
}

/* Three tones, and they mean three different things: you are fine, something
   applies to you, something applies and there is a deadline attached. */
.af-answer--clear  { border-left-color: var(--afc-accent); }
.af-answer--action { border-left-color: var(--afc-warn); }
.af-answer--urgent { border-left-color: var(--afc-stop); }

.af-answer__headline { margin: 0; font-size: 1.15rem; font-weight: 600; line-height: 1.35; }
.af-answer__detail { margin: 0; color: var(--afc-soft); }

.af-answer__points { margin: 0.15rem 0 0; padding-left: 1.15rem; display: flex; flex-direction: column; gap: 0.35rem; }
.af-answer__points li { color: var(--afc-soft); font-size: 0.94rem; }

.af-answer__next { margin: 0.3rem 0 0; }

.af-answer__link {
  color: var(--afc-accent);
  font-weight: 600;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------- the offer

   ONLY EVER ON A VERDICT THAT CARRIES ONE. A checker that has just said "no,
   you are under both thresholds" renders none of this, which is enforced by
   the branch rather than by a style.

   Quieter than the answer above it on purpose: the answer is what somebody
   came for and this is what we would like next, and that order should be
   visible without reading a word. Hence a hairline and a tint rather than a
   button, and a secondary that looks like prose. */

.af-answer__buy {
  margin: 0.85rem 0 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--afc-line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--afc-accent) 5%, transparent);
}

.af-answer__buy-line {
  margin: 0;
  font-size: 0.94rem;
  color: var(--afc-ink);
}

.af-answer__buy-actions {
  margin: 0.55rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.9rem;
}

.af-answer__buy-primary {
  font-weight: 650;
  color: var(--afc-accent);
  text-underline-offset: 3px;
}

.af-answer__buy-secondary {
  font-size: 0.88rem;
  color: var(--afc-soft);
  text-underline-offset: 3px;
}

.af-answer__buy-secondary:hover { color: var(--afc-ink); }

/* ------------------------------------------------------------- small print */

.af-smallprint {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--afc-rule);
  font-size: 0.83rem;
  color: var(--afc-soft);
}

.af-smallprint p { margin: 0; }
.af-smallprint__facts strong { color: var(--afc-ink); }
.af-smallprint__limits summary { cursor: pointer; color: var(--afc-ink); font-weight: 500; }
.af-smallprint__limits ul { margin: 0.5rem 0 0; padding-left: 1.15rem; display: flex; flex-direction: column; gap: 0.3rem; }
.af-smallprint__sources a { color: var(--afc-accent); }

/* ------------------------------------------------------------------ focus */

.af-checker :focus-visible { outline: 2px solid var(--afc-accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .af-checker *, .af-checker *::before, .af-checker *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
