/* ForecastsPro landing: the founding seats left (owner, 3 October 2026).
 *
 * Loaded after site.css on the sales pages only (home, /how-it-works, /safety, /math, /faq,
 * /affiliates), which also load assets/js/pricing.js; site.css keeps its size budget. Tokens
 * only, no inline styles (the CSP). Both pieces stay hidden until pricing.js has the live count
 * from the app, so without JavaScript (or without an answer) no page shows a number of seats.
 *
 *  - .price-seats   The pricing card's live count, "Only 17 seats left", a badge on the card's
 *                   top edge (out of the flow: no layout shift when it appears).
 *  - .seat-toast    The small notice at the bottom of the screen: the founding price, the
 *                   seats left, "Claim yours" (the checkout) and a close button.
 *
 * Both read in the warning tone, and in the danger tone (red) from 5 seats down
 * ([data-tone="danger"], set by pricing.js).
 */

/* ---------- The pricing card's live line ---------- */

.price-seats {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  padding: 6px 14px 6px 28px;
  border-radius: var(--radius-pill);
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  white-space: nowrap;
}
/* A live dot with a soft pulse ring (the hero kicker's lp-pulse, site.css); reduced motion
   stops the ring (site.css), the dot stays. */
.price-seats::before,
.price-seats::after {
  content: "";
  position: absolute;
  top: 50%;
  border-radius: 50%;
}
.price-seats::before { left: 12px; width: 8px; height: 8px; margin-top: -4px; background: currentColor; }
.price-seats::after {
  left: 8px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid currentColor;
  opacity: 0;
  animation: lp-pulse 2.4s var(--ease) infinite;
}
.price-seats[data-tone="danger"] { background: var(--danger-soft); color: var(--danger); }
/* On the card's top edge (top right), out of the flow: showing it when the app answers moves
   nothing on the page. Opaque there (the soft tone mixed into the card's background), so the
   card's edge does not show through it; .price-top's top is the card's padding below its edge. */
.price-top { position: relative; }
.price-card .price-seats {
  position: absolute;
  top: calc(-1 * clamp(24px, 3.2vw, 36px));
  right: 0;
  margin: 0;
  transform: translateY(-50%);
  background: color-mix(in srgb, var(--warning) 16%, var(--bg-base));
}
.price-card .price-seats[data-tone="danger"] { background: color-mix(in srgb, var(--danger) 16%, var(--bg-base)); }
/* A narrow card (phones; .price-top is the size container, site.css): the founding pill takes
   a line of its own, so the words after it stay together. */
@container (max-width: 370px) {
  .price-founding .pill { display: flex; width: fit-content; margin: 0 0 6px; }
}

/* "Save $300" beside the regular price (owner, 5 October 2026): the green of the founding pill. */
.price-save { color: var(--success-text); font-weight: 600; }

/* ---------- The notice ---------- */

/* Fixed at the bottom left (bottom, nearly full width, on phones), so it never moves the page.
   It slides up when pricing.js shows it (.is-in) and steps aside (.is-away) while the footer
   or the pricing card is on screen, or the first section's buttons sit where it lies, so it
   never covers them for good. */
.seat-toast {
  position: fixed;
  z-index: 40;            /* under the sticky header and its menu (50) */
  left: max(24px, env(safe-area-inset-left));
  bottom: calc(24px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  width: min(420px, calc(100vw - 32px));
  padding: 10px 8px 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: rgba(43, 45, 49, 0.9);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  box-shadow: var(--shadow-pop), 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease),
              visibility 0s linear var(--dur-slow);
}
.seat-toast.is-in { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.seat-toast.is-in.is-away {
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition-delay: 0s, 0s, var(--dur-slow);
}
/* While it shows, a control that takes focus scrolls clear of it (54 to 71 px plus its offset);
   not once it is closed ([hidden]; pricing.js leaves .is-in on). */
html:has(.seat-toast.is-in:not(.is-away):not([hidden])) { scroll-padding-bottom: 96px; }

.seat-toast-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--warning-soft);
  color: var(--warning);
}
.seat-toast-text {
  display: grid;
  grid-template-columns: minmax(0, 1fr);  /* never wider than its cell, so never under the button */
  gap: 2px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
}
/* The price wraps (in balanced lines) where its cell is too narrow for one line. */
.seat-toast-price { color: var(--text-primary); font-weight: 600; text-wrap: balance; }
.seat-toast-seats { color: var(--warning); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.seat-toast[data-tone="danger"] .seat-toast-icon { background: var(--danger-soft); color: var(--danger); }
.seat-toast[data-tone="danger"] .seat-toast-seats { color: var(--danger); }

.seat-toast .seat-toast-cta { height: 36px; padding: 0 14px; font-size: 13px; }
.seat-toast-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.seat-toast-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.seat-toast-close:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }
/* Touch screens: an invisible 44 px hit area around the 32 px button; nothing moves. */
@media (pointer: coarse) {
  .seat-toast-close { position: relative; }
  .seat-toast-close::after { content: ""; position: absolute; inset: -6px; }
}

/* Phones: along the bottom, 16 px from each side, above the home indicator. */
@media (max-width: 640px) {
  .seat-toast {
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: auto;
    gap: 10px;
    padding: 8px 6px 8px 10px;
  }
  .seat-toast-icon { width: 30px; height: 30px; border-radius: 9px; }
  .seat-toast .seat-toast-cta { padding: 0 12px; }
}
/* Phone widths (up to the largest phones, 440 px): the icon goes, so the text keeps its room
   (the price on one line from about 390 px, on two below). */
@media (max-width: 440px) {
  .seat-toast { grid-template-columns: minmax(0, 1fr) auto auto; padding-left: 14px; }
  .seat-toast-icon { display: none; }
}

/* No slide for visitors who asked for reduced motion: it simply appears. */
@media (prefers-reduced-motion: reduce) {
  .seat-toast,
  .seat-toast.is-in.is-away { transform: none; transition: none; }
}

@media print {
  .seat-toast { display: none !important; }
}
