/* ==========================================================
   Application Funnel Calculator
   Google-Material-inspired: blue page background, white elevated
   cards, soft shadows in place of heavy borders, generous spacing.
   ========================================================== */

:root {
  --afc-primary: #2563eb;
  --afc-primary-light: #3B82F6;
  --afc-primary-deep: #1d4ed8;
  --afc-primary-50: #eff6ff;
  --afc-primary-100: #dbeafe;
  --afc-primary-200: #bfdbfe;
  --afc-primary-700: #1d4ed8;
  --afc-ink: #0f172a;
  --afc-ink-soft: #334155;
  --afc-mute: #64748b;
  --afc-mute-soft: #94a3b8;
  --afc-surface: #ffffff;
  --afc-surface-2: #f8fafc;
  --afc-surface-3: #f1f5f9;
  --afc-border: #e2e8f0;
  --afc-border-soft: #f1f5f9;
  --afc-radius: 12px;
  --afc-radius-lg: 16px;
  --afc-radius-xl: 24px;

  --afc-good-bg: #ecfdf5;
  --afc-good-fg: #047857;
  --afc-good-bd: #a7f3d0;
  --afc-warn-bg: #fffbeb;
  --afc-warn-fg: #92400e;
  --afc-warn-bd: #fde68a;
  --afc-bad-bg: #fef2f2;
  --afc-bad-fg: #b91c1c;
  --afc-bad-bd: #fecaca;
  --afc-neutral-bg: #f1f5f9;
  --afc-neutral-fg: #334155;

  /* Material-style elevations */
  --afc-elev-1: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 6px rgba(15, 23, 42, .06);
  --afc-elev-2: 0 2px 4px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .08);
  --afc-elev-3: 0 4px 8px rgba(15, 23, 42, .04), 0 18px 40px rgba(15, 23, 42, .10);

  /* Tone palette */
  --tone-blue:        #2563eb;
  --tone-blue-deep:   #1d4ed8;
  --tone-blue-bg:     #eff6ff;
  --tone-blue-bd:     #bfdbfe;
  --tone-green:       #059669;
  --tone-green-deep:  #047857;
  --tone-green-bg:    #ecfdf5;
  --tone-green-bd:    #a7f3d0;
  --tone-amber:       #d97706;
  --tone-amber-deep:  #b45309;
  --tone-amber-bg:    #fffbeb;
  --tone-amber-bd:    #fde68a;
  --tone-violet:      #7c3aed;
  --tone-violet-deep: #6d28d9;
  --tone-violet-bg:   #f5f3ff;
  --tone-violet-bd:   #ddd6fe;
}

/* Page bg: soft blue gradient fading to white. Persistent through scroll
   so the tool feels like it's "in" a blue-accented Google product page. */
body.funnel-tool {
  background:
    radial-gradient(1100px 600px at 50% 0%, rgba(37, 99, 235, .14), transparent 70%),
    radial-gradient(900px 500px at 100% 30%, rgba(35, 206, 107, .07), transparent 65%),
    linear-gradient(180deg, #f0f5ff 0%, #f4f7fc 360px, #f8fafc 100%);
  background-attachment: fixed;
}


/* ==========================================================
   §1 BREADCRUMB
   ========================================================== */
.afc-breadcrumb {
  background: transparent;
  padding: 16px 1.25rem 0;
}
.afc-breadcrumb__inner {
  max-width: 1180px;
  margin: 0 auto;
  font-size: 13px;
  color: var(--afc-mute);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.afc-breadcrumb a {
  color: var(--afc-primary-700);
  font-weight: 600;
}
.afc-breadcrumb a:hover { text-decoration: underline; }
.afc-crumb-current { color: var(--afc-ink-soft); font-weight: 600; }


/* ==========================================================
   §2 HERO
   ========================================================== */
.afc-hero {
  position: relative;
  overflow: hidden;
  padding: 24px 1.25rem 16px;
  isolation: isolate;
}
.afc-hero__decor { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.afc-hero__blob {
  position: absolute;
  width: 400px; height: 400px;
  top: -160px; right: -100px;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  border-radius: 50%;
  filter: blur(80px);
  opacity: .15;
}
.afc-hero__grid { display: none; }

.afc-hero__inner {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.afc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--afc-primary-700);
  margin: 0 0 14px;
  background: none;
  border: 0;
  padding: 0;
  box-shadow: none;
}
.afc-eyebrow__dot {
  width: 6px; height: 6px;
  border-radius: 1px;
  background: var(--afc-primary);
  box-shadow: none;
}
.afc-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--afc-ink);
  margin: 0 0 10px;
  background: none;
  -webkit-text-fill-color: var(--afc-ink);
}
.afc-sub {
  color: var(--afc-ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 auto 12px;
  max-width: 720px;
}
.afc-trust {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 12px;
  font-size: 12px;
  color: var(--afc-mute);
  margin: 0 0 12px;
}
.afc-trust__sep { color: var(--afc-mute-soft); }

.afc-jump {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.afc-jump a {
  font-size: 13px;
  font-weight: 600;
  color: var(--afc-ink-soft);
  background: rgba(255, 255, 255, .85);
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 999px;
  padding: 6px 12px;
  transition: all .15s ease;
}
.afc-jump a:hover {
  color: var(--afc-primary-700);
  border-color: var(--afc-primary-200);
  background: #fff;
}


/* ==========================================================
   §3 MAIN
   ========================================================== */
.afc-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 1.25rem 40px;
}


/* ==========================================================
   §4 CALCULATOR — single unified block, two-column inside the form
   ========================================================== */
.afc-calc {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1380px;
  margin: 0 auto 56px;
}

/* Form is a vertical stack: chart on top, config bar below. */
.afc-form {
  background: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.afc-form::before { display: none; }


/* ==========================================================
   §4a CONFIG BAR (horizontal, boxed, sits below the chart)
   ========================================================== */
.afc-config {
  position: relative;
  padding: 16px 22px 14px;
  background: #fff;
  border-radius: var(--afc-radius-xl);
  box-shadow: var(--afc-elev-2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.afc-config::before { display: none; }

/* Each row: short title on the left, content (inputs/sliders) on the right */
.afc-config__row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--afc-border-soft);
}
.afc-config__row:last-of-type { border-bottom: 0; }
.afc-config__row-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--afc-primary-700);
}

/* Targeting row — 5 fields side by side */
.afc-config__targeting {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.afc-config__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.afc-config__field-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--afc-mute);
  letter-spacing: 0.3px;
}

/* Source mix row — 4 sliders side by side */
.afc-config__sliders {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.afc-config__sliders .afc-slider {
  /* Compact horizontal slider that fits in a narrow column */
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 8px;
  padding: 0;
}
.afc-config__sliders .afc-slider__name {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  color: var(--afc-mute);
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}
.afc-config__sliders .afc-slider__value {
  font-size: 12px;
  font-weight: 700;
  color: var(--afc-primary-700);
  text-align: right;
}

.afc-config__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  margin-top: 2px;
  border-top: 1px solid var(--afc-border-soft);
  flex-wrap: wrap;
}
.afc-config__actions {
  display: flex;
  gap: 10px;
}

@media (max-width: 880px) {
  .afc-config__row { grid-template-columns: 1fr; gap: 10px; }
  .afc-config__targeting { grid-template-columns: 1fr 1fr; }
  .afc-config__sliders { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .afc-config__targeting { grid-template-columns: 1fr; }
  .afc-config__sliders { grid-template-columns: 1fr; }
}

/* Funnel count row — 5 inputs side by side inside the config row */
.afc-counts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.afc-count {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
@media (max-width: 880px) {
  .afc-counts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .afc-counts { grid-template-columns: 1fr; }
}
.afc-count__name {
  font-size: 11px;
  font-weight: 700;
  color: var(--afc-mute);
  letter-spacing: 0.3px;
}
.afc-form .afc-count input,
.afc-form .afc-config__field input,
.afc-form .afc-config__field select {
  appearance: none;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--afc-ink);
  background: var(--afc-surface-2);
  border: 1.5px solid transparent;
  border-radius: 8px;
  text-align: left;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.afc-form .afc-count input { font-size: 15px; font-weight: 700; padding: 9px 12px; }
.afc-form .afc-config__field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 28px;
  background-color: var(--afc-surface-2);
}
.afc-form .afc-count input::placeholder { color: var(--afc-mute-soft); font-weight: 700; }
.afc-form .afc-count input:hover { background: #fff; border-color: var(--afc-border); }
.afc-form .afc-count input:focus {
  outline: none;
  background: #fff;
  border-color: var(--afc-primary);
  box-shadow: 0 0 0 3px var(--afc-primary-100);
}

.afc-setup__head {
  margin-bottom: 4px;
}
.afc-setup__eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--afc-primary-700);
  margin: 0 0 8px;
}
.afc-setup__head h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--afc-ink);
  margin: 0 0 8px;
  text-align: left;
  line-height: 1.2;
}
.afc-setup__head p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--afc-ink-soft);
  margin: 0;
}

.afc-setup__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.afc-setup__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--afc-ink);
  letter-spacing: -0.005em;
}
.afc-setup__hint {
  font-size: 12px;
  color: var(--afc-mute);
  line-height: 1.5;
  margin: -2px 0 4px;
}

.afc-setup__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.afc-setup__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}
.afc-setup__actions .afc-btn {
  width: 100%;
}


/* ==========================================================
   §4b GRAPH (right column) — sits directly on page bg, no box
   ========================================================== */
/* Chart row: narrow heading column on the left, chart on the right.
   Heading + description align at the top so the text reads as a column. */
.afc-graph {
  padding: 4px 12px 0 12px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.afc-graph__head {
  padding: 4px 0 0 4px;
}
.afc-graph__head h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--afc-ink);
  margin: 0 0 10px;
  text-align: left;
  line-height: 1.2;
}
.afc-graph__head p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--afc-ink-soft);
  margin: 0;
}
.afc-graph__canvas-wrap {
  position: relative;
  min-height: 280px;
  max-height: 340px;
}
.afc-graph__canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
@media (max-width: 880px) {
  .afc-graph { grid-template-columns: 1fr; gap: 14px; }
}

/* ==========================================================
   Vertical funnel chart: 6 trapezoid stages stacking top-to-bottom.
   Each stage uses CSS clip-path on a colored bar so the trapezoids
   join seamlessly (each stage's bottom width = next stage's top width).
   To the right of each bar sits the stage label + tag. The number
   input lives centered inside the colored bar.
   ========================================================== */
.afc-funnel {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 4px;
}

.afc-fs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 20px;
  align-items: stretch;
}

/* Single-hue progression: light blue at top → deep indigo at bottom.
   Each stage = one solid color. Together the six stages read as one
   smooth gradient theme. */
.afc-fs[data-tone="violet"] { --bar-c: #93C5FD; --bar-deep: #1E40AF; --bar-soft: #DBEAFE; }
.afc-fs[data-tone="blue"]   { --bar-c: #60A5FA; --bar-deep: #1E40AF; --bar-soft: #DBEAFE; }
.afc-fs[data-tone="cyan"]   { --bar-c: #3B82F6; --bar-deep: #1E40AF; --bar-soft: #DBEAFE; }
.afc-fs[data-tone="amber"]  { --bar-c: #2563EB; --bar-deep: #1E3A8A; --bar-soft: #DBEAFE; }
.afc-fs[data-tone="rose"]   { --bar-c: #1D4ED8; --bar-deep: #1E3A8A; --bar-soft: #BFDBFE; }
.afc-fs[data-tone="green"]  { --bar-c: #1E40AF; --bar-deep: #172554; --bar-soft: #BFDBFE; }

/* The trapezoid: full-width container, bar inside is clipped per --w-top/--w-bot. */
.afc-fs__bar {
  position: relative;
  height: 78px;
  background: var(--bar-c);
  clip-path: polygon(
    calc((100% - var(--w-top)) / 2) 0,
    calc(100% - (100% - var(--w-top)) / 2) 0,
    calc(100% - (100% - var(--w-bot)) / 2) 100%,
    calc((100% - var(--w-bot)) / 2) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter .15s ease;
}
.afc-fs:hover .afc-fs__bar { filter: brightness(1.05) saturate(1.1); }

/* Number input: white pill centered inside the colored bar. */
.afc-form .afc-fs__input {
  appearance: none;
  width: 96px;
  padding: 9px 8px;
  font-size: 26px;
  font-weight: 900;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--afc-ink);
  background: #fff;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .18);
  transition: border-color .12s, box-shadow .12s, transform .12s, width .12s;
}
.afc-form .afc-fs__input::placeholder {
  color: var(--afc-mute-soft);
  font-weight: 800;
}
.afc-form .afc-fs__input:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .22);
}
.afc-form .afc-fs__input:focus {
  outline: none;
  border-color: var(--bar-deep);
  box-shadow: 0 0 0 3px var(--bar-soft), 0 4px 12px rgba(15, 23, 42, .15);
}

/* Right-side info: stage tag + name + conversion-after-submit */
.afc-fs__info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.afc-fs__tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #fff;
  background: var(--bar-c);
  padding: 5px 10px;
  border-radius: 6px;
  width: fit-content;
}
.afc-fs__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--afc-ink);
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-top: 2px;
}
.afc-fs__conv {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--bar-deep);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.afc-fs__conv:empty { display: none; }


/* Responsive */
@media (max-width: 720px) {
  .afc-fs { grid-template-columns: minmax(0, 1fr) 140px; gap: 12px; }
  .afc-fs__bar { height: 70px; }
  .afc-form .afc-fs__input { width: 80px; font-size: 22px; padding: 8px; }
  .afc-fs__name { font-size: 12px; }
  .afc-fs__tag { font-size: 9px; padding: 4px 8px; letter-spacing: 1.2px; }
}
@media (max-width: 480px) {
  .afc-fs { grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; }
  .afc-form .afc-fs__input { width: 70px; font-size: 20px; }
}

/* Inputs — Google-Material style: filled, soft bg, no hard border */
.afc-form input[type="number"],
.afc-form input[type="text"],
.afc-form select {
  appearance: none;
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--afc-ink);
  background: var(--afc-surface-2);
  border: 1px solid transparent;
  border-radius: var(--afc-radius);
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.afc-form input::placeholder { color: var(--afc-mute-soft); }
.afc-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  background-color: var(--afc-surface-2);
}
.afc-form input:hover,
.afc-form select:hover {
  background: #fff;
  border-color: var(--afc-border);
}
.afc-form input:focus,
.afc-form select:focus {
  outline: none;
  background: #fff;
  border-color: var(--afc-primary);
  box-shadow: 0 0 0 3px var(--afc-primary-100);
}

/* Pills */
.afc-pillgroup { display: flex; flex-wrap: wrap; gap: 6px; }
.afc-pill { position: relative; cursor: pointer; user-select: none; }
.afc-pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.afc-pill span {
  display: inline-block;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--afc-ink-soft);
  background: var(--afc-surface-2);
  border: 1px solid transparent;
  border-radius: 999px;
  transition: all .12s ease;
}
.afc-pill:hover span {
  color: var(--afc-primary-700);
  background: var(--afc-primary-50);
}
.afc-pill input:checked + span {
  color: #fff;
  background: linear-gradient(90deg, #3B82F6 0%, #2563EB 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, .28);
}

/* Sliders — 3-column grid: name (left) | range (mid) | output (right). */
.afc-slider {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}
.afc-slider__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--afc-ink-soft);
}
.afc-slider input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--afc-primary-100), var(--afc-primary-200));
  border-radius: 999px;
  outline: none;
}
.afc-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--afc-primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .4);
  cursor: pointer;
}
.afc-slider input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--afc-primary);
  border: 3px solid #fff;
  cursor: pointer;
}
.afc-slider__value {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: var(--afc-primary-700);
  text-align: right;
}

.afc-mix-note {
  font-size: 12px;
  color: var(--afc-mute);
  margin: 10px 0 0;
}
.afc-mix-note.is-warn { color: var(--afc-warn-fg); }

/* Form actions */
.afc-form__actions {
  display: flex;
  gap: 10px;
  padding: 20px 28px 24px;
}
.afc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .12s, color .12s;
}
.afc-btn--primary {
  color: #fff;
  background: linear-gradient(90deg, #3B82F6 0%, #2563EB 100%);
  box-shadow: 0 6px 18px rgba(37, 99, 235, .26);
}
.afc-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(37, 99, 235, .35);
}
.afc-btn--ghost {
  color: var(--afc-ink-soft);
  background: var(--afc-surface-2);
}
.afc-btn--ghost:hover {
  background: var(--afc-primary-50);
  color: var(--afc-primary-700);
}


/* ==========================================================
   §5 RESULTS PANEL — sits below form, full width
   ========================================================== */
.afc-results {
  background: #fff;
  border-radius: var(--afc-radius-xl);
  padding: 32px;
  box-shadow: var(--afc-elev-2);
  position: relative;
  overflow: hidden;
}
.afc-results::before { display: none; }

/* Empty state */
.afc-empty {
  text-align: center;
  padding: 12px 0 4px;
}
.afc-empty__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--afc-primary-700);
  margin-bottom: 14px;
}
.afc-empty__badge svg {
  width: 18px; height: 18px;
  background: var(--afc-primary-50);
  border-radius: 6px;
  padding: 3px;
  box-sizing: content-box;
}
.afc-empty h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--afc-ink);
  margin: 0 0 10px;
  letter-spacing: -0.015em;
  text-align: center;
}
.afc-empty p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 auto 28px;
  max-width: 580px;
  color: var(--afc-ink-soft);
}
.afc-empty__features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  text-align: left;
}
.afc-empty__features li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--afc-ink-soft);
  background: var(--afc-surface-2);
  border-radius: var(--afc-radius);
  padding: 16px 14px;
  line-height: 1.4;
}
.afc-empty__feat-icon {
  display: inline-flex;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--afc-primary-700);
  background: var(--afc-primary-50);
  border-radius: 10px;
}
.afc-empty__feat-icon svg { width: 18px; height: 18px; }
@media (max-width: 720px) {
  .afc-empty__features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .afc-empty__features { grid-template-columns: 1fr; }
}

/* Score: huge number + solid status pill, no decoration */
.afc-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 0 28px;
  border-bottom: 1px solid var(--afc-border-soft);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.afc-score__num {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.afc-score__value {
  font-size: 5.5rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  color: var(--afc-ink);
}
.afc-score__suffix {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--afc-mute-soft);
  letter-spacing: -0.02em;
}
.afc-score__pill {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .4px;
  padding: 10px 18px;
  border-radius: 999px;
  color: #fff;
  white-space: nowrap;
  background: #94a3b8;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
}
.afc-score__pill--good { background: #059669; box-shadow: 0 6px 16px rgba(5, 150, 105, .25); }
.afc-score__pill--warn { background: #d97706; box-shadow: 0 6px 16px rgba(217, 119, 6, .25); }
.afc-score__pill--bad  { background: #dc2626; box-shadow: 0 6px 16px rgba(220, 38, 38, .25); }

/* Verdict: just a paragraph, no colored bg */
.afc-verdict {
  font-size: 15px;
  line-height: 1.6;
  color: var(--afc-ink-soft);
  margin: 0 0 18px;
}
.afc-verdict__title {
  color: var(--afc-ink);
  font-weight: 800;
}

/* Block titles inside results */
.afc-block-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--afc-mute);
  margin: 22px 0 10px;
  text-align: left;
  line-height: 1.3;
}

/* Funnel chart wrapper */
.afc-chart-wrap {
  background: var(--afc-surface-2);
  border-radius: var(--afc-radius-lg);
  padding: 18px 20px 14px;
  margin-bottom: 14px;
}
.afc-chart-wrap .afc-block-title { margin-top: 0; }
.afc-chart {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Custom horizontal funnel — centered tapered bars per stage,
   conversion rate arrows between. Each bar's width is proportional
   to count vs. the top stage. */
.afc-fnl__stage {
  display: flex;
  justify-content: center;
}
.afc-fnl__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.01em;
  min-width: 120px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
  transition: transform .15s ease;
}
.afc-fnl__bar:hover { transform: translateY(-1px); }
.afc-fnl__name {
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .15);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.afc-fnl__count {
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, .22);
  border-radius: 6px;
  padding: 2px 8px;
  flex: 0 0 auto;
}
.afc-fnl__conv {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 6px 0;
}
.afc-fnl__conv--good { color: var(--afc-good-fg); }
.afc-fnl__conv--warn { color: var(--afc-warn-fg); }
.afc-fnl__conv--bad  { color: var(--afc-bad-fg); }
.afc-fnl__conv svg { opacity: .7; }
.afc-fnl__drop {
  font-weight: 700;
  opacity: .6;
}

/* Weeks: single line of plain text, quiet */
.afc-weeks {
  font-size: 14px;
  line-height: 1.5;
  color: var(--afc-ink-soft);
  margin-bottom: 18px;
}
.afc-weeks__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--afc-mute);
  margin-right: 4px;
}
.afc-weeks strong {
  color: var(--afc-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Stage findings — compact monochrome rows, status as a small dot only */
.afc-stages {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
  border-top: 1px solid var(--afc-border-soft);
}
.afc-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--afc-border-soft);
  font-size: 14px;
}
.afc-stage__name {
  font-weight: 600;
  color: var(--afc-ink);
}
.afc-stage__rate {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--afc-ink);
}
.afc-stage__bench {
  font-size: 12px;
  color: var(--afc-mute);
  font-variant-numeric: tabular-nums;
}
.afc-stage__badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .3px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  background: #94a3b8;
  white-space: nowrap;
}
.afc-stage--good .afc-stage__badge { background: #059669; }
.afc-stage--warn .afc-stage__badge { background: #d97706; }
.afc-stage--bad  .afc-stage__badge { background: #dc2626; }

/* Action: CTA button + a small "Recommended reading" list of guides */
.afc-action {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 8px;
}
.afc-action__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #3B82F6 0%, #2563EB 100%);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .26);
  transition: transform .12s, box-shadow .12s;
}
.afc-action__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, .34);
  color: #fff;
}
/* Recommended reading: card-grid of clickable guide tiles.
   UX best practices: clear card affordance, document icon for context,
   directional arrow on the right, hover state lifts + tints + nudges
   the arrow as a microinteraction. */
.afc-action__guides {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}
.afc-action__guides-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0;
}
.afc-action__guides-label > span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--afc-mute);
  white-space: nowrap;
}
.afc-action__guides-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--afc-border) 0%, transparent 100%);
}
.afc-action__guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.afc-guide {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--afc-surface);
  border: 1px solid var(--afc-border-soft);
  border-radius: var(--afc-radius);
  color: var(--afc-ink);
  text-decoration: none;
  transition:
    border-color .18s ease,
    background .18s ease,
    transform .18s ease,
    box-shadow .18s ease;
}
.afc-guide:hover {
  border-color: var(--afc-primary-200);
  background: linear-gradient(135deg, #fff 0%, #f7faff 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, .12);
  color: var(--afc-ink);
}
.afc-guide:focus-visible {
  outline: none;
  border-color: var(--afc-primary);
  box-shadow: 0 0 0 3px var(--afc-primary-100);
}

.afc-guide__icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--afc-primary-50);
  color: var(--afc-primary-700);
  border-radius: 9px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.afc-guide__icon svg { width: 18px; height: 18px; }
.afc-guide:hover .afc-guide__icon {
  background: var(--afc-primary-100);
  transform: scale(1.05);
}

.afc-guide__label {
  flex: 1 1 auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--afc-ink);
  letter-spacing: -0.005em;
  line-height: 1.35;
  min-width: 0;
}

.afc-guide__arrow {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--afc-mute-soft);
  transition: transform .18s ease, color .18s ease;
}
.afc-guide__arrow svg { width: 16px; height: 16px; }
.afc-guide:hover .afc-guide__arrow {
  color: var(--afc-primary-700);
  transform: translateX(3px);
}


/* ==========================================================
   §6 CONTENT SECTIONS
   ========================================================== */
.afc-content {
  padding: 56px 0 16px;
  scroll-margin-top: 96px;
}
.afc-content--alt {
  /* No outer box — cards inside are the only boxes (no box-on-box). */
  background: none;
  backdrop-filter: none;
  box-shadow: none;
  padding: 56px 0 16px;
  margin: 0;
}
.afc-content__head {
  max-width: 760px;
  margin: 0 auto 36px;
  text-align: center;
}
.afc-content__eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--afc-primary-700);
  margin: 0 0 8px;
}
.afc-content__head h2 {
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--afc-ink);
  margin: 0 0 12px;
  line-height: 1.2;
  text-align: center;
}
.afc-content__head p {
  color: var(--afc-ink-soft);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

.afc-content__grid {
  display: grid;
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
}
.afc-content__grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.afc-content__grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.afc-content__card {
  background: #fff;
  border-radius: var(--afc-radius-lg);
  padding: 22px 22px 20px;
  box-shadow: var(--afc-elev-1);
  transition: transform .15s ease, box-shadow .15s ease;
}
.afc-content__card:hover {
  transform: translateY(-2px);
  box-shadow: var(--afc-elev-2);
}
.afc-content__card-num {
  display: inline-flex;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  border-radius: 10px;
  margin-bottom: 10px;
}
.afc-content__card-num[data-tone="blue"]   { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.afc-content__card-num[data-tone="green"]  { background: linear-gradient(135deg, #34d399, #059669); }
.afc-content__card-num[data-tone="amber"]  { background: linear-gradient(135deg, #fbbf24, #d97706); }
.afc-content__card-num[data-tone="violet"] { background: linear-gradient(135deg, #a78bfa, #7c3aed); }

.afc-content__card-icon {
  display: inline-flex;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-bottom: 12px;
}
.afc-content__card-icon svg { width: 22px; height: 22px; }
.afc-content__card-icon[data-tone="blue"]   { background: var(--tone-blue-bg);   color: var(--tone-blue-deep); }
.afc-content__card-icon[data-tone="green"]  { background: var(--tone-green-bg);  color: var(--tone-green-deep); }
.afc-content__card-icon[data-tone="amber"]  { background: var(--tone-amber-bg);  color: var(--tone-amber-deep); }
.afc-content__card-icon[data-tone="violet"] { background: var(--tone-violet-bg); color: var(--tone-violet-deep); }

.afc-content__card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--afc-ink);
  margin: 0 0 8px;
  text-align: left;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.afc-content__card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--afc-ink-soft);
  margin: 0;
}
.afc-content__card a {
  color: var(--afc-primary-700);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--afc-primary-200);
  text-underline-offset: 2px;
  transition: color .12s, text-decoration-color .12s;
}
.afc-content__card a:hover {
  color: var(--afc-primary);
  text-decoration-color: var(--afc-primary);
}


/* ==========================================================
   §7 STAGE FIXES
   ========================================================== */
.afc-fixes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto;
}
.afc-fix {
  background: #fff;
  border-radius: var(--afc-radius-xl);
  padding: 26px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--afc-elev-1);
  transition: transform .15s ease, box-shadow .15s ease;
}
.afc-fix:hover {
  transform: translateY(-3px);
  box-shadow: var(--afc-elev-3);
}
.afc-fix::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--fix-grad-a), var(--fix-grad-b));
}
.afc-fix[data-tone="blue"]   { --fix-grad-a: #60a5fa; --fix-grad-b: #1d4ed8; }
.afc-fix[data-tone="green"]  { --fix-grad-a: #34d399; --fix-grad-b: #047857; }
.afc-fix[data-tone="amber"]  { --fix-grad-a: #fbbf24; --fix-grad-b: #b45309; }
.afc-fix[data-tone="violet"] { --fix-grad-a: #a78bfa; --fix-grad-b: #6d28d9; }

.afc-fix__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.afc-fix__num {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--fix-grad-a), var(--fix-grad-b));
  padding: 5px 11px;
  border-radius: 6px;
}
.afc-fix__head h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--afc-ink);
  margin: 0;
  text-align: left;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.afc-fix__tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-left: auto;
}
.afc-fix[data-tone="blue"]   .afc-fix__tag { color: var(--tone-blue-deep);   background: var(--tone-blue-bg); }
.afc-fix[data-tone="green"]  .afc-fix__tag { color: var(--tone-green-deep);  background: var(--tone-green-bg); }
.afc-fix[data-tone="amber"]  .afc-fix__tag { color: var(--tone-amber-deep);  background: var(--tone-amber-bg); }
.afc-fix[data-tone="violet"] .afc-fix__tag { color: var(--tone-violet-deep); background: var(--tone-violet-bg); }

.afc-fix__lead {
  font-size: 14px;
  line-height: 1.6;
  color: var(--afc-ink-soft);
  margin: 0 0 14px;
  font-style: italic;
}
.afc-fix__list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.afc-fix__list li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--afc-ink-soft);
  padding-left: 22px;
  position: relative;
}
.afc-fix__list li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--fix-grad-b);
}
.afc-fix__list li strong {
  color: var(--afc-ink);
  font-weight: 700;
}
.afc-fix__cta {
  font-size: 14px;
  font-weight: 700;
  color: var(--afc-primary-700);
  display: inline-block;
  padding: 4px 0;
  transition: color .15s ease;
}
.afc-fix__cta:hover {
  color: var(--afc-primary);
  text-decoration: underline;
}


/* ==========================================================
   §8 FAQ
   ========================================================== */
.afc-faq {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.afc-faq__item {
  background: #fff;
  border-radius: var(--afc-radius-lg);
  overflow: hidden;
  box-shadow: var(--afc-elev-1);
  transition: box-shadow .15s ease;
}
.afc-faq__item[open] { box-shadow: var(--afc-elev-2); }
.afc-faq__item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--afc-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color .15s ease;
}
.afc-faq__item summary::-webkit-details-marker { display: none; }
.afc-faq__item summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 400;
  color: var(--afc-primary);
  transition: transform .15s ease;
  flex: 0 0 auto;
}
.afc-faq__item[open] summary::after { content: "−"; }
.afc-faq__item summary:hover { color: var(--afc-primary-700); }
.afc-faq__body { padding: 0 20px 18px; }
.afc-faq__body p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--afc-ink-soft);
  margin: 0;
}


/* ==========================================================
   §9 RELATED TOOLS
   ========================================================== */
.afc-related {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  max-width: 1080px;
  margin: 0 auto;
}
.afc-related__card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border-radius: var(--afc-radius-lg);
  padding: 22px;
  box-shadow: var(--afc-elev-1);
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
  overflow: hidden;
  color: var(--afc-ink);
}
.afc-related__card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
}
.afc-related__card[data-tone="blue"]::before   { background: linear-gradient(90deg, #60a5fa, #1d4ed8); }
.afc-related__card[data-tone="green"]::before  { background: linear-gradient(90deg, #34d399, #047857); }
.afc-related__card[data-tone="amber"]::before  { background: linear-gradient(90deg, #fbbf24, #b45309); }
.afc-related__card[data-tone="violet"]::before { background: linear-gradient(90deg, #a78bfa, #6d28d9); }
.afc-related__card:hover {
  transform: translateY(-3px);
  box-shadow: var(--afc-elev-3);
  color: var(--afc-ink);
}

.afc-related__icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.afc-related__icon svg { width: 22px; height: 22px; }
.afc-related__icon[data-tone="blue"]   { background: var(--tone-blue-bg);   color: var(--tone-blue-deep); }
.afc-related__icon[data-tone="green"]  { background: var(--tone-green-bg);  color: var(--tone-green-deep); }
.afc-related__icon[data-tone="amber"]  { background: var(--tone-amber-bg);  color: var(--tone-amber-deep); }
.afc-related__icon[data-tone="violet"] { background: var(--tone-violet-bg); color: var(--tone-violet-deep); }

.afc-related__card h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--afc-ink);
  margin: 0;
  text-align: left;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.afc-related__card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--afc-ink-soft);
  margin: 0;
  flex: 1;
}
.afc-related__cta {
  font-size: 13px;
  font-weight: 700;
  color: var(--afc-primary-700);
  margin-top: auto;
  padding-top: 4px;
}


/* ==========================================================
   §10 DISCLAIMER
   ========================================================== */
.afc-disclaimer {
  font-size: 12px;
  color: var(--afc-mute);
  line-height: 1.6;
  text-align: center;
  max-width: 760px;
  margin: 32px auto 0;
  padding: 16px 20px;
  background: rgba(255, 255, 255, .6);
  border-radius: var(--afc-radius);
}
.afc-disclaimer strong { color: var(--afc-ink-soft); }


/* ==========================================================
   §11 RESPONSIVE
   ========================================================== */
@media (max-width: 720px) {
  .afc-hero { padding: 28px 1rem 22px; }
  .afc-section { padding: 20px 20px 14px; }
  .afc-form__actions { padding: 16px 20px 20px; }
  .afc-results { padding: 22px; }
  .afc-calc { gap: 16px; }
  .afc-content { padding: 44px 0 12px; }
  .afc-content--alt { padding: 36px 18px 16px; }
  .afc-fixes { gap: 14px; }
}
