/* ============================================================================
   caller-id-tool.css — Caller ID Testing tool and its results pages
   ----------------------------------------------------------------------------
   The hero + lookup form on /caller-id-testing is intentionally hand-built
   (not templates/partials/components.html) because it drives client-side JS
   that calls an outbound reputation-lookup API and posts to HubSpot — a
   one-off widget, not a reusable content pattern. Everything else on these
   pages uses the shared component macros. Builds on brand.css tokens and the
   sitewide .form/.field/.input primitives.
   ========================================================================== */

.cid-hero {
  position: relative;
  overflow: clip;
  padding-block: clamp(3rem, 6vw, 5.5rem);
  background:
    radial-gradient(120% 120% at 85% -10%, rgba(53, 116, 227, 0.10), transparent 60%),
    linear-gradient(180deg, #f7faff 0%, #ffffff 70%);
  border-bottom: 1px solid var(--c-border);
}

.cid-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.cid-hero__copy h1 { font-size: clamp(2.2rem, 5.2vw, 3.4rem); max-width: 18ch; }
.cid-hero__copy .lede { max-width: 44ch; }

.cid-hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  list-style: none;
  margin: var(--space-8) 0 0;
  padding: 0;
}
.cid-hero__trust li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-body);
}
.cid-hero__trust li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background-image: linear-gradient(135deg, var(--c-secondary), var(--c-primary));
}

.cid-hero__note {
  margin-top: var(--space-6);
  font-size: 0.95rem;
  color: var(--c-muted);
}
.cid-hero__note a { font-weight: 700; }

/* ---- Lookup form panel --------------------------------------------------- */
.cid-panel {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: 0 1px 2px rgba(16, 31, 56, 0.04), 0 12px 30px -12px rgba(16, 31, 56, 0.18);
}

.cid-form { max-width: none; }
.cid-form .field { position: relative; }

/* First / last name share a row. Row gap matches the .stack rhythm between
   the other fields so the pair reads as one line of the form, not a block. */
.cid-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--stack-space, var(--space-6)) var(--space-4);
}
@media (max-width: 30rem) {
  .cid-form__row { grid-template-columns: 1fr; }
}

.cid-form__error {
  color: #d64545;
  font-size: 0.8125rem;
}
.cid-form__error.hidden { display: none; }

/* Scoped to this page cluster only — the shared stylesheets don't define a
   generic .hidden utility. */
.cid-hero .hidden,
#cid-reputation-empty.hidden,
#cid-reputation-content.hidden,
#cid-results-empty.hidden,
#cid-results-content.hidden,
#cid-branch-healthy.hidden,
#cid-branch-flagged.hidden { display: none; }

/* Honeypot. Deliberately NOT display:none / hidden / visibility:hidden — the
   naive form-fillers this catches skip fields hidden those ways. Positioned
   off-canvas instead, so it's invisible and unclickable to humans but reads as
   an ordinary text input to anything parsing the DOM. Named to look like a
   field a bot wants to fill; see the honeypot branch in
   templates/tools/caller_id_testing.html. */
.cid-form__hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* reCAPTCHA v3 (partials/recaptcha.html). Google's floating badge would sit
   over the page bottom-right, so it's hidden and replaced by the inline
   attribution line below — the substitution Google's branding terms require.
   Keep the two rules together: dropping the attribution while the badge stays
   hidden puts us out of compliance. */
.grecaptcha-badge { visibility: hidden; }

.recaptcha-attribution {
  margin: 0;
  color: var(--c-muted);
  font-size: 0.6875rem;
  line-height: 1.5;
}

.recaptcha-attribution a { color: inherit; }

.cid-form__or {
  text-align: center;
  margin: var(--space-5) 0;
  color: var(--c-muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cid-form__bulk { text-align: center; margin: 0; }

.cid-form__submit-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.cid-form__loader {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid rgba(0, 100, 224, 0.2);
  border-top-color: var(--c-primary);
  animation: cid-spin 0.7s linear infinite;
}
@keyframes cid-spin { to { transform: rotate(360deg); } }

.cid-form__result {
  margin-top: var(--space-4);
  font-size: 0.9rem;
  color: var(--c-muted);
}
.cid-form__result.hidden { display: none; }

/* ---- Results tables (initial-results + reputation pages) ---------------- */
.cid-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  box-shadow: 0 1px 2px rgba(16, 31, 56, 0.04), 0 12px 30px -12px rgba(16, 31, 56, 0.18);
}
.cid-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  min-width: 32rem;
}
.cid-table-wrap th,
.cid-table-wrap td {
  padding: 0.9rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.92rem;
  white-space: nowrap;
}
.cid-table-wrap thead th {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--c-muted);
  background: var(--c-subtle);
}
.cid-table-wrap tbody tr:last-child td { border-bottom: 0; }

.cid-reputation-cell--healthy { background: #70b26a; color: #fff; font-weight: 700; }
.cid-reputation-cell--unhealthy { background: #d64545; color: #fff; font-weight: 700; }

.cid-results-empty {
  padding: var(--space-8);
  text-align: center;
  color: var(--c-muted);
  border: 1px dashed var(--c-border);
  border-radius: var(--radius-lg);
}

/* ---- Reputation verdict card (/caller-id-tool) --------------------------- */
.cid-verdict {
  position: relative;
  overflow: clip;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 31, 56, 0.04), 0 18px 40px -18px rgba(16, 31, 56, 0.22);
}
/* Verdict colour lives on a top edge + tint rather than the whole card, so a
   flagged read is unmistakable without turning the page into a warning box. */
.cid-verdict::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
}
.cid-verdict--healthy::before { background: linear-gradient(90deg, #4f9f49, #70b26a); }
.cid-verdict--flagged::before { background: linear-gradient(90deg, #b83232, #e26a4a); }
.cid-verdict--healthy { background: linear-gradient(180deg, rgba(112, 178, 106, 0.07) 0%, #fff 60%); }
.cid-verdict--flagged { background: linear-gradient(180deg, rgba(214, 69, 69, 0.08) 0%, #fff 60%); }

.cid-verdict h1 { margin-top: var(--space-4); }
.cid-verdict .lede { max-width: 58ch; }

.cid-verdict__meta {
  margin: var(--space-5) 0 0;
  font-size: 0.8125rem;
  color: var(--c-muted);
}

.cid-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cid-badge::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentColor;
}
.cid-badge--healthy { background: rgba(112, 178, 106, 0.16); color: #35702f; }
.cid-badge--flagged { background: rgba(214, 69, 69, 0.14); color: #a23434; }

/* ---- "What this means" / "What this is costing you" --------------------- */
.cid-meaning {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-5);
}
.cid-meaning__item {
  padding: var(--space-6);
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(16, 31, 56, 0.04);
}
.cid-meaning__item h3 { font-size: 1.05rem; margin: 0 0 var(--space-3); }
.cid-meaning__item p { margin: 0; font-size: 0.95rem; }

/* ---- Step rail (results pages) ------------------------------------------ */
.cid-steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  list-style: none;
  margin: 0 0 var(--space-6);
  padding: 0;
}
.cid-steps__step {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-muted);
}
.cid-steps__dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  border: 2px solid var(--c-border);
  background: #fff;
}
.cid-steps__step.is-done { color: var(--c-body); }
.cid-steps__step.is-done .cid-steps__dot {
  border-color: var(--c-primary);
  background: var(--c-primary);
}
.cid-steps__step.is-current { color: var(--c-primary); }
.cid-steps__step.is-current .cid-steps__dot {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px rgba(0, 100, 224, 0.14);
}

.cid-number { white-space: nowrap; }

/* ---- Caller ID fact tiles ------------------------------------------------ */
.cid-facts {
  display: grid;
  /* Two-up on phones (10rem floor) so nine fields don't push the CTA a
     screen and a half down; auto-fit widens it out from there. */
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-8);
}
.cid-fact {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(16, 31, 56, 0.04);
}
.cid-fact__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.cid-fact__value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-body);
  overflow-wrap: anywhere;
}

/* Raw field dump, collapsed by default so the tiles + CTA stay the story. */
.cid-raw { margin-top: var(--space-6); }
.cid-raw > summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-primary);
}

/* ---- Primary next-step CTA panel ---------------------------------------- */
.cid-next {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 100, 224, 0.22);
  background:
    radial-gradient(110% 140% at 90% 0%, rgba(53, 116, 227, 0.12), transparent 62%),
    linear-gradient(180deg, #f7faff 0%, #ffffff 75%);
  box-shadow: 0 1px 2px rgba(16, 31, 56, 0.04), 0 18px 40px -18px rgba(16, 31, 56, 0.22);
}
/* Flagged-state CTA: same panel, urgent palette. */
.cid-next--alert {
  border-color: rgba(214, 69, 69, 0.28);
  background:
    radial-gradient(110% 140% at 90% 0%, rgba(214, 69, 69, 0.13), transparent 62%),
    linear-gradient(180deg, #fff7f6 0%, #ffffff 75%);
}
.cid-next--alert .eyebrow { color: #a23434; }
.cid-next--alert .cid-next__points li::before {
  background-image: linear-gradient(135deg, #e26a4a, #b83232);
}

.cid-next h2 { margin-top: var(--space-2); }
.cid-next__points {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
}
.cid-next__points li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-body);
}
.cid-next__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background-image: linear-gradient(135deg, var(--c-secondary), var(--c-primary));
}
.cid-next__action { text-align: center; }
.cid-next__action .btn {
  width: 100%;
  min-height: 3.25rem;
  font-size: 1.0625rem;
}
.cid-next__meta {
  margin: var(--space-3) 0 0;
  font-size: 0.8125rem;
  color: var(--c-muted);
}

/* Deliberately quiet: available, but never competing with the CTA above. */
.cid-secondary {
  margin-top: var(--space-6);
  font-size: 0.9rem;
  color: var(--c-muted);
}
.cid-secondary a { font-weight: 600; }

@media (max-width: 60rem) {
  .cid-hero__grid { grid-template-columns: 1fr; }
  .cid-next { grid-template-columns: 1fr; }
}
