/*
 * TeamWFA Assist — field web client.
 * Ported 1:1 (pixel parity) from artifacts/figma-tv-ui/twfa-desktop-preview.html
 * block `#assist-field` / `.af-*` (ASSIST_PREVIEW_BEGIN…END).
 * The preview wraps this in a decorative `.af-phone` bezel for side-by-side
 * viewing — the real app fills the actual browser viewport instead.
 * See .cursor/rules/preview-app-parity.mdc.
 */
:root {
  --font: 'Inter', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font);
  background: #0b1220;
}

.af-root {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.af-panel {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.af-panel.active {
  display: flex;
}
.af-panel.light {
  background: #f0f2f5;
  color: #0f1929;
}
.af-panel.dark {
  background: #0b1220;
  color: #e2e8f0;
}

.af-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 22px calc(24px + env(safe-area-inset-bottom));
  gap: 14px;
  text-align: center;
  overflow-y: auto;
}
.af-hero .mark {
  width: 56px;
  height: 56px;
}
.af-hero h2 {
  margin: 0;
  font: 600 20px/1.25 var(--font);
}
.af-hero p {
  margin: 0;
  font: 400 14px/1.45 var(--font);
  color: #64748b;
}
.af-hero.dark p,
.af-panel.dark .af-hero p {
  color: #94a3b8;
}

.af-field {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.af-field label {
  font: 500 12px/1.2 var(--font);
  color: #64748b;
}
.af-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #c5cedb;
  font: 400 15px/1.2 var(--font);
  background: #fff;
}

.af-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.af-actions .assist-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
}

.af-perm-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.af-perm-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: #fff;
  border: 1px solid #d8dee8;
  border-radius: 12px;
}
.af-perm-item strong {
  display: block;
  font: 600 13px/1.2 var(--font);
}
.af-perm-item span {
  font: 400 12px/1.35 var(--font);
  color: #64748b;
}
.af-privacy-note {
  width: 100%;
  text-align: left;
  font: 400 11px/1.5 var(--font);
  color: #8593a8;
  background: #e8ecf2;
  border-radius: 10px;
  padding: 10px 12px;
}
.af-perm-error {
  width: 100%;
  text-align: left;
  font: 500 12px/1.4 var(--font);
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 10px;
  padding: 10px 12px;
}

.af-live-cam {
  flex: 1;
  position: relative;
  background: linear-gradient(180deg, #243047 0%, #121a2b 100%);
  overflow: hidden;
}
.af-cam-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.af-live-cam .hint-scan {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
  max-width: 320px;
  font: 500 14px/1.4 var(--font);
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.af-banner {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 4;
  background: rgba(185, 28, 28, 0.92);
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font: 500 12px/1.35 var(--font);
  display: none;
}
.af-banner.show {
  display: block;
}
.af-freeze-badge {
  position: absolute;
  left: 12px;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 4;
  background: rgba(15, 25, 41, 0.85);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font: 600 11px/1 var(--font);
  display: none;
}
.af-freeze-badge.show {
  display: block;
}
.af-live-tools {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 12px 10px calc(18px + env(safe-area-inset-bottom));
  background: rgba(15, 25, 41, 0.92);
  gap: 4px;
  flex-shrink: 0;
}
.af-live-tools button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font: 500 10px/1 var(--font);
  cursor: pointer;
  min-width: 56px;
}
.af-live-tools button .ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #1a2740;
  display: grid;
  place-items: center;
  border: 1px solid #2e3f62;
}
.af-live-tools button .ico svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.af-live-tools button.danger .ico {
  background: #b91c1c;
  border-color: #b91c1c;
}
.af-live-tools button.muted .ico {
  background: #0060df;
  border-color: #0060df;
}
.af-ended .assist-btn {
  margin-top: 8px;
}

.assist-anchor {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -100%);
}
.assist-anchor .pin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 12px/1 var(--font);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.assist-anchor.expert .pin {
  background: #0060df;
}
.assist-anchor.field .pin {
  background: #10b981;
}
.assist-anchor .cap {
  margin-top: 4px;
  font: 500 11px/1.2 var(--font);
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.assist-btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font: 600 13px/1.2 var(--font);
  cursor: pointer;
}
.assist-btn.primary {
  background: #0060df;
  color: #fff;
}
.assist-btn.ghost {
  background: #e8eef6;
  color: #0f1929;
}
