/* ============================================================================
   15. Video (generic WebRTC transport block)
   ----------------------------------------------------------------------------
   Rendered by components/video.rs, driven by static/webrtc.js. One block
   serves both a video-calling page and a camera live-view page. The media
   stage is a fixed 16:9 frame; the local camera sits in a corner PIP.
   ========================================================================== */

.video {
  padding: 1.25rem;
  border: 1px solid var(--ta-border-strong);
  border-radius: var(--ta-r-lg);
  background: var(--ta-surface);
}

.video>h2 {
  margin: 0 0 1rem;
}

.video-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--ta-r);
  background: #000;
}

.video-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-remote {
  background: #000;
}

/* Local camera: a small picture-in-picture in the bottom-right corner. */
.video-local {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  width: 26%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--ta-r-sm);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.video-stage-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.video-tag {
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--ta-border);
  border-radius: 999px;
  color: var(--ta-muted);
  font-family: var(--ta-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.video-status {
  flex: 1;
  margin: 0;
  color: var(--ta-muted);
  font-family: var(--ta-mono);
  font-size: 0.8rem;
}

.video-status-err {
  color: var(--ta-err);
}

.video-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.video-picker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.video-picker label {
  color: var(--ta-muted);
  font-size: 0.85rem;
}

.video-picker select {
  max-width: 26rem;
}

/* Buttons inside the video block reuse the flat hairline language, with a
   solid accent for the primary action and a red destructive Leave. */
.video .btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--ta-border-strong);
  border-radius: var(--ta-r-sm);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease,
    color 0.12s ease;
}

.video .btn:hover {
  border-color: var(--ta-accent);
  color: var(--ta-accent);
}

.video .btn.primary {
  background: var(--ta-accent);
  border-color: var(--ta-accent);
  color: #fff;
}

.video .btn.primary:hover {
  background: var(--ta-accent-hover);
  border-color: var(--ta-accent-hover);
  color: #fff;
}

.video .btn.danger {
  color: var(--ta-err);
  border-color: var(--ta-border);
}

.video .btn.danger:hover {
  border-color: var(--ta-err);
  background: rgba(214, 69, 69, 0.06);
}

.video-rooms {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--ta-border);
}

.video-rooms h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.video-room-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.video-room-list li {
  padding: 0.3rem 0;
}

.video-room-list a {
  color: var(--ta-accent);
  text-decoration: none;
}


/* ============================================================================
   15. Auth pages (login / signup)
   ----------------------------------------------------------------------------
   The split-screen auth layout shared by login and signup: the auth form in a
   panel, and the app's home-hero media (video or picture — the same `image`
   as the landing hero, so there's nothing to configure) full-bleed beside it
   on wide screens. The media element is `.auth-visual-el` and fills the side
   with object-fit: cover, exactly like the marketing hero.
   ========================================================================== */

.auth-split {
  min-height: 100svh;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  min-height: 100svh;
}

/* Full-bleed hero media side (video autoplays, images cover). */
.auth-visual {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: var(--ta-surface-2);
}

.auth-visual-el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Video autoplay + muted loop, so the hero clip animates behind the form. */
  display: block;
}

/* The form panel: brand, heading, sub, form, foot link. */
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.auth-brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.auth-panel h2 {
  margin: 0.25rem 0 0;
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.auth-sub {
  margin: -0.35rem 0 0;
  color: var(--ta-muted);
  font-size: 0.95rem;
}

/* The signup-approval holding screen (`signup: { approval: required }`):
   a centered icon + copy + note inside the auth panel — "being reviewed"
   (auto-advances on approval) or "not approved" (terminal). */
.auth-pending {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  text-align: center;
  margin-top: 0.75rem;
}

.auth-pending-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--ta-r-md, var(--ta-r));
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}

.auth-pending-icon span {
  color: var(--ta-warn, var(--ta-accent));
}

.auth-pending .auth-sub {
  max-width: 22rem;
  margin: 0;
  font-size: 1rem;
}

.auth-pending-note {
  margin: 0;
  color: var(--ta-muted);
  font-size: 0.85rem;
}

/* The auth form (login + signup share these controls). */
.auth-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.5rem;
}

.auth-form .field {
  display: grid;
  gap: 0.35rem;
}

.auth-form label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ta-muted);
}

/* A label row with a right-aligned action (e.g. "Forgot your password?"). */
.auth-form .field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-form .forgot-link {
  font-size: 0.8rem;
  color: var(--ta-accent-ink, var(--ta-accent));
  text-decoration: none;
}

.auth-form input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--ta-border-strong);
  border-radius: var(--ta-r-sm);
  background: var(--ta-surface);
  color: var(--ta-text);
  font: inherit;
}

.auth-form input:focus {
  outline: 2px solid var(--ta-accent);
  outline-offset: 1px;
  border-color: var(--ta-accent);
}

.auth-form .auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--ta-muted);
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
}

.auth-form .auth-terms input {
  width: auto;
  margin-top: 0.15rem;
  accent-color: var(--ta-accent);
}

.auth-submit {
  margin-top: 0.35rem;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: var(--ta-r-sm);
  background: var(--ta-accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.auth-submit:hover {
  background: var(--ta-accent-hover);
}

/* Inline error box (wrong password, failed signup). */
.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(214, 69, 69, 0.35);
  border-radius: var(--ta-r-sm);
  background: rgba(214, 69, 69, 0.08);
  color: var(--ta-err);
  font-size: 0.88rem;
}

.auth-error svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  margin-top: 0.05rem;
}

/* The "New here?" / "Already have an account?" flip link. */
.auth-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.9rem;
  color: var(--ta-muted);
}

.auth-foot a {
  color: var(--ta-accent);
  font-weight: 600;
  text-decoration: none;
}

/* Narrow screens: no room for the hero media, so drop it and let the form
   take the full screen. */
@media (max-width: 900px) {
  .auth-card {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }

  .auth-panel {
    padding: 1.75rem 1.25rem 2.5rem;
  }
}

/* ============================================================================
   PARITY B13 — auth BLOCK ports (old blocks/auth-form.tsx,
   auth-custom-field.tsx, auth-signup-fields.tsx). These are standalone blocks
   that render entirely with the old Tailwind classes (see the forms.css B13
   section for the shared control tokens); the rules below hold anything
   bespoke an auth card composition needs when a login/signup page is built
   from the blocks.
   ========================================================================== */