/*
  Design plan (v2 — matched to reference screenshot supplied by the client)
  --------------------------------------------------------------------------
  Light, clean video-call aesthetic instead of the earlier dark broadcast
  theme. Single floating white card, modest-sized video panes side by side,
  a persistent violet border around the AI interviewer's photo (not a
  pulsing ring around abstract text), a pill-shaped recording timer, and a
  red "End call" pill — all matched to the client's reference design.

  Color (named):
    --bg          #EEF0F4  page background behind the card
    --card        #FFFFFF  the call card itself
    --border      #E5E7EB  hairline dividers
    --text        #16181D  primary text
    --text-dim    #6B7280  secondary text
    --accent      #6C4CF0  violet — AI interviewer border/highlight
    --accent-soft rgba(108,76,240,0.16)
    --danger      #E5484D  End call
    --danger-soft rgba(229,72,77,0.12)
    --success     #2FB380  connected status

  Type: "Fraunces" for headlines/card titles, "IBM Plex Sans" for UI/labels
  — unchanged from v1, still fits a clean professional interview product.
*/

:root {
  --bg: #EEF0F4;
  --card: #FFFFFF;
  --panel-raised: #F5F6F8;
  --border: #E5E7EB;
  --text: #16181D;
  --text-dim: #6B7280;
  --accent: #6C4CF0;
  --accent-soft: rgba(108, 76, 240, 0.16);
  --danger: #E5484D;
  --danger-soft: rgba(229, 72, 77, 0.12);
  --success: #2FB380;
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "IBM Plex Sans", -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; }

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

.hidden { display: none !important; }

/* ---------- generic screen scaffolding ---------- */
.screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.screen--center {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.status-line {
  color: var(--text-dim);
  font-size: 15px;
}

/* ---------- card (landing / invalid / complete screens) ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 2px 24px rgba(16, 24, 40, 0.06);
  padding: 40px;
  max-width: 420px;
  width: 100%;
}

.card--wide { max-width: 560px; }

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.25;
  margin: 0 0 16px;
}

.card-title span { color: var(--accent); }

.card-body {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 24px;
}

.card-footnote {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin: 8px 0 0;
}

/* ---------- device check ---------- */
.device-check {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.device-check-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: var(--panel-raised);
}

.device-check-empty p {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0;
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn--wide { width: 100%; margin-top: 20px; border-radius: 10px; }

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
}
.btn--primary:hover { background: #5B3DE0; }
.btn--primary:disabled {
  background: var(--panel-raised);
  color: var(--text-dim);
  cursor: not-allowed;
}

.btn--accent {
  background: var(--accent);
  color: #fff;
}
.btn--accent:hover { background: #5B3DE0; }

.btn--danger {
  background: var(--danger);
  color: #fff;
}
.btn--danger:hover { background: #D33E43; }

.btn--end-call {
  background: var(--danger);
  color: #fff;
  padding: 10px 22px;
  font-weight: 600;
}
.btn--end-call:hover { background: #D33E43; }

.btn--ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
}
.btn--ghost:hover { color: var(--text); border-color: var(--text-dim); }

/* ---------- interview call card ---------- */
.screen-interview-wrap,
#screen-interview {
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.call-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(16, 24, 40, 0.08);
  width: 100%;
  max-width: 700px;
  overflow: hidden;
}

/* ---------- top bar ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.top-bar-logo {
  height: 55px;
  width: auto;
  display: block;
}

.top-bar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 13px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}
.status-dot--live { background: var(--success); }
.status-dot--speaking { background: var(--accent); }

/* ---------- stage (dual pane) ---------- */
.stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px 24px 8px;
}

.pane {
  position: relative;
  aspect-ratio: 4 / 3.1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel-raised);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pane--ai {
  border: 2.5px solid var(--accent);
  transition: box-shadow 0.3s ease;
}
.pane--ai.speaking {
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.ai-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
}

.pane-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(20, 20, 28, 0.55);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 5px 12px;
  border-radius: 999px;
}

.pane--candidate {
  border: 1px solid var(--border);
  background: #1C1E24;
}

.pane--candidate #self-view {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.pane-caption-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0 24px 4px;
}

.candidate-caption {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
}
.candidate-caption small {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 12px;
}

/* ---------- caption strip ---------- */
.caption-strip {
  margin: 12px 24px 0;
  padding: 14px 16px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 70px;
}

.caption-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.02em;
  font-weight: 600;
  text-transform: uppercase;
}

.caption-question {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.4;
  color: var(--text);
}

.caption-transcript {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  min-height: 16px;
}

/* ---------- control bar ---------- */
.control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px 24px;
}

.control-bar-left {
  display: flex;
  gap: 10px;
}

.control-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-raised);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.control-btn:hover { background: var(--border); }
.control-btn.active { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }

.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 8px 14px;
  border-radius: 999px;
}

.timer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
}

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 18, 24, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(16, 24, 40, 0.12);
  padding: 28px;
  max-width: 380px;
  width: 90%;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 12px;
}

.modal-body {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 22px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---------- progress ---------- */
.progress-track {
  height: 4px;
  background: var(--panel-raised);
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .call-card { border-radius: 0; max-width: 100%; }
  .pane-caption-row .candidate-caption { grid-column: 2; }
}
