/* Public homepage (app/views/home/index.php) */

body.tf-home {
  margin: 0;
  /* The app shell paints body grey with !important; the homepage sits on white */
  background-color: var(--tf-surface) !important;
  color: var(--tf-text);
  font-family: var(--tf-font);
  font-size: 16px;
  line-height: 1.6;
}

.tfh-container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.tfh-skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 0;
  background: var(--tf-ink);
  color: var(--tf-surface);
  font-weight: 600;
}

.tfh-skip:focus { top: 12px; color: var(--tf-surface); }

/* Band above the header: what TestFlow is, and the languages */
.tfh-band { background: var(--tf-palette-5); }
.tfh-band-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  min-height: 48px;
}
.tfh-band-text {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #FFFFFF;
}
.tfh-band-text > span { width: 10px; height: 10px; flex-shrink: 0; background: var(--tf-palette-4); }
.tfh-langs { display: flex; align-items: center; }
.tfh-langs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--tf-palette-2);
  text-decoration: none;
}
.tfh-langs a:hover { color: #FFFFFF; }
.tfh-langs a[aria-current="true"] { font-weight: 700; color: #FFFFFF; box-shadow: inset 0 -3px 0 var(--tf-palette-4); }

/* Header */
.tfh-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--tf-surface) 94%, transparent);
  border-bottom: 1px solid var(--tf-divider);
  backdrop-filter: blur(8px);
}

.tfh-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 40px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.tfh-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--tf-ink);
  text-decoration: none;
}

.tfh-brand:hover { color: var(--tf-ink); }


/* Underlined words in the homepage title */
.tfh-underline {
  text-decoration-line: underline;
  text-decoration-color: var(--tf-palette-4);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.14em;
  text-decoration-skip-ink: none;
}

.tfh-nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 28px;
}

.tfh-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--tf-text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.tfh-nav-link:hover { color: var(--tf-accent); }
.tfh-nav-mobile { display: none; }

/* Sign in and Create an account, on the right */
.tfh-header-actions {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.tfh-header-actions .btn { min-height: 44px; display: inline-flex; align-items: center; }
.tfh-signin {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--tf-border-strong);
  color: var(--tf-ink);
  font-weight: 600;
  text-decoration: none;
}
.tfh-signin:hover { color: var(--tf-ink); border-color: var(--tf-ink); }

/* Type */
.tfh-eyebrow {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--tf-muted);
}

.tfh-h1 {
  max-width: 15ch;
  margin: 0;
  font-family: var(--tf-font-display);
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--tf-ink);
}

.tfh-h2 {
  margin: 0;
  font-family: var(--tf-font-display);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--tf-ink);
}

.tfh-h2-sm { font-size: clamp(30px, 3.4vw, 40px); }
.tfh-narrow { max-width: 20ch; }

.tfh-h3 {
  margin: 0 0 10px;
  font-family: var(--tf-font);
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--tf-ink);
}

.tfh-lead {
  margin: 0;
  max-width: 38rem;
  font-size: 20px;
  line-height: 1.55;
  color: var(--tf-muted);
}

.tfh-lead-sm { font-size: 18px; }
.tfh-lead > p { margin: 0; }
.tfh-lead > p + p { margin-top: 12px; }
.tfh-muted { margin: 0; color: var(--tf-muted); }
.tfh-small { margin: 0; font-size: 14px; color: var(--tf-muted); }
.tfh-small a { color: var(--tf-ink); font-weight: 600; }

.tfh-caption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--tf-muted);
}

/* Hero */
.tfh-hero { padding-top: 96px; }

.tfh-hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px 64px;
  margin-top: 28px;
}

.tfh-hero-row .tfh-lead { flex: 1 1 420px; }

.tfh-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tfh-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tfh-showcase {
  margin: 64px 0 0;
  padding: 32px;
  border-radius: 0;
  background: var(--tf-bg);
}

.tfh-showcase-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px;
}

.tfh-showcase-main { flex: 2 1 520px; min-width: 0; }

.tfh-showcase-side {
  flex: 1 1 240px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tfh-side-note {
  margin: 0;
  font-size: 15px;
  color: var(--tf-muted);
}

.tfh-side-note strong {
  display: block;
  color: var(--tf-ink);
}

/* Screenshots and markers */
.tfh-shot {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--tf-border);
  border-radius: 0;
  background: #FFFFFF;
}

.tfh-shot img {
  display: block;
  width: 100%;
  height: auto;
}

.tfh-shot-raised { box-shadow: 0 20px 48px rgba(16, 24, 40, 0.10); }

.tfh-pin,
.tfh-note b,
.tfh-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--tf-ink);
  color: var(--tf-surface);
  font-weight: 700;
}

.tfh-pin {
  position: absolute;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  font-size: 13px;
  box-shadow: 0 0 0 3px #FFFFFF;
}

.tfh-note {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 0;
}

.tfh-note b {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.tfh-note strong { color: var(--tf-ink); }

.tfh-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px 32px;
  margin: 8px 0 24px;
}

/* Sections */
.tfh-section { padding-top: 136px; }
.tfh-section-last { padding-bottom: 112px; }

.tfh-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 48px;
}

.tfh-section-head > div { max-width: 44rem; }
.tfh-section-head > .tfh-section-head-wide { max-width: none; }
/* "One study, from the first question to the next design change" fits on one line on desktop */
@media (min-width: 992px) {
  .tfh-section-head-wide .tfh-h2 { font-size: min(42px, 2.85vw); }
}

.tfh-example-tag {
  margin: 0;
  padding: 6px 12px;
  border: 1px dashed var(--tf-border-strong);
  border-radius: 0;
  font-size: 14px;
  color: var(--tf-muted);
}

/* Example study */
.tfh-track {
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--tf-border);
}

.tfh-step {
  position: relative;
  padding: 0 0 72px 48px;
}

.tfh-step:last-child { padding-bottom: 0; }

.tfh-step-num {
  position: absolute;
  left: -17px;
  top: 0;
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.tfh-step-num-accent { background: var(--tf-accent); color: var(--tf-on-accent); }

.tfh-step-label {
  margin: 2px 0 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tf-muted);
}

.tfh-quote {
  max-width: 46rem;
  margin: 0 0 16px;
  font-family: var(--tf-font-display);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--tf-ink);
}

.tfh-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px;
  margin-top: 8px;
}

.tfh-pair figure { margin: 0; min-width: 0; }
.tfh-pair-a { flex: 1 1 400px; }
.tfh-pair-b { flex: 1.4 1 480px; }

/* Benefits */
.tfh-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 0 32px;
  margin-top: 48px;
  border-top: 2px solid var(--tf-ink);
}

.tfh-benefits article { padding-top: 28px; }
.tfh-benefits-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

.tfh-also {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 48px;
  margin-top: 64px;
  padding: 28px 32px;
  border-radius: 0;
  background: var(--tf-bg);
}

.tfh-also-title {
  flex: 0 0 200px;
  margin: 0;
  font-weight: 600;
  color: var(--tf-ink);
}

.tfh-also ul {
  flex: 1 1 520px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 10px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

/* AI */
.tfh-ai {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 64px;
}

.tfh-ai-intro { flex: 1 1 320px; min-width: 0; }
.tfh-ai-intro .tfh-muted { margin-top: 14px; }

.tfh-ai-table {
  flex: 2 1 560px;
  min-width: 0;
  border-collapse: collapse;
  border-top: 1px solid var(--tf-border-strong);
}

.tfh-ai-table th,
.tfh-ai-table td {
  padding: 18px 16px 18px 0;
  border-bottom: 1px solid var(--tf-border);
  vertical-align: top;
  text-align: left;
}

.tfh-ai-table thead th {
  font-size: 14px;
  font-weight: 600;
  color: var(--tf-muted);
}

.tfh-ai-table tbody th {
  width: 150px;
  font-weight: 600;
  color: var(--tf-ink);
}

/* Data in the EU: a dark panel with three cards */
.tfh-eu {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 56px;
  background: var(--tf-palette-5);
  color: var(--tf-palette-1);
}
.tfh-eu-intro { max-width: 46rem; }
.tfh-eu .tfh-eyebrow { margin-bottom: 12px; color: var(--tf-palette-2); }
.tfh-eu .tfh-h2 { font-size: clamp(32px, 3.6vw, 44px); color: #FFFFFF; }
.tfh-eu-lead { margin: 16px 0 0; font-size: 18px; }
.tfh-eu-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}
.tfh-eu-cards article {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid #34598F;
  background: #23457E;
}
.tfh-eu-cards h3 { margin: 0; font-size: 20px; font-weight: 600; color: #FFFFFF; }
.tfh-eu-cards p { margin: 0; }
.tfh-eu-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tf-palette-2);
  color: var(--tf-palette-5);
}

/* Getting started */
.tfh-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 64px;
  padding: 56px;
  border: 1px solid var(--tf-border);
  border-radius: 0;
  background: #EEF4FB;
}
[data-bs-theme=dark] .tfh-cta { background: var(--tf-surface-2); }

.tfh-cta-main { flex: 1 1 360px; min-width: 0; }
.tfh-cta-main .tfh-lead { margin: 16px 0 28px; }
.tfh-cta-steps { flex: 1 1 400px; min-width: 0; }
.tfh-cta-steps .tfh-also-title { margin-bottom: 16px; }

.tfh-cta-steps ol {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Footer */
.tfh-footer { border-top: 1px solid var(--tf-divider); }

.tfh-footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 32px;
  padding-top: 48px;
}

.tfh-footer-heading {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tf-ink);
}

.tfh-footer-cols ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.tfh-footer-cols a { color: var(--tf-muted); text-decoration: none; overflow-wrap: anywhere; }
.tfh-footer-cols a:hover { color: var(--tf-accent); }

.tfh-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: 14px;
  color: var(--tf-muted);
}

.tfh-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tfh-footer-links a { color: var(--tf-text); text-decoration: none; }
.tfh-footer-links a:hover { color: var(--tf-accent); }

/* Public site pages (product, how it works, use cases, pricing, text pages) */
.tfh-nav-link[aria-current="page"] { color: var(--tf-ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

.tfh-hero-page { padding-top: 72px; }
.tfh-h1-page { max-width: 20ch; font-size: clamp(36px, 5vw, 60px); }
.tfh-section-tight { padding-top: 64px; }
.tfh-mt { margin-top: 14px; }
.tfh-mt-lg { margin-top: 32px; }
.tfh-measure { max-width: 46rem; }
.tfh-eyebrow a { color: inherit; }

.tfh-h4 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--tf-ink);
}

.tfh-more {
  font-weight: 600;
  color: var(--tf-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.tfh-more::after { content: " →"; }
.tfh-more:hover { color: var(--tf-accent); }

.tfh-quote-sm { font-size: clamp(20px, 2.4vw, 26px); }

/* Ticked lists */
.tfh-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.tfh-checks li {
  position: relative;
  padding-left: 26px;
}

.tfh-checks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--tf-accent);
  border-bottom: 2px solid var(--tf-accent);
  transform: rotate(-45deg);
}

.tfh-numbered {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 16px;
  padding-left: 22px;
}

/* Four steps and four feature groups */
.tfh-steps4,
.tfh-groups,
.tfh-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 32px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}

.tfh-steps4 li { padding-top: 20px; border-top: 2px solid var(--tf-ink); }
.tfh-steps4 .tfh-step-num { width: 32px; height: 32px; margin-bottom: 16px; font-size: 14px; }

.tfh-group {
  padding: 24px;
  border-radius: 0;
  background: var(--tf-bg);
}

.tfh-group .tfh-h4 { margin-bottom: 14px; }
.tfh-features { margin-top: 40px; }
.tfh-features article { padding-top: 16px; border-top: 1px solid var(--tf-border-strong); }

/* Cards */
.tfh-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 24px;
  margin-top: 48px;
}

.tfh-card {
  padding: 28px;
  border: 1px solid var(--tf-border);
  border-radius: 0;
  background: var(--tf-surface);
}

.tfh-card > .tfh-muted { margin-bottom: 18px; }
.tfh-card .tfh-section-head { margin-bottom: 12px; align-items: center; }
.tfh-card .tfh-section-head .tfh-step-label { margin: 0; }

/* Offer summary on the homepage */
.tfh-offer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
  margin-top: 40px;
}

.tfh-offer-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  border: 1px solid var(--tf-border);
  border-radius: 0;
  color: var(--tf-text);
  text-decoration: none;
}

.tfh-offer-item:hover { border-color: var(--tf-ink); color: var(--tf-text); }
.tfh-offer-name { font-weight: 600; color: var(--tf-ink); }

.tfh-offer-price {
  font-family: var(--tf-font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--tf-ink);
}

/* Questions */
.tfh-faq {
  max-width: 52rem;
  margin-top: 32px;
  border-top: 1px solid var(--tf-border-strong);
}

.tfh-faq details { border-bottom: 1px solid var(--tf-border); }

.tfh-faq summary {
  position: relative;
  padding: 20px 40px 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--tf-ink);
  cursor: pointer;
  list-style: none;
}

.tfh-faq summary::-webkit-details-marker { display: none; }

.tfh-faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 16px;
  font-size: 24px;
  font-weight: 400;
  color: var(--tf-muted);
}

.tfh-faq details[open] summary::after { content: "−"; }
.tfh-faq summary:focus-visible { outline: 2px solid var(--tf-accent); outline-offset: 4px; }
.tfh-faq details p { margin: 0 0 20px; max-width: 46rem; color: var(--tf-muted); }

/* Tables on text-heavy pages */
.tfh-table {
  width: 100%;
  margin-top: 32px;
  border-collapse: collapse;
  border-top: 1px solid var(--tf-border-strong);
}

.tfh-table th,
.tfh-table td {
  padding: 16px 20px 16px 0;
  border-bottom: 1px solid var(--tf-border);
  text-align: left;
  vertical-align: top;
}

.tfh-table thead th { font-size: 14px; font-weight: 600; color: var(--tf-muted); }
.tfh-table tbody th { width: 140px; color: var(--tf-ink); }

/* How it works */
.tfh-review {
  margin: 24px 0;
  padding: 24px;
  border-left: 3px solid var(--tf-accent);
  border-radius: 0;
  background: var(--tf-bg);
}

/* Use cases */
.tfh-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.tfh-jump a {
  padding: 8px 16px;
  border: 1px solid var(--tf-border-strong);
  border-radius: 0;
  color: var(--tf-ink);
  font-weight: 500;
  text-decoration: none;
}

.tfh-jump a:hover { border-color: var(--tf-ink); }

.tfh-case {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 64px;
  margin-top: 40px;
}

.tfh-case-main { flex: 3 1 480px; min-width: 0; }

.tfh-case-side {
  flex: 2 1 300px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.tfh-case-side .tfh-also-title { flex: none; margin: 0; }
.tfh-case-feature { padding-top: 14px; border-top: 1px solid var(--tf-border); align-self: stretch; }
.tfh-also-body { flex: 1 1 420px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

/* Pricing */
.tfh-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 20px;
  align-items: stretch;
}

.tfh-plan {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--tf-border);
  border-radius: 0;
  background: var(--tf-surface);
}

.tfh-plan .tfh-h3 { margin: 0; }
.tfh-plan .tfh-checks { flex: 1; }
.tfh-plan .btn { align-self: stretch; }
.tfh-plan-featured { border: 2px solid var(--tf-ink); box-shadow: 0 20px 48px rgba(16, 24, 40, 0.08); }
.tfh-plan-students { background: var(--tf-bg); border-style: dashed; }

.tfh-plan-price { display: flex; align-items: baseline; gap: 8px; margin: 0; }

.tfh-plan-amount {
  font-family: var(--tf-font-display);
  font-size: 40px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tf-ink);
}

.tfh-plan-amount-sm { font-size: 24px; line-height: 1.2; }

/* Billing period switch: yearly (default) or monthly. The cards carry both prices and links;
   only the chosen period's are shown. */
.tfh-billing {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 32px;
  padding: 4px;
  border: 1px solid var(--tf-border-strong);
  background: var(--tf-surface);
}

.tfh-billing input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.tfh-billing label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-weight: 600;
  color: var(--tf-text);
  cursor: pointer;
}

.tfh-billing input:checked + label { background: var(--tf-accent); color: var(--tf-on-accent); }
.tfh-billing input:focus-visible + label { outline: 2px solid var(--tf-accent); outline-offset: 2px; }

.tfh-billing-save {
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  background: var(--tf-palette-1);
  color: var(--tf-palette-5);
}

.tfh-plan-billing { margin: 8px 0 0; }

.tfh-when-monthly { display: none; }
.tfh-pricing:has(#billing-monthly:checked) .tfh-when-yearly { display: none; }
.tfh-pricing:has(#billing-monthly:checked) .tfh-when-monthly { display: block; }

.tfh-contact-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  margin-top: 40px;
  padding: 28px 32px;
  border-radius: 0;
  background: var(--tf-surface-2);
  border: 1px solid var(--tf-border);
}

.tfh-contact-box > div { flex: 1 1 420px; }

/* Student application */
.tfh-apply {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 64px;
}

.tfh-apply-info { flex: 1 1 320px; min-width: 0; }

.tfh-apply-info ol {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tfh-apply-form {
  flex: 1.3 1 420px;
  min-width: 0;
  padding: 32px;
  border: 1px solid var(--tf-border);
  border-radius: 0;
  background: var(--tf-surface);
}

.tfh-form { display: flex; flex-direction: column; gap: 20px; }
.tfh-form fieldset { margin: 0; padding: 0; border: 0; }
.tfh-form .form-check { margin-bottom: 6px; }
/* The theme fades unchecked labels; here they are choices to read, not disabled options */
.tfh-form .form-check-label { color: var(--tf-text); opacity: 1; }
.tfh-form .form-check-input { opacity: 1; }
.tfh-field-hint { margin: 6px 0 0; font-size: 14px; color: var(--tf-muted); }
.tfh-field-error { margin: 6px 0 0; font-size: 14px; font-weight: 500; color: var(--tf-danger); }

/* Contact form: topic chips; the fields of the chosen topic show (CSS only) */
.tfh-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.tfh-chips input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.tfh-chips label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--tf-border-strong);
  background: var(--tf-surface);
  color: var(--tf-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tfh-chips input:checked + label { background: var(--tf-accent); border-color: var(--tf-accent); color: var(--tf-on-accent); }
.tfh-chips input:focus-visible + label { outline: 2px solid var(--tf-accent); outline-offset: 2px; }

.tfh-when-sales, .tfh-when-support, .tfh-when-billing, .tfh-when-partner, .tfh-when-press { display: none; }
.tfh-contact:has(#ct-topic-sales:checked) .tfh-when-sales,
.tfh-contact:has(#ct-topic-support:checked) .tfh-when-support,
.tfh-contact:has(#ct-topic-billing:checked) .tfh-when-billing,
.tfh-contact:has(#ct-topic-partner:checked) .tfh-when-partner,
.tfh-contact:has(#ct-topic-press:checked) .tfh-when-press { display: block; }
.tfh-contact:has(#ct-topic-sales:checked) .tfh-form-row.tfh-when-sales { display: grid; }

.tfh-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 20px;
}

.tfh-sent {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 32px;
  border: 1px solid var(--tf-palette-2);
  background: var(--tf-accent-soft);
}

.tfh-sent .tfh-h3 { margin: 0; }

.tfh-sent-icon,
.tfh-contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tfh-sent-icon { width: 48px; height: 48px; background: var(--tf-accent); color: var(--tf-on-accent); }
.tfh-contact-icon { width: 40px; height: 40px; background: var(--tf-accent-soft); color: var(--tf-accent); }

.tfh-apply-info .tfh-card + .tfh-card { margin-top: 16px; }
.tfh-contact-way { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; }
.tfh-contact-way strong { color: var(--tf-ink); }

.tfh-card-dark { background: var(--tf-palette-5); border-color: var(--tf-palette-5); color: var(--tf-palette-1); }
.tfh-card-dark .tfh-h4 { color: #FFFFFF; }
.tfh-card-dark p { margin: 0 0 12px; }
.tfh-card-dark .tfh-more { color: #FFFFFF; }

/* Text pages */
.tfh-prose-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 32px 64px;
}

.tfh-toc {
  flex: 0 1 240px;
  position: sticky;
  top: 96px;
}

.tfh-toc ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.tfh-toc a { color: var(--tf-muted); text-decoration: none; }
.tfh-toc a:hover { color: var(--tf-accent); }

.tfh-prose { flex: 1 1 520px; min-width: 0; max-width: 46rem; }
.tfh-prose section { scroll-margin-top: 96px; }
.tfh-prose section + section { margin-top: 40px; }
.tfh-prose p { margin: 0 0 14px; color: var(--tf-text); }
.tfh-prose a { color: var(--tf-ink); font-weight: 600; }

/* Menu button: small screens only */
.tfh-menu-toggle {
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--tf-border-strong);
  background: var(--tf-surface);
  color: var(--tf-ink);
}

.tfh-menu-toggle > span { display: inline-flex; }
.tfh-menu-toggle > .tfh-menu-close,
.tfh-header.is-open .tfh-menu-toggle > .tfh-menu-open { display: none; }
.tfh-header.is-open .tfh-menu-toggle > .tfh-menu-close { display: inline-flex; }

/* Small screens */
@media (max-width: 991.98px) {
  .tfh-header-inner { padding-top: 10px; padding-bottom: 10px; min-height: 64px; }
  .tfh-has-menu .tfh-menu-toggle:not([hidden]) { display: inline-flex; }

  /* The links fold into a full-width panel under the logo bar */
  .tfh-nav {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 4px 0 12px;
  }
  .tfh-has-menu:not(.is-open) .tfh-nav { display: none; }
  .tfh-nav-link {
    display: flex;
    align-items: center;
    min-height: 52px;
    border-bottom: 1px solid var(--tf-divider);
    font-size: 16px;
    font-weight: 600;
    color: var(--tf-ink);
  }
  .tfh-nav-link[aria-current="page"] { text-decoration: none; box-shadow: inset 3px 0 0 var(--tf-accent); padding-left: 12px; }
  .tfh-nav-mobile { display: flex; }
  .tfh-header-actions { flex-direction: column; align-items: stretch; gap: 10px; margin: 16px 0 0; }
  .tfh-header-actions .tfh-signin,
  .tfh-header-actions .btn { justify-content: center; min-height: 48px; }

  /* Band: the sentence, then the languages under it */
  .tfh-band-inner { padding-top: 10px; gap: 2px 0; }
  .tfh-band-text { align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.4; }
  .tfh-band-text > span { width: 8px; height: 8px; margin-top: 6px; }
  .tfh-langs { flex-basis: 100%; margin-left: 10px; }
  .tfh-header.is-open .tfh-nav { max-height: calc(100vh - 64px); overflow-y: auto; }
}

@media (max-width: 575.98px) {
  .tfh-hero { padding-top: 56px; }
  .tfh-section { padding-top: 88px; }
  .tfh-showcase { padding: 16px; margin-top: 40px; }
  .tfh-step { padding-left: 32px; padding-bottom: 56px; }
  .tfh-cta { padding: 28px 20px; }
  .tfh-also { padding: 20px; }
  .tfh-pin { width: 22px; height: 22px; margin: -11px 0 0 -11px; font-size: 11px; }
  /* The two-column comparison becomes one block per moment */
  .tfh-ai-table,
  .tfh-ai-table tbody,
  .tfh-ai-table tr,
  .tfh-ai-table th,
  .tfh-ai-table td { display: block; width: auto; }
  .tfh-ai-table thead { display: none; }
  .tfh-ai-table tbody tr { padding: 16px 0; border-bottom: 1px solid var(--tf-border); }
  .tfh-ai-table tbody th,
  .tfh-ai-table td { padding: 0; border: 0; }
  .tfh-ai-table tbody th { width: auto; margin-bottom: 8px; }
  .tfh-ai-table td + td { margin-top: 8px; }
  .tfh-hero-page { padding-top: 48px; }
  .tfh-section-tight { padding-top: 40px; }
  .tfh-apply-form { padding: 20px; }
  .tfh-plan, .tfh-card, .tfh-contact-box { padding: 20px; }
  .tfh-toc { position: static; flex-basis: 100%; }
  .tfh-table thead { display: none; }
  .tfh-table, .tfh-table tbody, .tfh-table tr, .tfh-table th, .tfh-table td { display: block; width: auto; }
  .tfh-table tr { padding: 14px 0; border-bottom: 1px solid var(--tf-border); }
  .tfh-table th, .tfh-table td { padding: 0 0 6px; border: 0; }
  .tfh-table td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--tf-muted); }
  .tfh-table td[data-label] { padding-bottom: 10px; }
  .tfh-ai-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--tf-muted);
  }
}
