/* Florida AI Partners video room — dark, premium shell.
 * Brand tokens mirror the flagship (BaseLayout.astro): navy ink, Florida teal,
 * sunrise orange. The live call fills the viewport; the pre-join/fallback cards
 * sit on a navy aurora field with the real brand mark above the wordmark. */

:root {
  /* Brand tokens now flow from the canonical cross-spoke palette
     (/vendor/tokens.css). Aliases are byte-identical; a rebrand is a one-file
     swap there. meet stays on the LIGHT roles deliberately — its dark look comes
     from bespoke gradients in the component CSS below, NOT a dark token theme;
     flipping data-theme="dark" would shift the teal, so that's a later decision.
     --card/--line/--muted are dark-shell-specific and stay literal. */
  --ink: var(--color-ink);        /* deep navy */
  --brand: var(--color-brand);    /* Florida teal */
  --brand-deep: var(--color-brand-strong);
  --brand-bright: var(--fap-teal-bright, #3cc3da); /* teal for text on dark */
  --accent: var(--color-accent);  /* sunrise orange — the "AI" */
  --peach: var(--fap-peach, #fcccb4);
  --paper: var(--color-bg);       /* warm ivory */
  --card: #0a2d52;       /* lifted navy for the card */
  --line: rgba(255, 255, 255, 0.12);
  --muted: rgba(233, 240, 250, 0.72);
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Sora", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

/* State changes use the HTML `hidden` attribute. Keep it authoritative over
   component layout rules such as `.prejoin { display: flex; }`, otherwise a
   finished/failed join leaves the disabled "Connecting…" card on screen while
   the real fallback renders below it. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font-ui);
  color: #eef4fb;
  background: var(--ink);
}

/* ── Ambient brand field ──────────────────────────────────────────────────────
   A soft navy base with two slow-drifting brand-color blobs (teal + sun-glow)
   and a faint circuit grid — the flagship's "premium feel" at rest. Fixed behind
   everything, fully decorative, and GPU-cheap (transform/opacity only). It goes
   completely STILL under prefers-reduced-motion (see the motion block). */
.aura {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 720px at 74% -10%, rgba(0, 156, 168, 0.30), transparent 60%),
    radial-gradient(960px 640px at 6% 112%, rgba(252, 96, 0, 0.20), transparent 56%),
    linear-gradient(180deg, #003066 0%, #001c43 52%, #00112b 100%);
}
.aura__blob {
  position: absolute;
  width: 56vmax;
  height: 56vmax;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.7;
  will-change: transform;
}
.aura__blob--teal {
  top: -20vmax;
  right: -12vmax;
  background: radial-gradient(circle at 50% 50%, rgba(0, 156, 168, 0.7), transparent 64%);
  animation: aura-drift-a 26s ease-in-out infinite alternate;
}
.aura__blob--sun {
  bottom: -22vmax;
  left: -14vmax;
  background: radial-gradient(circle at 50% 50%, rgba(252, 96, 0, 0.42), rgba(252, 204, 180, 0.16) 45%, transparent 66%);
  animation: aura-drift-b 32s ease-in-out infinite alternate;
}
/* Faint circuit-board grid — a whisper of the brand mark's "traces". */
.aura__grid {
  position: absolute;
  inset: -2px;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(120, 190, 220, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 190, 220, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
}

@keyframes aura-drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-6vmax, 5vmax, 0) scale(1.12); }
}
@keyframes aura-drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to   { transform: translate3d(6vmax, -5vmax, 0) scale(0.92); }
}

/* Pre-join + fallback share the centered-card layout. The card sits on the
   ambient .aura layer above; this keeps a faint local glow for older browsers
   that skip the fixed background. */
.prejoin {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2rem 1.25rem;
}

.card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(12, 48, 86, 0.82), rgba(7, 31, 60, 0.86));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2.25rem 1.75rem 2rem;
  box-shadow:
    0 24px 60px rgba(0, 8, 25, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
}

/* ── Brand lockup: the real mark above the wordmark ── */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
}
.brandmark {
  width: 74px;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 6px 16px rgba(0, 156, 168, 0.28));
}
.brandmark .mk-teal { color: var(--brand-bright); }
.brandmark .mk-sun  { color: var(--accent); }
/* Circuit nodes — hollow stroked rings so the centre survives any size. */
.brandmark .mk-nodes circle { stroke: var(--accent); }

.wordmark {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.005em;
  font-size: 1.18rem;
  color: #eaf3fc;
  line-height: 1;
}

.title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  color: #fbfdff;
}

.room {
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}
.room strong {
  color: #fff;
  background: rgba(0, 156, 168, 0.16);
  border: 1px solid rgba(60, 195, 218, 0.28);
  border-radius: 7px;
  padding: 0.08em 0.5em;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.field {
  display: block;
  text-align: left;
  margin-bottom: 1rem;
}
.field span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.field input {
  width: 100%;
  padding: 0.8rem 0.9rem;
  font-size: 1rem;
  font-family: inherit;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field input::placeholder { color: rgba(233, 240, 250, 0.45); }
.field input:focus {
  border-color: var(--brand);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(0, 156, 168, 0.3);
}

/* Host sign-in area (Florida AI Partners team) */
.host {
  margin-top: 1.25rem;
}
.host__divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: rgba(207, 227, 244, 0.6);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.host__divider::before,
.host__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.host__btn {
  display: flex;
  justify-content: center;
  min-height: 40px;
}
.host__status {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--peach);
}
.host__status--error {
  color: #ff9b8a;
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 1.02rem;
  font-weight: 600;
  font-family: var(--font-head);
  letter-spacing: 0.01em;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 122, 131, 0.4);
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { filter: brightness(1.07); box-shadow: 0 10px 26px rgba(0, 122, 131, 0.5); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.7; cursor: default; box-shadow: none; }
/* Visible keyboard focus on the primary action + any link buttons. */
.btn:focus-visible,
.field input:focus-visible,
.hint a:focus-visible,
.footer a:focus-visible {
  outline: 3px solid var(--brand-bright);
  outline-offset: 2px;
}

.hint {
  margin: 0.9rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.hint a { color: var(--brand-bright); }

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  max-width: 420px;
  font-size: 0.78rem;
  color: rgba(207, 227, 244, 0.62);
  margin: 0;
  text-align: center;
  line-height: 1.5;
}
.footer__mark {
  width: 18px;
  height: 18px;
  flex: none;
  overflow: visible;
  opacity: 0.9;
}
.footer__mark .mk-teal { color: var(--brand-bright); }
.footer__mark .mk-sun  { color: var(--accent); }
.footer__mark .mk-nodes circle { stroke: var(--accent); }

/* ── Brand-mark ambient motion (opt-in; mirrors the flagship BrandMark) ──
   The six circuit nodes pulse in a slow data-flow wave — a quiet sign of life,
   not a distraction. Reduced motion shows the finished, lit mark with no
   animation (the resting state IS the final art). */
.brandmark .mk-nodes circle {
  transform-box: fill-box;
  transform-origin: center;
}
@media (prefers-reduced-motion: no-preference) {
  .brandmark .mk-nodes circle {
    animation: node-pulse 4.2s ease-in-out infinite;
    animation-delay: calc(var(--n) * 0.5s);
  }
  .aura__blob,
  .aura__grid { } /* drift animations defined above stay active */
}

@keyframes node-pulse {
  0%, 70%, 100% {
    stroke: var(--accent);
    filter: drop-shadow(0 0 2px rgba(252, 96, 0, 0.2));
  }
  10% {
    stroke: #ffd6b8;
    filter: drop-shadow(0 0 12px rgba(252, 140, 50, 0.85));
  }
  28% {
    stroke: var(--accent);
    filter: drop-shadow(0 0 5px rgba(252, 96, 0, 0.4));
  }
}

/* Reduced motion: freeze the ambient field and the node pulse entirely. The
   page still reads as fully branded — just static. */
@media (prefers-reduced-motion: reduce) {
  .aura__blob--teal,
  .aura__blob--sun,
  .brandmark .mk-nodes circle {
    animation: none !important;
  }
}

/* Live call fills the screen */
.call {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #04101f;
  z-index: 1;
}
.call iframe { width: 100% !important; height: 100% !important; border: 0; }

/* ── Small screens ── */
@media (max-width: 420px) {
  .card { padding: 2rem 1.35rem 1.85rem; border-radius: 18px; }
  .brandmark { width: 64px; }
  .title { font-size: 1.4rem; }
}
