/* ==========================================================================
   Live voice demo — the "Try it live" block (partials/web-demo.php, web-demo.js).
   Sits inside the dark Voice section, between the voice grid and the example
   calls, so it borrows that band's pieces: the transcript cards' dark card, the
   warm accent, the UI font for the countdown. No new colours.

   data-state on .try-card drives everything: idle | connecting | live | ended | blocked | error.
   ========================================================================== */

.try-block { padding-bottom: 72px; }

.try-card {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center;
  background: var(--dark-card); border: 1px solid var(--dark-line); border-radius: 14px;
  padding: 40px 44px;
}
.try-copy .h-section { margin-bottom: 14px; }
.try-lead { font-size: 18px; line-height: 1.55; color: var(--dark-text); max-width: 520px; margin: 0; text-wrap: pretty; }

.try-controls { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; }

/* The orb: a mic in a ring. While live it fills with the accent and its halo follows
   the call audio (--lvl, 0..1, set by web-demo.js). */
.try-orb {
  --lvl: 0;
  width: 112px; height: 112px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--dark-chip); color: var(--accent-warm); border: 1.5px solid #4a463d;
  box-shadow: 0 0 0 calc(var(--lvl) * 26px) rgba(224, 122, 77, .22);
  transition: box-shadow .08s linear, background-color .25s, border-color .25s, color .25s;
}
.try-card[data-state="connecting"] .try-orb { animation: tryWait 1.4s ease-in-out infinite; }
.try-card[data-state="live"] .try-orb { background: var(--accent-warm); border-color: var(--accent-warm); color: var(--ink); cursor: pointer; }
@keyframes tryWait {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 122, 77, .22); }
  50% { box-shadow: 0 0 0 14px rgba(224, 122, 77, .08); }
}
@media (prefers-reduced-motion: reduce) {
  .try-orb { transition: none; box-shadow: none; }
  .try-card[data-state="connecting"] .try-orb { animation: none; }
}

.try-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.try-actions [hidden] { display: none; }   /* .btn sets display, which would beat the attribute */
.try-stop { background: transparent; color: var(--paper); border: 1.5px solid var(--paper); padding: 14.5px 26px; }
.try-stop:hover { background: var(--paper); color: var(--ink); }

.try-status { min-height: 1.55em; margin: 0; max-width: 380px; font-size: 15.5px; line-height: 1.55; }
.try-card[data-state="error"] .try-status,
.try-card[data-state="blocked"] .try-status { color: var(--accent-warm-hover) !important; }
.try-timer { font-family: var(--font-ui); font-weight: 700; color: var(--accent-warm); white-space: nowrap; }
.try-fineprint { margin: 0; font-size: 13.5px; color: var(--faint) !important; }

@media (max-width: 960px) {
  .try-card { grid-template-columns: 1fr; gap: 32px; padding: 32px 28px; }
  .try-block { padding-bottom: 56px; }
}
@media (max-width: 640px) {
  .try-card { padding: 26px 20px; }
}

/* ==========================================================================
   Callback — the "have it call you" card (partials/web-callback.php, web-callback.js).
   A second .try-card directly under the first, so it inherits the card, the copy
   column and the status line; only the form is new. Inputs are the contact form's
   .field shape re-toned for the dark band. data-state on .cb-card:
   off (no number to call from yet) | idle | sending | calling | error.
   ========================================================================== */

/* The two cards read as one pair: close the gap the first block leaves above this one.
   (Without :has support the gap is simply the normal 72px.) */
.try-block:has(+ .cb-block) { padding-bottom: 24px; }

.cb-fields { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.cb-card .field { color: var(--dark-text); }
.cb-card .field input {
  background: var(--dark-chip); color: var(--paper); border-color: #4a463d;
}
.cb-card .field input::placeholder { color: var(--faint); }
.cb-card .field input:focus { border-color: var(--accent-warm) !important; }

.cb-consent { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 13.5px; line-height: 1.5; color: var(--dark-muted); cursor: pointer; }
.cb-consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent-warm); }
.cb-consent a { color: var(--accent-warm); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.cb-consent a:hover { color: var(--accent-warm-hover); }

.cb-actions [hidden] { display: none; }   /* .btn sets display, which would beat the attribute */
.cb-card .try-status { max-width: none; }
.cb-card[data-state="calling"] .try-status { color: var(--accent-warm) !important; font-weight: 600; }
.cb-card[data-state="error"] .try-status { color: var(--accent-warm-hover) !important; }

/* Not switched on yet: the form stays visible so the block reads as a real feature,
   dimmed and inert, with the note in the status line explaining why. */
.cb-fields[disabled] .field, .cb-fields[disabled] .cb-consent, .cb-fields[disabled] .cb-actions { opacity: .5; }
.cb-fields[disabled] .btn { cursor: not-allowed; }
.cb-card[data-state="off"] .try-status { color: var(--dark-text) !important; }

@media (max-width: 960px) {
  .try-block:has(+ .cb-block) { padding-bottom: 20px; }
}
@media (max-width: 640px) {
  .cb-card .field-row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   The demo LINE (S65) — the public phone number, shown in three places here:
     .try-alt      a row along the bottom of the home page's "Try it live" card
     .line-card    its own card at the top of try.php (data-state: on | off)
     .try-page     try.php's dark page wrapper and hero
   ========================================================================== */
.try-alt {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px;
  margin: 0; padding-top: 22px; border-top: 1px solid var(--dark-line);
  font-size: 16px; line-height: 1.5;
}
.try-alt a { color: var(--accent-warm); font-weight: 700; text-decoration: none; }
.try-alt a:hover { color: var(--accent-warm-hover); text-decoration: underline; }
.try-alt-num { font-family: var(--font-ui); white-space: nowrap; }
.try-alt-more { white-space: nowrap; }

.try-page { padding-bottom: 64px; }
.try-hero { padding-bottom: 40px; }
.try-hero .h-display { color: var(--paper); }
.try-block:has(+ .try-block) { padding-bottom: 24px; }

.line-number {
  font-family: var(--font-ui); font-weight: 700; font-size: clamp(30px, 4vw, 42px); letter-spacing: .02em;
  color: var(--paper); text-decoration: none; white-space: nowrap;
}
.line-number:hover { color: var(--accent-warm); }
.line-card[data-state="off"] .try-orb { opacity: .55; }

.try-contact { padding-top: 32px; }
.try-contact p { margin: 0; font-size: 16px; }
.try-contact a { color: var(--accent-warm); font-weight: 700; white-space: nowrap; }

@media (max-width: 960px) {
  .try-block:has(+ .try-block) { padding-bottom: 20px; }
}
