/* ═══════════════════════════════════════════════
   tool-page.css — M13: 3-step "How it works" + bottom CTA, scoped to free-tool pages
   Scoped to body.f8-tool-form. Brand tokens only.
═══════════════════════════════════════════════ */

body.f8-tool-form .tool-howitworks {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  background: transparent;
}

body.f8-tool-form .tool-howitworks-inner {
  max-width:calc(1180*0.0625rem);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 4rem);
}

body.f8-tool-form .tool-howitworks-eyebrow {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size:var(--font-size-sm);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 0.75rem;
}

body.f8-tool-form .tool-howitworks-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--cloud);
  margin: 0 0 1.75rem;
}

body.f8-tool-form .tool-howitworks-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.875rem, 2vw, 1.375rem);
}

body.f8-tool-form .tool-step {
  position: relative;
  background: linear-gradient(180deg, rgba(13, 40, 71, 0.7) 0%, rgba(10, 31, 58, 0.85) 100%);
  border:var(--border-hairline) solid var(--border2);
  border-radius:1rem;
  padding: clamp(1.25rem, 2.4vw, 1.75rem);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

body.f8-tool-form .tool-step:hover {
  border-color: var(--border3);
  transform: translateY(-2px);
}

body.f8-tool-form .tool-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width:calc(36*0.0625rem);
  height:calc(36*0.0625rem);
  border-radius:var(--radius-pill);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size:var(--font-size-base);
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(180deg, var(--teal) 0%, var(--teal-d) 100%);
  margin: 0 0 0.875rem;
  box-shadow:
    0 0 0 1px rgba(10, 168, 140, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

body.f8-tool-form .tool-step-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size:var(--font-size-base);
  font-weight: 700;
  color: var(--cloud);
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

body.f8-tool-form .tool-step-body {
  font-family: 'Inter', sans-serif;
  font-size:var(--font-size-base);
  line-height: 1.55;
  color: var(--steel);
  margin: 0;
}

body.f8-tool-form .tool-bottom-cta {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  background: transparent;
}

body.f8-tool-form .tool-bottom-cta-inner {
  max-width:calc(880*0.0625rem);
  margin: 0 auto;
  padding: clamp(1.75rem, 3.5vw, 2.75rem);
  background: linear-gradient(180deg, rgba(13, 40, 71, 0.85) 0%, rgba(10, 31, 58, 0.92) 100%);
  border:var(--border-hairline) solid var(--border2);
  border-radius:1.125rem;
  text-align: center;
  box-shadow:
    0 1.5rem 3rem -24px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 var(--white-04);
}

body.f8-tool-form .tool-bottom-cta-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--cloud);
  margin: 0 0 0.625rem;
}

body.f8-tool-form .tool-bottom-cta-sub {
  font-family: 'Inter', sans-serif;
  font-size:var(--font-size-base);
  line-height: 1.55;
  color: var(--steel);
  margin: 0 auto 1.375rem;
  max-width:calc(560*0.0625rem);
}

body.f8-tool-form .tool-bottom-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

body.f8-tool-form .tool-bottom-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height:calc(48*0.0625rem);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size:var(--font-size-base);
  font-weight: 700;
  border-radius:0.625rem;
  padding: 0 1.5rem;
  text-decoration: none;
  transition: filter var(--motion-fast) ease, border-color var(--motion-fast) ease;
}

body.f8-tool-form .tool-bottom-cta-btn--primary {
  color: var(--bg);
  background: linear-gradient(180deg, var(--teal) 0%, var(--teal-d) 100%);
  box-shadow:
    0 2px 0.25rem rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(10, 168, 140, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

body.f8-tool-form .tool-bottom-cta-btn--primary:hover {
  filter: brightness(1.05);
}

body.f8-tool-form .tool-bottom-cta-btn--secondary {
  color: var(--cloud);
  background: transparent;
  border:var(--border-hairline) solid var(--border2);
}

body.f8-tool-form .tool-bottom-cta-btn--secondary:hover {
  border-color: rgba(12, 201, 168, 0.5);
}

body.f8-tool-form .tool-bottom-cta-btn:focus-visible {
  outline:var(--border-thick) solid var(--teal);
  outline-offset:var(--outline-offset-2);
}

@media (max-width:calc(820*0.0625rem)) {
  body.f8-tool-form .tool-howitworks-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.f8-tool-form .tool-step,
  body.f8-tool-form .tool-bottom-cta-btn {
    transition: none;
  }

  body.f8-tool-form .tool-step:hover {
    transform: none;
  }
}

/* ═══════════════════════════════════════════════
   PREMIUM POLISH — FREE TOOL FORMS (2026-05-17)
   Scope: body.f8-tool-form only.
   Audit findings addressed:
   - Cyber Essentials radios were rendering native (white circle) with
     16x16 hit area, breaking premium-feel and 44x44 touch-target rule.
   - Fieldset legend was overlapping its top border at clamped padding.
   - Yes/No label pair stacked vertically at desktop, wasting horizontal
     space and visually disconnecting the option pair.
   - Tool-form action row lacked a consistent min-height tap target on
     reset/secondary buttons.
   - Default placeholder colour on number/text inputs was too dim,
     breaking 3:1 placeholder contrast.
   ═══════════════════════════════════════════════ */

/* Fieldset polish — keep brand-consistent dark card with breathing room
   around the legend so the "1. Boundary firewalls..." heading no
   longer crashes into the top border. */
body.f8-tool-form .tool-form-premium fieldset.tool-form-row {
  padding:1.125rem 1.25rem 1rem;
  border-radius:0.75rem;
  background: rgba(4, 14, 26, 0.45);
  border:var(--border-hairline) solid var(--border2);
  margin: 0;
}

body.f8-tool-form .tool-form-premium fieldset.tool-form-row > legend {
  padding: 0 0.25rem;
  margin-inline-start: -4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size:var(--font-size-base);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--cloud);
}

body.f8-tool-form .tool-form-premium fieldset.tool-form-row > small {
  display: block;
  margin:var(--space-1-5) 0 0.75rem;
  font-family: 'Inter', sans-serif;
  font-size:var(--font-size-sm);
  line-height: 1.5;
  color: var(--mist);
}

/* Yes / No row — horizontal at >=32.5rem, stacked on narrow phones.
   The row is the tap-target container so every label gives a 2.75rem
   row regardless of the actual 1rem radio glyph. */
body.f8-tool-form .tool-form-premium fieldset.tool-form-row > label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height:calc(44*0.0625rem);
  padding:var(--space-1-5) 0.75rem 0.375rem 0.625rem;
  margin:var(--space-1-5) 0 0;
  background: rgba(13, 40, 71, 0.45);
  border:var(--border-hairline) solid var(--border2);
  border-radius:0.625rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size:var(--font-size-base);
  font-weight: 600;
  line-height: 1.3;
  color: var(--cloud);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

body.f8-tool-form .tool-form-premium fieldset.tool-form-row > label:hover {
  border-color: rgba(12, 201, 168, 0.45);
  background: rgba(13, 40, 71, 0.7);
}

body.f8-tool-form .tool-form-premium fieldset.tool-form-row > label:has(input[type="radio"]:checked) {
  border-color: var(--teal);
  background: var(--teal-12);
  box-shadow: 0 0 0 1px var(--border3) inset;
}

body.f8-tool-form .tool-form-premium fieldset.tool-form-row > label:focus-within {
  outline:var(--border-thick) solid var(--teal);
  outline-offset:var(--outline-offset-2);
}

/* Custom radio glyph — replaces browser default with brand-aligned
   teal ring + filled dot when checked. accent-color fallback is
   preserved for older browsers. */
body.f8-tool-form .tool-form-premium fieldset.tool-form-row > label input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width:calc(18*0.0625rem);
  height:calc(18*0.0625rem);
  margin: 0;
  border-radius: 50%;
  border: 1.5px solid var(--border3, rgba(232, 240, 250, 0.35));
  background: rgba(4, 14, 26, 0.85);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.18s ease, background-color 0.18s ease;
  accent-color: var(--teal);
}

body.f8-tool-form .tool-form-premium fieldset.tool-form-row > label input[type="radio"]:hover {
  border-color: var(--teal);
}

body.f8-tool-form .tool-form-premium fieldset.tool-form-row > label input[type="radio"]:checked {
  border-color: var(--teal);
  background: var(--bg);
}

body.f8-tool-form .tool-form-premium fieldset.tool-form-row > label input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--teal);
}

body.f8-tool-form .tool-form-premium fieldset.tool-form-row > label input[type="radio"]:focus-visible {
  outline:var(--border-thick) solid var(--teal);
  outline-offset:var(--outline-offset-3);
}

/* Yes/No grouping — at >=32.5rem the fieldset becomes a flex container so
   the two option-labels share a row evenly; below that they stack
   full-width. The fieldset's child flow has to be flex to override
   the .tool-form-row column flex inherited from the platform CSS. */
@media (min-width:calc(520*0.0625rem)) {
  body.f8-tool-form .tool-form-premium fieldset.tool-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-column-gap:var(--space-3);
    grid-row-gap:var(--space-2);
  }
  body.f8-tool-form .tool-form-premium fieldset.tool-form-row > legend {
    grid-column: 1 / -1;
  }
  body.f8-tool-form .tool-form-premium fieldset.tool-form-row > small {
    grid-column: 1 / -1;
    margin-bottom: var(--space-1);
  }
  body.f8-tool-form .tool-form-premium fieldset.tool-form-row > label {
    margin: 0;
  }
}

/* Form action row — guarantee secondary buttons (Reset) match the
   primary's 3.25rem min-height and the row never collapses. */
body.f8-tool-form .tool-form-premium .tool-form-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-3);
  min-height:calc(52*0.0625rem);
  align-items: stretch;
}

body.f8-tool-form .tool-form-premium .tool-form-actions > .btn {
  min-height:calc(52*0.0625rem);
  padding-inline: var(--space-6);
}

@media (max-width:calc(520*0.0625rem)) {
  body.f8-tool-form .tool-form-premium .tool-form-actions {
    flex-direction: column;
  }
  body.f8-tool-form .tool-form-premium .tool-form-actions > .btn {
    width: 100%;
  }
}

/* Placeholder contrast — bump from 0.7 alpha to ensure 3:1 contrast
   against the dark glass background. */
body.f8-tool-form .tool-form-premium input::placeholder,
body.f8-tool-form .tool-form-premium textarea::placeholder {
  color: var(--mist);
  opacity: 0.9;
}

/* Form card lift — strengthen the bottom shadow so the form anchors
   visually against the long page background. Subtle change, lifts
   premium feel without changing colour tokens. */
body.f8-tool-form form.tool-form.tool-form-premium {
  box-shadow:
    inset 0 1px 0 var(--white-05),
    0 1px 0 rgba(255, 255, 255, 0.02) inset,
    0 2rem 4rem -36px rgba(0, 0, 0, 0.65),
    0 0 0 1px var(--teal-08);
}

/* Reset button (.btn-secondary inside tool form) — was rendering with
   no border-radius offset against the primary, making the visual
   pairing feel mismatched. Align radius and weight. */
body.f8-tool-form .tool-form-premium .tool-form-actions > .btn.btn-secondary {
  border-radius:0.75rem;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  body.f8-tool-form .tool-form-premium fieldset.tool-form-row > label,
  body.f8-tool-form .tool-form-premium fieldset.tool-form-row > label input[type="radio"] {
    transition: none;
  }
}

/* ═══════════════════════════════════════════════
   P1-008 — DARK-THEME THE FREE-TOOL FORM (2026-06-15)
   The 6 free-tool pages previously rendered the form as a WHITE
   "paper" card (.ca-section-light + .bg-white) on the otherwise dark
   cinematic site — a jarring light island, and on global inspection
   the typed input text was dark-on-(near-black) outside the white
   card. Owner report P1-008: "tool form light bg on dark site".
   Section is now .ca-tool-form-dark and the card is .ca-tool-card-dark.
   Re-theme the form surface + controls to the dark brand palette so it
   is consistent with the site and high-contrast. Scoped to
   body.f8-tool-form so nothing else is touched.
   ═══════════════════════════════════════════════ */

/* Section shell — dark, no longer the white .ca-section-light island. */
body.f8-tool-form .ca-tool-form-dark {
  background: transparent;
  color: var(--cloud);
}

/* The form "paper" — dark glass card to replace the old .bg-white card. */
body.f8-tool-form .ca-tool-card-dark {
  background: linear-gradient(180deg, rgba(13, 40, 71, 0.72) 0%, rgba(10, 31, 58, 0.86) 100%);
  border: var(--border-hairline) solid var(--border2);
  color: var(--cloud);
  box-shadow:
    inset 0 1px 0 var(--white-05),
    0 2rem 4rem -36px rgba(0, 0, 0, 0.70);
}

/* Headings / labels / helper copy inside the dark card. */
body.f8-tool-form .ca-tool-card-dark h2,
body.f8-tool-form .ca-tool-card-dark h3,
body.f8-tool-form .ca-tool-card-dark label,
body.f8-tool-form .ca-tool-card-dark legend {
  color: var(--cloud);
}

body.f8-tool-form .ca-tool-card-dark p,
body.f8-tool-form .ca-tool-card-dark small {
  color: var(--steel);
}

/* The Tailwind opacity-60 used on labels/help text was tuned for a
   light card; on dark glass it reads as muted steel — keep it readable. */
body.f8-tool-form .ca-tool-card-dark label.opacity-60,
body.f8-tool-form .ca-tool-card-dark .opacity-60,
body.f8-tool-form .ca-tool-card-dark .opacity-70 {
  opacity: 1;
  color: var(--steel);
}

body.f8-tool-form .ca-tool-card-dark label {
  opacity: 1;
}

/* Text / number / date inputs and selects — the old utility classes
   (bg-black/5 + border-black/10 + dark inherited text) assumed a white
   card. Override to dark glass with cloud text. */
body.f8-tool-form .ca-tool-card-dark input[type="text"],
body.f8-tool-form .ca-tool-card-dark input[type="number"],
body.f8-tool-form .ca-tool-card-dark input[type="date"],
body.f8-tool-form .ca-tool-card-dark input[type="email"],
body.f8-tool-form .ca-tool-card-dark select,
body.f8-tool-form .ca-tool-card-dark textarea {
  background: rgba(4, 14, 26, 0.55);
  border: var(--border-hairline) solid var(--border2);
  color: var(--cloud);
  -webkit-text-fill-color: var(--cloud);
}

body.f8-tool-form .ca-tool-card-dark input::placeholder,
body.f8-tool-form .ca-tool-card-dark textarea::placeholder {
  color: var(--mist);
  -webkit-text-fill-color: var(--mist);
  opacity: 1;
}

body.f8-tool-form .ca-tool-card-dark input:focus,
body.f8-tool-form .ca-tool-card-dark select:focus,
body.f8-tool-form .ca-tool-card-dark textarea:focus {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 1px var(--teal);
}

/* Native select dropdown options render with the OS palette; force a
   dark popup colour scheme so the option list is legible. */
body.f8-tool-form .ca-tool-card-dark select {
  color-scheme: dark;
}

/* Custom chevron for appearance-none selects (the utility removed the
   native arrow; on a dark field we add a light one). */
body.f8-tool-form .ca-tool-card-dark select.appearance-none {
  background-image: linear-gradient(45deg, transparent 50%, var(--steel) 50%),
                    linear-gradient(135deg, var(--steel) 50%, transparent 50%);
  background-position: calc(100% - 1.5rem) 1.6rem, calc(100% - 1.1rem) 1.6rem;
  background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
  background-repeat: no-repeat;
}

/* date input calendar glyph visible on dark. */
body.f8-tool-form .ca-tool-card-dark input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.6);
}

/* "How it works" mini explainer cards that used bg-black/5 inside the
   dark card flip to a faint light glass instead of near-invisible. */
body.f8-tool-form .ca-tool-card-dark [class*="bg-black/5"] {
  background: var(--white-04);
}

/* Reset button kept its white face; align radius already handled above. */
body.f8-tool-form .ca-tool-card-dark .tool-form-premium {
  box-shadow: none;
}
