/* ===============================================================
   DEMO PAGES — what the theme does not already cover
   ---------------------------------------------------------------
   Serves page-templates/demo-request.php and demo-thank-you.php.
   Linked from inside each template, after wp_head(), so it wins
   over custom.css. Nothing is enqueued in functions.php.

   THE TWO PAGES ARE BUILT FROM THE THEME. Everything inside the
   band is an existing custom.css class, used as-is:

     band + surface    .section .section--pad-lg .section--bg-cream
     grid              .container .row .col-lg-6 .g-5
     eyebrow           .hero-eyebrow                        (7.1)
     headline          plain <h1> + .headline-wide          (2.2, 4)
     standfirst        .lead-muted                          (4)
     panel             .rich-text-card                      (7.17)
     panel heading     .section-head__title                 (5.7)
     step numbers      .step-marker                         (5.5)
     buttons           .btn .btn-primary / .btn .btn-line    (3)
     small print       .text-small-muted .fst-italic        (4)

   What is left, and all this file holds: the stripped chrome the
   wireframe draws, a benefit list, the form fields, the tick and
   the step rows. EVERY VALUE IS A --z-* TOKEN — no new colours,
   no new type sizes. Change a token in custom.css and these
   follow.

   ---------------------------------------------------------------
   ONE COLOUR THAT IS NOT A TOKEN, AND WHY

   --demo-field-border. The obvious choice was --z-border-strong,
   which .grid-search input uses, but it is #9aa8bc: 2.41:1 on
   white and 2.09:1 on sand, against the 3:1 WCAG asks for the
   boundary of a form control. A field with that border has no
   reliable edge for anyone with low vision.

   #76879f is the same hue two steps darker — 3.66:1 on white,
   3.17:1 on sand — and is near enough identical at a glance.

   NOT A PROBLEM I INTRODUCED: every .grid-search input on the site
   has that 2.41:1 border today, on the filterable grid and the
   FAQ. Darkening --z-border-strong itself would fix all of them at
   once, but it is used for card hover borders too, so that is
   your call rather than a change to make quietly from here.
   =============================================================== */

:root {
  --demo-field-border: #76879f;   /* see the note above */

  /* Bootstrap's --bs-danger used to be used here. The theme does
     define a handful of --bs-* tokens itself (custom.css ~171-189)
     but NOT that one, so it resolved only while Bootstrap's own
     stylesheet was on the page. On a template that builds its own
     <head> that is not a safe bet, and an unresolved var drops the
     whole declaration — which is how the required asterisks and
     the error text ended up inheriting body navy. */
  --demo-danger: #dc3545;         /* Bootstrap's $danger, verbatim */
}


/* ---------------------------------------------------------------
   Chrome
   ---------------------------------------------------------------
   The wireframe's stripped header and footer: wordmark, content,
   one line of legal. No navigation — the only thing to do on a
   conversion page is fill the form or leave.

   The shell is a column so the footer sits at the bottom even on
   the short thank-you page.
   --------------------------------------------------------------- */

.demo-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--z-surface-sand);
}

.demo-main { flex: 1; }

.demo-head { padding-block: 1.25rem; }

.demo-foot {
  padding-block: 1.5rem;
  border-top: 1px solid var(--z-border-default);
}

.demo-foot__in {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  font-size: var(--z-fs-caption);
  line-height: var(--z-lh-caption);
  color: var(--z-text-muted);
}

.demo-foot__links { display: flex; gap: 1.25rem; }

.demo-foot a { color: var(--z-text-muted); text-decoration: none; }
.demo-foot a:hover { color: var(--z-text-ink); }

/* ---- Logo ----
   zurel_logo('header') prints it, exactly as header.php does, so
   it carries .site-logo and the text fallback with it and there
   is nothing to style. The link also takes .navbar-brand, the
   theme's own brand class (9.1), which supplies the family, size
   and colour.

   All that is left is this: padding-inline, because .navbar-brand
   is built for a Bootstrap navbar and arrives with side padding
   that would push the logo off the container's left edge. */
.demo-logo {
  padding-inline: 0;
  margin-right: 0;
}


/* ---------------------------------------------------------------
   Benefit list — demo-request.php
   The theme has no generic icon list. .pricing-tier__list is the
   closest, but borrowing a pricing class for a demo page makes
   both harder to change later.
   --------------------------------------------------------------- */

.demo-points li {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  font-size: var(--z-fs-body);
  line-height: var(--z-lh-body);
  color: var(--z-text-body);
}

.demo-points li + li { margin-top: .875rem; }

.demo-points svg {
  flex: 0 0 auto;
  margin-top: .375rem;            /* optical centre on the first line */
  color: var(--z-brand-cta);
}


/* ---------------------------------------------------------------
   The form — HubSpot's embed
   ---------------------------------------------------------------
   THESE CLASS NAMES ARE HUBSPOT'S and cannot be renamed.

   Everything below hangs off #tnm-demo-form, the div this template
   owns. It used to hang off .demo-form, and that was the bug. Two
   separate reasons an ID is the right anchor:

   1. .demo-form only exists if cssClass lands on the <form>. The
      ID is in the markup whatever HubSpot does with its options.

   2. HubSpot injects its own stylesheet into <head> when the form
      renders — i.e. AFTER this file's <link>. On a class-vs-class
      tie it therefore wins on source order, and css: "" is the
      only thing standing between us and that. An ID is 1-0-0 and
      outranks every selector in their sheet, so these rules hold
      whether or not css: "" is doing its job.

   Field geometry is copied from .grid-search input (5.6) so a
   field here and a search box elsewhere are plainly the same
   control. The submit IS styled here, in full — see the note on
   it below for why borrowing .btn did not work.

   If a field stops looking right after HubSpot changes its
   markup, compare against the rendered DOM before assuming this
   file is wrong.
   --------------------------------------------------------------- */

/* Bootstrap's reboot may not reach a template that builds its own
   <head>. Without border-box the 100%-wide fields overflow their
   column by their own padding. */
#tnm-demo-form,
#tnm-demo-form * { box-sizing: border-box; }

.demo-form-card { border-top: 5px solid var(--z-brand-orange); }

/* The embed is fetched after paint, so without a floor the panel
   collapses and the page jumps when the form lands. */
.demo-form-slot { min-height: 30rem; }

#tnm-demo-form .hs-form-field { margin-bottom: 1.25rem; }

/* HubSpot ships a narrow fieldset and inline 50% widths on paired
   fields; both are undone so the name row uses the same flex rule
   as everything else. */
#tnm-demo-form fieldset {
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}

#tnm-demo-form fieldset .hs-form-field {
  flex: 1 1 12rem;
  width: auto;
  float: none;
  padding: 0;
}

#tnm-demo-form .hs-form-field > label {
  display: block;
  margin-bottom: .375rem;
  font-size: var(--z-fs-small);
  line-height: var(--z-lh-small);
  font-weight: 600;
  color: var(--z-text-ink);
}

#tnm-demo-form .hs-form-required { color: var(--demo-danger); }

#tnm-demo-form .hs-input {
  width: 100%;
  padding: .75rem 1rem;
  font-family: inherit;
  font-size: var(--z-fs-link);    /* 17px — under 16 and iOS zooms
                                      the page on focus */
  line-height: var(--z-lh-link);
  color: var(--z-text-ink);
  background: var(--z-surface-white);
  border: 1px solid var(--demo-field-border);
  border-radius: .75rem;
}

#tnm-demo-form .hs-input::placeholder { color: var(--z-text-muted); opacity: 1; }

#tnm-demo-form .hs-input:focus {
  outline: none;
  border-color: var(--z-brand-navy);
  box-shadow: 0 0 0 3px rgba(29, 53, 87, .15);
}

#tnm-demo-form textarea.hs-input { min-height: 7rem; resize: vertical; }

/* Errors. These are HubSpot's own default class names. The embed
   no longer renames them through errorClass / errorMessageClass —
   renaming them was what broke this: the rules below were written
   against the renamed classes, HubSpot put its defaults on some
   elements and the new names on others, and the message ended up
   matching nothing at all. One set of names, theirs. */
#tnm-demo-form .hs-input.invalid,
#tnm-demo-form .hs-input.error { border-color: var(--demo-danger); }

/* HubSpot wraps the message in <ul class="no-list hs-error-msgs">.
   `no-list` is only a hook — it carries no styling of its own — so
   with HubSpot's sheet suppressed this is a bare <ul>, and a bare
   <ul> has 40px of browser padding. That is the indent you can see
   under each field. */
#tnm-demo-form .hs-error-msgs {
  list-style: none;
  margin: .375rem 0 0;
  padding: 0;
}

#tnm-demo-form .hs-error-msgs li { margin: 0; }

/* The message itself is a <label>, which is inline by default. */
#tnm-demo-form .hs-error-msg {
  display: block;
  font-size: var(--z-fs-caption);
  line-height: var(--z-lh-caption);
  color: var(--demo-danger);
}

/* The consent paragraph HubSpot renders. Matches
   .signup-card__note (7.24). */
#tnm-demo-form .legal-consent-container {
  margin-bottom: 1.25rem;
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--z-text-muted);
}

#tnm-demo-form .legal-consent-container p { margin: 0; }

#tnm-demo-form .legal-consent-container a {
  color: var(--z-brand-cta);
  text-decoration: underline;
  text-underline-offset: 2px;
}

#tnm-demo-form .hs_submit .actions { margin: 0; padding: 0; }

/* The reCAPTCHA badge, once CAPTCHA is switched on, so it does
   not sit flush against the button. */
#tnm-demo-form .hs-recaptcha { margin-bottom: 1rem; }

/* ---- The submit button ----
   Drawn here in full rather than borrowed from .btn, and this is
   the one change worth understanding before touching it again.

   .btn in custom.css (~352) sets geometry ONLY — min-height,
   radius, padding, weight. Its colours live entirely in
   --bs-btn-bg / --bs-btn-color / --bs-btn-border-color, set by
   .btn-primary (~370). Nothing in the theme READS those variables.
   Bootstrap's own .btn rule does. So `btn btn-primary w-100` on
   this button is three classes that resolve to no colour at all
   unless Bootstrap's stylesheet is on the page — which is why it
   rendered as a bare grey browser button.

   Spelling the colours out drops the dependency on both Bootstrap
   and on submitButtonClass landing. input[type="submit"] matches
   whatever classes HubSpot puts on it.

   Values are .btn + .btn-primary resolved: 52px, pill, ink on
   brand orange. Ink, not white, because white on this orange is
   2.3:1 and the ink is 7.1:1 — same reasoning as the theme. */
#tnm-demo-form input[type="submit"] {
  display: block;
  width: 100%;
  min-height: 3.25rem;              /* .btn — Figma Button/Default */
  padding: .75rem 1.5rem;
  font-family: inherit;
  font-size: var(--z-fs-link);
  line-height: var(--z-lh-link);
  font-weight: 700;
  color: var(--z-text-ink);
  background: var(--z-brand-orange);
  border: 1.5px solid var(--z-brand-orange);
  border-radius: 50rem;             /* pill, as .btn */
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}

#tnm-demo-form input[type="submit"]:hover {
  background: var(--z-brand-orange-hover);
  border-color: var(--z-brand-orange-hover);
}

#tnm-demo-form input[type="submit"]:focus-visible {
  outline: 3px solid var(--z-brand-navy);
  outline-offset: 2px;
}

/* HubSpot disables the button while a submission is in flight. */
#tnm-demo-form input[type="submit"][disabled] {
  opacity: .65;
  cursor: default;
}

/* HubSpot's own inline thank-you, shown if the redirect in its
   Options tab is ever removed. */
#tnm-demo-form .submitted-message {
  margin: 0;
  font-size: var(--z-fs-body);
  line-height: var(--z-lh-body);
  color: var(--z-text-ink);
}


/* ---------------------------------------------------------------
   Confirmation head — demo-thank-you.php
   Tick on the left, headline and the line under it stacked beside
   it.
   --------------------------------------------------------------- */

.demo-ty__head {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

/* flex-start, not center: centred against the whole text block the
   tick drifts downward as soon as the headline wraps to two lines,
   which it does on a phone. Top-aligned it stays level with the
   first line whatever the text does below. */

.demo-tick {
  /* 0 0 auto so a long headline cannot squeeze the circle into an
     oval — a flex item with a set width will still shrink. */
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--z-brand-orange);   /* ink on it is 7.1:1;
                                          white would be 2.3:1 */
  color: var(--z-text-ink);
}

/* 2rem, taken from the theme's own article-H2 step rather than
   written as a bare 2rem, so it moves with the type scale. This
   also has to out-specify the theme's phone rule, which drops h1
   to 2.25rem — larger than this — at 767px. A class beats the
   bare h1 selector, so it does. */
.demo-ty__title {
  margin: 0 0 .5rem;
  font-size: var(--z-fs-article-h2);
  line-height: var(--z-lh-article-h2);
}


/* ---------------------------------------------------------------
   Step rows — demo-thank-you.php
   The numbered circle is .step-marker from 5.5; this is only the
   row it sits in.
   --------------------------------------------------------------- */

.demo-steps li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.demo-steps li + li { margin-top: 1.125rem; }

.demo-steps p {
  margin: 0;
  padding-top: .4375rem;          /* sits the text on the marker's centre */
  font-size: var(--z-fs-body);
  line-height: var(--z-lh-body);
  color: var(--z-text-body);
}


/* ---------------------------------------------------------------
   Narrow screens
   --------------------------------------------------------------- */

@media (max-width: 575.98px) {

  .demo-steps li { gap: .75rem; }
  .demo-foot__in { flex-direction: column; }

  /* The circle and its gap cost 76px of a 350px column, which at
     32px type is most of a word per line. Trimming both gives the
     headline back about 30px without shrinking the type. */
  .demo-ty__head { gap: 1rem; }
  .demo-tick { width: 2.75rem; height: 2.75rem; }
  .demo-tick svg { width: 22px; height: 22px; }
}