/*
 * Film set theme — tokens and shared components for every signed-in portal page.
 *
 * The world you signed in to continues: a dimmed, blurred still of the film set
 * behind frosted glass. Linked AFTER styles.css, which keeps the sign-in screen's
 * pinned :root and background untouched. Portal CSP is style-src 'self': no <style>,
 * no style= (SVG included). Dynamic values go through CSSOM from same-origin JS
 * (assets/illustrations.js). Motion lives in assets/motion.css.
 *
 * Vocabulary other pages reuse (do not fork):
 *   body.fs-backdrop          the fixed, blurred film-set still behind a page
 *   .fs-glass / .fs-glass-strong    frosted card surface / dense-data surface
 *   .fs-tile + --good|--warn|--danger|--info   state tile (neutral without a modifier)
 *   .fs-kicker .fs-value .fs-unit .fs-sub .fs-tile-link   tile anatomy
 *   .fs-banner + tone modifiers, .fs-banner-copy .fs-banner-title   one-line state banner
 *   .fs-grace                 the deletion grace banner account-status.js puts inside every
 *                             account page (a .fs-banner with a counting-down ring)
 *   .fs-pill + tone modifiers  plain-word status (Active, Invited, Paid, Due …)
 *   .fs-button, .fs-button--primary   quiet glass button / the single red action
 *   .fs-empty                 empty state: one illustration, one sentence, one action
 *   .fs-toast                 bottom-centre glass notice (Undo lives here)
 *   .fs-art, .fs-art--corner  illustration host (illustrations.js builds the SVG)
 *   .fs-sr                    visually hidden, still read aloud
 * A tone modifier sets --fs-tone-label / --fs-tone-sub / --fs-tone-action / --fs-tone-art,
 * which every child (kicker, links, ring, meter …) reads.
 */

:root {
  /* Ink. --fs-ink-3 is for glass surfaces only (4.7:1 at worst on --fs-glass). */
  --fs-ink: #F3EFEA;
  --fs-ink-2: rgba(255, 255, 255, .68);
  --fs-ink-3: rgba(255, 255, 255, .48);

  /* Surfaces */
  --fs-ground: #0B0B0D;
  --fs-glass: rgba(16, 16, 20, .52);
  --fs-glass-strong: rgba(12, 12, 15, .74);
  --fs-glass-solid: #131316;
  --fs-line: rgba(255, 255, 255, .11);
  --fs-line-strong: rgba(255, 255, 255, .20);
  --fs-blur: blur(16px) saturate(140%);
  --fs-shadow: 0 18px 44px rgba(0, 0, 0, .26);

  /* Shape */
  --fs-radius: 16px;
  --fs-radius-ctl: 10px;
  --fs-radius-pill: 999px;

  /* Type: Space Grotesk is self-hosted by styles.css (font-src 'self'). */
  --fs-font: "Space Grotesk", "Helvetica Neue", sans-serif;

  /* Action and brand. White on the spec's #E5392B measures 4.24:1 (fails AA for
     button-size text), so the action red is the EmailLayout AA red (4.79:1) and
     hover darkens instead of lightening (#F04A3B would be 3.65:1). */
  --fs-action: #DB2C16;
  --fs-action-hover: #BF2410;
  --fs-brand-red: #CC0000;
  --fs-focus: #FF5A4A;
  --fs-link: #FF8A7A;

  /* Semantic colour: GREEN good/active · AMBER soon/attention · RED act now · BLUE informational/team-covered */
  --fs-good: #2FCB7A;
  --fs-good-tint: linear-gradient(160deg, rgba(47, 203, 122, .34), rgba(18, 70, 44, .42));
  --fs-good-line: rgba(90, 235, 160, .45);
  --fs-good-label: #9CF2C4;
  --fs-good-action: #B8F7D4;
  --fs-good-ring: #5CF0A2;
  --fs-warn: #F2A93B;
  --fs-warn-tint: rgba(242, 169, 59, .16);
  --fs-warn-line: rgba(242, 169, 59, .45);
  --fs-warn-label: #FFD08A;
  --fs-warn-action: #FFDCA6;
  --fs-danger: #FF5A4A;
  --fs-danger-tint: rgba(229, 57, 43, .20);
  --fs-danger-line: rgba(255, 90, 74, .45);
  --fs-danger-label: #FFB0A6;
  --fs-danger-action: #FFC2BA;
  --fs-info: #5B8CFF;
  --fs-info-tint: rgba(91, 140, 255, .16);
  --fs-info-line: rgba(91, 140, 255, .40);
  --fs-info-label: #B9CCFF;
  --fs-info-action: #CCDAFF;

  /* Motion (brand rule: hard entries, no bounce, no soft dissolve; the red plate lands last) */
  --fs-ease-hard: cubic-bezier(.16, 1, .3, 1);
  --fs-arrive: 180ms;
  --fs-stagger: 70ms;
  --fs-land: 480ms;
  --fs-count: 700ms;
  --fs-draw: 900ms;
  --fs-grow: 600ms;
  --fs-state: 160ms;
}

/* Glass becomes solid when transparency is unwelcome or unsupported. */
@media (prefers-reduced-transparency: reduce) {
  :root {
    --fs-glass: var(--fs-glass-solid);
    --fs-glass-strong: var(--fs-glass-solid);
    --fs-blur: none;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --fs-glass: var(--fs-glass-solid);
    --fs-glass-strong: var(--fs-glass-solid);
  }
}

/* ---------- The film set, continued ----------
   Opt in with body.fs-backdrop. The account home gets it once signed in; its sign-in
   screen (body.auth-screen without .is-signed-in) keeps its pinned photo and gradient.
   The still sits on fixed pseudo-elements BEHIND the page (z-index -1, body left
   transparent so the root background is the ground), so nothing repaints on scroll. */
body.fs-backdrop,
body.auth-screen.is-signed-in {
  background: transparent;
  color: var(--fs-ink);
}

body.fs-backdrop::before,
body.auth-screen.is-signed-in::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
  pointer-events: none;
  content: "";
  background-color: var(--fs-ground);
  background-image: url("/assets/login-bg/login-studio.jpg");
  background-image: -webkit-image-set(
    url("/assets/login-bg/login-studio.avif") type("image/avif"),
    url("/assets/login-bg/login-studio.webp") type("image/webp"),
    url("/assets/login-bg/login-studio.jpg") type("image/jpeg")
  );
  background-image: image-set(
    url("/assets/login-bg/login-studio.avif") type("image/avif"),
    url("/assets/login-bg/login-studio.webp") type("image/webp"),
    url("/assets/login-bg/login-studio.jpg") type("image/jpeg")
  );
  background-size: cover;
  background-position: 100% 50%;
  background-repeat: no-repeat;
  filter: blur(28px) brightness(.38) saturate(1.1);
  transform: scale(1.08);
  will-change: transform;
  opacity: 1;
  animation: none;
}

/* Two practical lights (a red key top-right, a warm fill bottom-left) and a vignette. */
body.fs-backdrop::after,
body.auth-screen.is-signed-in::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(60% 55% at 88% 12%, rgba(255, 40, 30, .30), transparent 60%),
    radial-gradient(40% 50% at 8% 88%, rgba(255, 120, 60, .16), transparent 65%),
    radial-gradient(130% 100% at 50% 40%, transparent 55%, rgba(0, 0, 0, .55) 100%);
  opacity: 1;
  animation: none;
}

/* ---------- Glass ---------- */
.fs-glass,
.fs-glass-strong {
  color: var(--fs-ink);
  background: var(--fs-glass);
  -webkit-backdrop-filter: var(--fs-blur);
  backdrop-filter: var(--fs-blur);
  border: 1px solid var(--fs-line);
  border-radius: var(--fs-radius);
}

.fs-glass-strong {
  background: var(--fs-glass-strong);
}

/* ---------- Tones (tiles, banners, pills read these) ---------- */
.fs-tile,
.fs-banner {
  --fs-tone-label: var(--fs-ink-2);
  --fs-tone-sub: var(--fs-ink-2);
  --fs-tone-action: var(--fs-link);
  --fs-tone-art: var(--fs-ink-3);
  --fs-tone-track: rgba(255, 255, 255, .14);
}

.fs-tile--good,
.fs-banner--good {
  --fs-tone-label: var(--fs-good-label);
  --fs-tone-sub: rgba(255, 255, 255, .80);
  --fs-tone-action: var(--fs-good-action);
  --fs-tone-art: var(--fs-good-ring);
  --fs-tone-track: rgba(255, 255, 255, .16);
}

.fs-tile--warn,
.fs-banner--warn {
  --fs-tone-label: var(--fs-warn-label);
  --fs-tone-action: var(--fs-warn-action);
  --fs-tone-art: var(--fs-warn);
  --fs-tone-track: rgba(242, 169, 59, .22);
}

.fs-tile--danger,
.fs-banner--danger {
  --fs-tone-label: var(--fs-danger-label);
  --fs-tone-action: var(--fs-danger-action);
  --fs-tone-art: var(--fs-danger);
  --fs-tone-track: rgba(255, 90, 74, .34);
}

.fs-tile--info,
.fs-banner--info {
  --fs-tone-label: var(--fs-info-label);
  --fs-tone-action: var(--fs-info-action);
  --fs-tone-art: var(--fs-info);
  --fs-tone-track: rgba(91, 140, 255, .24);
}

/* ---------- State tile ---------- */
.fs-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  min-height: 176px;
  padding: 20px 20px 16px;
  color: var(--fs-ink);
  background-color: var(--fs-glass);
  -webkit-backdrop-filter: var(--fs-blur);
  backdrop-filter: var(--fs-blur);
  border: 1px solid var(--fs-line);
  border-radius: var(--fs-radius);
}

/* The good tile keeps the spec gradient over a thin dark base, so white text stays
   at or above 4.5:1 over the brightest part of the still. */
.fs-tile--good {
  background-color: rgba(12, 12, 15, .30);
  background-image: var(--fs-good-tint);
  border-color: var(--fs-good-line);
}

.fs-tile--warn {
  background-image: linear-gradient(var(--fs-warn-tint), var(--fs-warn-tint));
  border-color: var(--fs-warn-line);
}

.fs-tile--danger {
  background-image: linear-gradient(var(--fs-danger-tint), var(--fs-danger-tint));
  border-color: var(--fs-danger-line);
}

.fs-tile--info {
  background-image: linear-gradient(var(--fs-info-tint), var(--fs-info-tint));
  border-color: var(--fs-info-line);
}

/* The heading forms match the specificity of page rules such as `.account-home h2`
   (tokens.css loads later, so it wins the tie). */
.fs-kicker,
:is(h2, h3, h4, p).fs-kicker {
  margin: 0;
  color: var(--fs-tone-label, var(--fs-ink-2));
  font: 600 11px/1.3 var(--fs-font);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.fs-value {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  margin: 2px 0 0;
  max-width: 100%;
  color: var(--fs-ink);
  font: 700 clamp(28px, 2.5vw, 38px)/1.05 var(--fs-font);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.fs-value--word {
  font-size: clamp(26px, 2.2vw, 32px);
}

.fs-unit {
  color: var(--fs-tone-sub, var(--fs-ink-2));
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
}

.fs-sub {
  margin: 0;
  color: var(--fs-tone-sub, var(--fs-ink-2));
  font-size: 13px;
  line-height: 1.5;
}

.fs-tile-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  margin-top: auto;
  color: var(--fs-tone-action, var(--fs-link));
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.fs-tile-link:hover {
  color: var(--fs-tone-action, var(--fs-link));
  text-decoration: underline;
}

/* ---------- Illustration hosts ---------- */
.fs-art {
  display: block;
  color: var(--fs-tone-art, var(--fs-ink-3));
}

.fs-art--corner {
  position: absolute;
  top: 16px;
  right: 16px;
}

.fs-ring {
  display: block;
  width: 64px;
  height: 64px;
  overflow: visible;
}

.fs-ring-track {
  fill: none;
  stroke: var(--fs-tone-track, rgba(255, 255, 255, .14));
  stroke-width: 6;
}

.fs-ring-value {
  fill: none;
  stroke: var(--fs-tone-art, var(--fs-good-ring));
  stroke-width: 6;
  stroke-linecap: round;
}

.fs-meter {
  display: block;
  width: 100%;
  height: 8px;
}

.fs-meter-track {
  fill: rgba(255, 255, 255, .12);
}

.fs-meter-fill {
  fill: var(--fs-good);
}

.fs-screens {
  display: flex;
  gap: 10px;
}

.fs-screen {
  display: block;
  width: 40px;
  height: 31px;
  overflow: visible;
}

.fs-screen-frame {
  fill: rgba(255, 255, 255, .03);
  stroke: rgba(255, 255, 255, .34);
  stroke-width: 2;
}

.fs-screen-stand {
  fill: rgba(255, 255, 255, .34);
}

.fs-screen.is-lit .fs-screen-frame {
  fill: rgba(47, 203, 122, .18);
  stroke: var(--fs-good);
}

.fs-screen.is-lit .fs-screen-stand {
  fill: var(--fs-good);
}

.fs-screen.is-lit {
  filter: drop-shadow(0 0 6px rgba(47, 203, 122, .45));
}

.fs-plate {
  display: block;
  width: 96px;
  height: 31px;
  overflow: visible;
}

.fs-plate-shape {
  fill: var(--fs-brand-red);
}

.fs-plate-label {
  fill: #FFFFFF;
  font: 700 13px var(--fs-font);
  letter-spacing: .16em;
}

.fs-bracket,
.fs-wave {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  overflow: visible;
}

.fs-bracket path,
.fs-wave-path {
  fill: none;
  stroke: var(--fs-brand-red);
  stroke-width: 3;
}

.fs-bracket .fs-bracket-link {
  stroke: var(--fs-ink-2);
  stroke-width: 2;
  stroke-dasharray: 4 4;
}

.fs-bracket.is-linked .fs-bracket-link {
  stroke: var(--fs-good);
  stroke-dasharray: none;
}

.fs-seats {
  display: block;
  height: 30px;
  width: auto;
  max-width: 100%;
}

.fs-seat {
  fill: rgba(255, 255, 255, .22);
  font: 700 18px var(--fs-font);
}

.fs-seat.is-filled {
  fill: var(--fs-good);
}

/* ---------- Banner ---------- */
.fs-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  padding: 20px 22px;
  color: var(--fs-ink);
  background-color: var(--fs-glass);
  -webkit-backdrop-filter: var(--fs-blur);
  backdrop-filter: var(--fs-blur);
  border: 1px solid var(--fs-line);
  border-radius: var(--fs-radius);
}

.fs-banner--good { background-image: var(--fs-good-tint); border-color: var(--fs-good-line); }
.fs-banner--warn { background-image: linear-gradient(var(--fs-warn-tint), var(--fs-warn-tint)); border-color: var(--fs-warn-line); }
.fs-banner--danger { background-image: linear-gradient(var(--fs-danger-tint), var(--fs-danger-tint)); border-color: var(--fs-danger-line); }
.fs-banner--info { background-image: linear-gradient(var(--fs-info-tint), var(--fs-info-tint)); border-color: var(--fs-info-line); }

.fs-banner-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1 1 320px;
}

.fs-banner-title,
:is(h2, h3, p).fs-banner-title {
  margin: 0;
  color: var(--fs-ink);
  font: 700 clamp(19px, 1.6vw, 22px)/1.25 var(--fs-font);
  letter-spacing: -.01em;
  text-transform: none;
}

/* ---------- Grace banner (account-status.js) ----------
   "Your account will be deleted on <date>. Keep my account" — inside the page layout on
   every account page: amber while there is time, red in the last seven days, green once
   kept. The ring drains over the grace period with the days left inside it. */
.fs-grace {
  margin: 0 0 20px;
}

.fs-grace[hidden],
.fs-grace-count[hidden] {
  display: none;
}

/* Pages still on the centred stage (billing returns, referral) get a banner as wide as their panel. */
.stage > .fs-grace {
  width: min(100%, 46rem);
  margin: 0 auto 16px;
}

.fs-grace .fs-banner-copy {
  gap: 4px;
}

.fs-grace-count {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  width: 64px;
  height: 64px;
  flex: none;
}

.fs-grace-count > .fs-art {
  position: absolute;
  inset: 0;
}

.fs-grace-days {
  position: relative;
  color: var(--fs-ink);
  font: 700 20px/1 var(--fs-font);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.fs-grace-unit {
  position: relative;
  margin-top: 3px;
  color: var(--fs-tone-label, var(--fs-ink-2));
  font: 600 11px/1 var(--fs-font);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.fs-grace .fs-banner-title:focus {
  outline: none;
}

.fs-grace .fs-banner-title:focus-visible {
  outline: 2px solid var(--fs-focus);
  outline-offset: 3px;
}

/* Page-wide button rules (styles.css, account-home.css, a page's own `x button`) must not
   restyle the one red action, at rest or on hover. */
.fs-grace .fs-button--primary {
  flex: none;
  color: #FFFFFF;
  background: var(--fs-action);
  border-color: var(--fs-action);
}

.fs-grace .fs-button--primary:hover:not(:disabled) {
  color: #FFFFFF;
  background: var(--fs-action-hover);
  border-color: var(--fs-action-hover);
}

/* ---------- Pill ---------- */
.fs-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 10px;
  color: var(--fs-ink);
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--fs-line-strong);
  border-radius: var(--fs-radius-pill);
  font: 600 12px/1.3 var(--fs-font);
  letter-spacing: .01em;
  white-space: nowrap;
}

.fs-pill::before {
  width: 6px;
  height: 6px;
  flex: none;
  content: "";
  background: currentColor;
  border-radius: 50%;
}

.fs-pill--good { color: var(--fs-good-label); background: rgba(47, 203, 122, .14); border-color: var(--fs-good-line); }
.fs-pill--warn { color: var(--fs-warn-label); background: rgba(242, 169, 59, .14); border-color: var(--fs-warn-line); }
.fs-pill--danger { color: var(--fs-danger-label); background: rgba(229, 57, 43, .16); border-color: var(--fs-danger-line); }
.fs-pill--info { color: var(--fs-info-label); background: rgba(91, 140, 255, .14); border-color: var(--fs-info-line); }

/* ---------- Buttons (also neutralise styles.css's chamfer, caps and ↗) ---------- */
.fs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 20px;
  color: var(--fs-ink);
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--fs-line-strong);
  border-radius: var(--fs-radius-ctl);
  clip-path: none;
  font: 600 15px/1.2 var(--fs-font);
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
}

.fs-button::after {
  content: none;
}

.fs-button:hover {
  color: var(--fs-ink);
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .30);
}

.fs-button--primary,
.fs-button--primary:hover {
  color: #FFFFFF;
}

.fs-button--primary {
  background: var(--fs-action);
  border-color: var(--fs-action);
}

.fs-button--primary:hover {
  background: var(--fs-action-hover);
  border-color: var(--fs-action-hover);
}

.fs-button:disabled {
  cursor: wait;
  opacity: .55;
}

:is(.fs-button, .fs-tile-link, .fs-banner a, .fs-toast button):focus-visible {
  outline: 2px solid var(--fs-focus);
  outline-offset: 3px;
}

/* ---------- Empty state and toast ---------- */
.fs-empty {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 24px;
  color: var(--fs-ink-2);
}

.fs-empty .fs-art {
  width: min(100%, 200px);
}

.fs-toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 14px 12px 18px;
  color: var(--fs-ink);
  background: var(--fs-glass-strong);
  -webkit-backdrop-filter: var(--fs-blur);
  backdrop-filter: var(--fs-blur);
  border: 1px solid var(--fs-line-strong);
  border-radius: var(--fs-radius-ctl);
  box-shadow: var(--fs-shadow);
  font-size: 14px;
  transform: translateX(-50%);
}

.fs-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Simple page: one centred glass card over the film set ----------
   <body class="fs-backdrop fs-page"> <div class="fs-page-shell"> header.fs-page-top,
   main.fs-page-main > article.fs-glass.fs-page-card, footer.fs-page-foot.
   Used by the billing return pages and the referral landing. */
.fs-page-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  font-family: var(--fs-font);
}

.fs-page-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 20px clamp(16px, 4vw, 48px);
}

.fs-page-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--fs-ink);
  font: 700 19px/1 var(--fs-font);
  letter-spacing: -.01em;
  text-decoration: none;
}

.fs-page-brand:hover {
  color: var(--fs-ink);
}

.fs-page-brand img {
  width: 36px;
  height: 36px;
}

.fs-page-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--fs-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.fs-page-main {
  display: grid;
  place-items: center;
  padding: 16px 16px 56px;
}

.fs-page-card {
  display: grid;
  gap: 16px;
  width: min(100%, 580px);
  padding: clamp(24px, 4vw, 40px);
}

.fs-page-card h1 {
  max-width: none;
  margin: 0;
  color: var(--fs-ink);
  font: 700 clamp(30px, 4vw, 40px)/1.08 var(--fs-font);
  letter-spacing: -.02em;
}

.fs-lede {
  margin: 0;
  color: var(--fs-ink-2);
  font-size: 16px;
  line-height: 1.6;
}

.fs-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.fs-page-note {
  margin: 0;
  color: var(--fs-ink-2);
  font-size: 13px;
  line-height: 1.6;
}

.fs-page-foot {
  padding: 16px clamp(16px, 4vw, 48px) 24px;
  color: var(--fs-ink-2);
  font-size: 12px;
  line-height: 1.6;
}

:is(.fs-page-brand, .fs-page-link, .fs-page-foot a):focus-visible {
  outline: 2px solid var(--fs-focus);
  outline-offset: 3px;
}

@media (max-width: 520px) {
  .fs-page-actions .fs-button {
    width: 100%;
  }
}
