/* ============================================================
   D365 Contact Center Playground — Stylesheet
   Light theme is the default (defined in :root).
   Dark theme is applied via body:not(.theme-light).
   ============================================================ */


/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }


/* ============================================================
   Design Tokens — Light theme (default)
   ============================================================ */
:root {
  --bg-deep:            #f5f7fa;
  --bg-surface:         #ffffff;
  --bg-elevated:        #eef2f7;

  --glass-border:       rgba(0, 44, 92, 0.08);
  --glass-border-hover: rgba(0, 44, 92, 0.14);

  --text:               #111827;
  --text-secondary:     #374151;
  --text-muted:         #6b7280;

  --accent:             #0078d4;
  --accent-bright:      #106ebe;
  --accent-glow:        rgba(0, 120, 212, 0.2);
  --cyan:               #0891b2;
  --cyan-glow:          rgba(8, 145, 178, 0.2);
  --green:              #059669;
  --green-glow:         rgba(5, 150, 105, 0.25);
  --red:                #dc2626;
  --red-glow:           rgba(220, 38, 38, 0.2);
  --yellow:             #d97706;
  --yellow-glow:        rgba(217, 119, 6, 0.2);

  --radius:             16px;
  --radius-sm:          10px;
  --radius-lg:          24px;
}


/* ============================================================
   Dark Theme — when body does NOT have .theme-light
   ============================================================ */
body:not(.theme-light) {
  --bg-deep:            #0a0e1a;
  --bg-surface:         #0f1424;
  --bg-elevated:        #0f1424;

  --glass-border:       rgba(100, 160, 255, 0.1);
  --glass-border-hover: rgba(100, 160, 255, 0.2);

  --text:               #e8ecf4;
  --text-secondary:     #8b95b0;
  --text-muted:         #525e7a;

  --accent:             #3b82f6;
  --accent-bright:      #60a5fa;
  --accent-glow:        rgba(59, 130, 246, 0.35);
  --cyan:               #22d3ee;
  --cyan-glow:          rgba(34, 211, 238, 0.2);
  --green:              #34d399;
  --green-glow:         rgba(52, 211, 153, 0.3);
  --red:                #f87171;
  --red-glow:           rgba(248, 113, 113, 0.3);
  --yellow:             #fbbf24;
  --yellow-glow:        rgba(251, 191, 36, 0.3);
}


/* ============================================================
   Base
   ============================================================ */
html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}



/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--glass-border);
}
body:not(.theme-light) .nav { background: rgba(10, 14, 26, 0.7); }

.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 2rem;
  height: 56px; display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { display: flex; align-items: center; }
.nav-logo-img { height: 22px; width: auto; opacity: 0.9; filter: brightness(0); }
body:not(.theme-light) .nav-logo-img { filter: brightness(1.1); }

.nav-right { display: flex; align-items: center; gap: 0.75rem; }
.nav-badge {
  font-size: 0.52rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--cyan); background: rgba(8, 145, 178, 0.08);
  border: 1px solid rgba(8, 145, 178, 0.15);
  padding: 0.22rem 0.7rem; border-radius: 100px;
}
body:not(.theme-light) .nav-badge {
  background: rgba(34, 211, 238, 0.08); border-color: rgba(34, 211, 238, 0.15);
}

.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(0, 44, 92, 0.06);
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: background 0.2s, border-color 0.2s;
}
.theme-toggle:hover { background: rgba(0, 44, 92, 0.1); }
body:not(.theme-light) .theme-toggle { background: rgba(255, 255, 255, 0.06); }
body:not(.theme-light) .theme-toggle:hover { background: rgba(255, 255, 255, 0.1); }

/* Show sun in dark mode, moon in light mode */
.theme-toggle .theme-icon-light                  { display: none; }
.theme-toggle .theme-icon-dark                   { display: inline; }
body.theme-light .theme-toggle .theme-icon-light { display: inline; }
body.theme-light .theme-toggle .theme-icon-dark  { display: none; }




/* ============================================================
   Hero
   ============================================================ */
.hero       { padding: 10rem 2rem 5rem; text-align: center; position: relative; overflow: hidden; z-index: 1; }
.hero-inner { position: relative; z-index: 2; max-width: 660px; margin: 0 auto; }

.hero-eyebrow {
  display: block; font-size: 1.5rem; font-weight: 700;
  letter-spacing: -0.02em; text-transform: none;
  color: var(--accent); margin-bottom: 1rem;
}
.hero-headline {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800; letter-spacing: -0.04em; line-height: 1.1;
  color: var(--text); margin-bottom: 1.25rem;
}
.hero-subheading {
  font-size: 1rem; font-weight: 400; color: var(--text-secondary);
  line-height: 1.65; max-width: 480px; margin: 0 auto 2rem;
}
.hero-ctas {
  display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center;
}

/* Shared button base */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; font-size: 0.95rem; font-weight: 600;
  border-radius: 100px; text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  border: none; cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
}
.btn-secondary {
  background: rgba(0, 44, 92, 0.06); color: var(--text);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
  background: rgba(0, 44, 92, 0.1); transform: translateY(-1px);
}
body:not(.theme-light) .btn-secondary { background: rgba(255, 255, 255, 0.08); }
body:not(.theme-light) .btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }



/* ============================================================
   Scenarios — interactive scenario tiles
   ============================================================ */
.scenarios       { padding: 0 2rem 5rem; position: relative; z-index: 1; }
.scenarios-inner { max-width: 1100px; margin: 0 auto; }

.scenarios-header  { text-align: center; margin-bottom: 2.5rem; }
.scenarios-eyebrow {
  display: block; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.6rem;
}
.scenarios-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700; letter-spacing: -0.03em; color: var(--text); margin-bottom: 0.5rem;
}
.scenarios-subtitle {
  font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6;
}

.scenarios-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem;
}

/* Individual tile */
.scenario-tile {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
}
.scenario-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border-color: var(--glass-border-hover);
}
body:not(.theme-light) .scenario-tile:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.scenario-tile:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}

/* Active (selected) state */
.scenario-tile--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 8px 32px rgba(0, 0, 0, 0.08);
}
body:not(.theme-light) .scenario-tile--active {
  box-shadow: 0 0 0 3px var(--accent-glow), 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Profile card header — centred avatar, name, role */
.persona-header {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.35rem; text-align: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--glass-border);
}

.persona-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; color: #fff;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  margin-bottom: 0.25rem;
}
.persona-avatar--blue   { background: linear-gradient(135deg, var(--accent), var(--cyan)); }
.persona-avatar--teal   { background: linear-gradient(135deg, var(--cyan), var(--green)); }
.persona-avatar--purple { background: linear-gradient(135deg, #6366f1, var(--accent)); }
.persona-avatar--orange { background: linear-gradient(135deg, #f97316, #f59e0b); }

.persona-name {
  font-size: 0.95rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em;
}
.persona-role {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--accent);
}

/* Scenario label + customer situation quote */
.persona-scenario { display: flex; flex-direction: column; gap: 0.4rem; }
.persona-scenario-label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
}
.persona-situation {
  font-size: 0.825rem; color: var(--text-secondary);
  line-height: 1.55; font-style: italic; margin: 0;
}

/* Demo credentials block */
.scenario-tile-meta  { display: flex; flex-direction: column; gap: 0.3rem; }
.scenario-meta-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.scenario-meta-items { display: flex; flex-direction: column; gap: 0.2rem; }
.scenario-meta-item  {
  font-size: 0.78rem; color: var(--text-secondary);
  background: rgba(0, 44, 92, 0.04); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 0.35rem 0.6rem;
}
body:not(.theme-light) .scenario-meta-item { background: rgba(255, 255, 255, 0.04); }
.scenario-meta-item strong { color: var(--text); }

/* ── Stacked-rows card (balance + payment in one tile) ── */
.scenario-tile--rows {
  display: flex; flex-direction: column; gap: 0;
}
.split-row {
  display: flex; flex-direction: column; gap: 0.65rem;
}
/* Make persona-header in split rows horizontal (avatar + text side by side) */
.split-row .persona-header {
  flex-direction: row; align-items: center; gap: 0.75rem;
  text-align: left; padding-bottom: 0;
}
.split-row-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 0.75rem 0;
}
/* Inline credential badge */
.split-cred {
  font-size: 0.75rem; padding: 0.2rem 0.5rem;
  white-space: nowrap;
}

/* Prompt chips */
.scenario-tile-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; }

.prompt-chip {
  font-size: 0.75rem; font-weight: 500; color: var(--text-secondary);
  background: var(--bg-elevated); border: 1px solid var(--glass-border);
  border-radius: 100px; padding: 0.3rem 0.75rem;
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.prompt-chip:hover {
  background: rgba(0, 120, 212, 0.08); border-color: rgba(0, 120, 212, 0.2);
  color: var(--accent);
}
body:not(.theme-light) .prompt-chip:hover {
  background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.25);
}
/* 2-second green flash after successful copy */
.prompt-chip--copied {
  background: rgba(5, 150, 105, 0.1) !important;
  border-color: rgba(5, 150, 105, 0.25) !important;
  color: var(--green) !important;
}

/* Feedback line below chips */
.scenario-tile-feedback {
  font-size: 0.75rem; color: var(--green); min-height: 1em;
  transition: opacity 0.2s;
}


/* ============================================================
   Interaction — single combined Deepgram-style card
   ============================================================ */
.interaction {
  padding: 5rem 2rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  position: relative; z-index: 1;
}

.interaction-inner { max-width: 900px; margin: 0 auto; }

.interaction-header  { text-align: center; margin-bottom: 2.5rem; }
.interaction-title   {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700; letter-spacing: -0.03em; color: var(--text); margin-bottom: 0.5rem;
}
.interaction-subtitle { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }


/* ---- Combined card ---- */
.dg-card {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
body:not(.theme-light) .dg-card {
  background: #0d1117;
  border-color: rgba(255,255,255,0.07);
  box-shadow: 0 8px 40px rgba(0,0,0,0.28);
}

/* ---- Two-column body ---- */
.dg-body {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: stretch;
  min-height: 480px;
}

/* ---- Vertical divider ---- */
.dg-divider {
  width: 1px;
  background: var(--glass-border);
  align-self: stretch;
}
body:not(.theme-light) .dg-divider { background: rgba(255,255,255,0.07); }

/* ---- Each column ---- */
.dg-col {
  padding: 2.5rem 2rem;
}

/* Voice column — centred vertically */
.dg-col-voice {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 0;
}

/* Form column */
.dg-col-form {
  display: flex; flex-direction: column; justify-content: center;
}

/* Agent name + timer */
.dg-agent-name {
  font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text); margin: 0.75rem 0 0.2rem;
}
.dg-timer {
  font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--text-muted); min-height: 1.1em; margin-bottom: 0.5rem;
}
body:not(.theme-light) .dg-agent-name { color: rgba(255,255,255,0.92); }
body:not(.theme-light) .dg-timer      { color: rgba(255,255,255,0.38); }

/* Form heading */
.dg-form-heading {
  font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text); margin-bottom: 0.3rem;
  display: flex; align-items: center; gap: 0.5rem;
}
body:not(.theme-light) .dg-form-heading { color: rgba(255,255,255,0.92); }

/* WIP / Coming Soon badge */
.wip-badge {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.12);
  color: var(--yellow);
  border: 1px solid rgba(217, 119, 6, 0.25);
  white-space: nowrap;
}
body:not(.theme-light) .wip-badge {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.2);
}

/* Reach note */
.dg-reach-note {
  margin-top: 1.5rem;
  font-size: 0.75rem; color: var(--text-muted); text-align: center;
}
.dg-reach-note strong { color: var(--text-secondary); font-weight: 500; }
body:not(.theme-light) .dg-reach-note        { color: rgba(255,255,255,0.25); }
body:not(.theme-light) .dg-reach-note strong { color: rgba(255,255,255,0.42); }

/* Form subtitle */
.case-form-subtitle {
  font-size: 0.82rem; color: var(--text-secondary);
  margin-bottom: 1.25rem; line-height: 1.5;
}
body:not(.theme-light) .case-form-subtitle { color: rgba(255,255,255,0.45); }

/* Form inputs inside dark card */
body:not(.theme-light) .dg-col-form .form-label { color: rgba(255,255,255,0.7); }
body:not(.theme-light) .dg-col-form .form-input {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}
body:not(.theme-light) .dg-col-form .form-input::placeholder { color: rgba(255,255,255,0.22); }

/* ---- Call status inside voice col ---- */
.dg-col-voice .call-status { font-size: 0.78rem; }
body:not(.theme-light) .dg-col-voice .call-status {
  color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1);
}
body:not(.theme-light) .dg-col-voice .call-status.connecting { color: var(--yellow); background: rgba(217,119,6,0.12); border-color: rgba(217,119,6,0.2); }
body:not(.theme-light) .dg-col-voice .call-status.active     { color: #34d399; background: rgba(52,211,153,0.1); border-color: rgba(52,211,153,0.2); }
body:not(.theme-light) .dg-col-voice .call-status.error      { color: #f87171; background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.2); }
body:not(.theme-light) .dg-col-voice .status-dot             { background: rgba(255,255,255,0.35); }
body:not(.theme-light) .dg-col-voice .call-status.active .status-dot     { background: #34d399; }
body:not(.theme-light) .dg-col-voice .call-status.connecting .status-dot { background: var(--yellow); animation: dotPulse 1.5s infinite; }
body:not(.theme-light) .dg-col-voice .call-status.error .status-dot      { background: #f87171; }


/* ---- Orb ---- */
.orb-wrap {
  width: 160px; height: 160px;
  display: flex; align-items: center; justify-content: center;
  position: relative; margin: 0.25rem 0 0;
}

/* Outer glow ring that pulses when speaking */
.orb-wrap::before {
  content: "";
  position: absolute; inset: -12px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,120,212,0.18) 0%, transparent 70%);
  opacity: 0; transition: opacity 0.6s ease;
}
.orb.speaking ~ * { /* handled via .orb-wrap.speaking instead */ }

.orb {
  width: 140px; height: 140px; border-radius: 50%;
  position: relative; overflow: hidden;
  background: #e8f0fb;
  box-shadow: inset 0 0 30px rgba(0,80,200,0.08), 0 2px 12px rgba(0,80,200,0.1);
  transition: box-shadow 0.6s ease;
  flex-shrink: 0;
}
body:not(.theme-light) .orb {
  background: #0d1117;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.6);
}

/* Animated blob inside the orb */
.orb-core {
  position: absolute; inset: -20%;
  width: 140%; height: 140%;
  border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%;
  background: radial-gradient(ellipse at 40% 45%,
    rgba(0, 120, 212, 0.45) 0%,
    rgba(0, 188, 242, 0.25) 40%,
    rgba(99, 102, 241, 0.1) 65%,
    transparent 100%
  );
  animation: orbDrift 8s ease-in-out infinite;
  will-change: transform, border-radius;
}
body:not(.theme-light) .orb-core {
  background: radial-gradient(ellipse at 40% 45%,
    rgba(0, 120, 212, 0.55) 0%,
    rgba(0, 188, 242, 0.3) 35%,
    rgba(99, 102, 241, 0.15) 65%,
    transparent 100%
  );
}

@keyframes orbDrift {
  0%   { transform: translate(0, 0)     rotate(0deg)   scale(1);    border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%; }
  25%  { transform: translate(6px, -8px) rotate(90deg)  scale(1.04); border-radius: 55% 45% 40% 60% / 60% 55% 45% 40%; }
  50%  { transform: translate(-5px, 5px) rotate(180deg) scale(0.97); border-radius: 45% 55% 60% 40% / 40% 60% 45% 55%; }
  75%  { transform: translate(4px, 7px)  rotate(270deg) scale(1.03); border-radius: 60% 40% 45% 55% / 55% 45% 60% 40%; }
  100% { transform: translate(0, 0)     rotate(360deg) scale(1);    border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%; }
}

/* Speaking state: orb brightens and pulses */
.orb.speaking {
  animation: orbPulseLt 2.5s ease-in-out infinite;
}
body:not(.theme-light) .orb.speaking {
  animation: orbPulseDk 2.5s ease-in-out infinite;
}
.orb.speaking .orb-core {
  background: radial-gradient(ellipse at 40% 45%,
    rgba(0, 120, 212, 0.7) 0%,
    rgba(0, 188, 242, 0.45) 35%,
    rgba(99, 102, 241, 0.2) 65%,
    transparent 100%
  );
  animation: orbDrift 4s ease-in-out infinite;
}

@keyframes orbPulseLt {
  0%, 100% { box-shadow: inset 0 0 30px rgba(0,80,200,0.1), 0 0 20px rgba(0,120,212,0.18), 0 0 40px rgba(0,188,242,0.1); }
  50%      { box-shadow: inset 0 0 30px rgba(0,80,200,0.12), 0 0 35px rgba(0,120,212,0.28), 0 0 60px rgba(0,188,242,0.15); }
}
@keyframes orbPulseDk {
  0%, 100% { box-shadow: inset 0 0 40px rgba(0,0,0,0.4), 0 0 35px rgba(0,120,212,0.25), 0 0 70px rgba(0,188,242,0.12); }
  50%      { box-shadow: inset 0 0 40px rgba(0,0,0,0.3), 0 0 55px rgba(0,120,212,0.4),  0 0 100px rgba(0,188,242,0.2); }
}




/* ============================================================
   Call Status — pill badge
   ============================================================ */
.agent-status { margin-bottom: 0; }

.call-status {
  font-size: 0.85rem; font-weight: 600; color: var(--green);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.4rem 0.85rem; border-radius: 100px;
  background: rgba(5, 150, 105, 0.08); border: 1px solid rgba(5, 150, 105, 0.15);
  transition: all 0.3s;
}
body:not(.theme-light) .call-status { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.15); }
.agent-status .call-status { font-size: 0.8rem; }

.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
}

.call-status.connecting { color: var(--yellow); background: rgba(217, 119, 6, 0.08); border-color: rgba(217, 119, 6, 0.15); }
.call-status.connecting .status-dot { background: var(--yellow); animation: dotPulse 1.5s infinite; }
.call-status.active { color: var(--green); background: rgba(5, 150, 105, 0.12); border-color: rgba(5, 150, 105, 0.2); }
.call-status.active .status-dot { background: var(--green); }
.call-status.error { color: var(--red); background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.15); }
.call-status.error .status-dot { background: var(--red); }

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.3; transform: scale(0.8); }
}


/* ============================================================
   Call Controls — main call button + mute/speaker buttons
   ============================================================ */
.agent-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 1.1rem; margin-top: 1.5rem;
}

/* Secondary control buttons (mute / speaker) */
.ctrl-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.ctrl-btn:hover:not(:disabled) {
  background: var(--bg-surface);
  color: var(--text);
  border-color: var(--glass-border-hover);
}
.ctrl-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.ctrl-btn.muted {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.2);
  color: var(--red);
}
body:not(.theme-light) .ctrl-btn {
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.5);
}
body:not(.theme-light) .ctrl-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.18);
}
body:not(.theme-light) .ctrl-btn.muted {
  background: rgba(248,113,113,0.15);
  border-color: rgba(248,113,113,0.3);
  color: #f87171;
}

.agent-ctrl { width: 44px; height: 44px; }

/* Primary call button — solid round */
.call-btn {
  width: 60px; height: 60px; border-radius: 50%;
  border: none;
  background: #22c55e;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.35);
  flex-shrink: 0;
}
.call-btn:hover:not(:disabled) {
  background: #16a34a;
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45);
}
.call-btn:active { transform: scale(0.95); }
.call-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none; }

/* Hide the text label — icon-only in this layout */
.call-btn-label { display: none; }

/* Active = end call (red) */
.call-btn.active {
  background: #ef4444;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}
.call-btn.active:hover:not(:disabled) {
  background: #dc2626;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

/* Connecting (yellow, no click) */
.call-btn.connecting {
  background: rgba(251, 191, 36, 0.2);
  box-shadow: none;
  border: 1.5px solid rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}

/* agent-call-btn is the same element — no overrides needed */
.agent-call-btn { }


/* ============================================================
   Case Form (shared styles — used inside dark card panel)
   ============================================================ */

/* Two-column form row */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group-full { margin-bottom: 1rem; }

.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text); }

.form-input {
  width: 100%; padding: 0.65rem 0.9rem;
  font-size: 0.875rem; font-family: inherit; color: var(--text);
  background: var(--bg-deep); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
body:not(.theme-light) .form-input { background: rgba(255, 255, 255, 0.04); }
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-input:invalid:not(:placeholder-shown) { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }

.form-textarea { resize: vertical; min-height: 110px; line-height: 1.6; }

.form-footer { display: flex; justify-content: flex-end; margin-top: 0.5rem; }

.case-submit-btn { position: relative; min-width: 140px; }

/* CSS-only loading spinner */
.case-btn-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spinnerRotate 0.75s linear infinite; }
@keyframes spinnerRotate { to { transform: rotate(360deg); } }
.case-submit-btn.loading .case-btn-label  { visibility: hidden; }
.case-submit-btn.loading .case-btn-spinner { display: inline-block; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* Success / error banners */
.case-feedback {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.9rem 1.1rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; margin-top: 1rem; line-height: 1.5;
}
.case-feedback[hidden] { display: none; }
.case-success { background: rgba(5, 150, 105, 0.08); border: 1px solid rgba(5, 150, 105, 0.2); color: var(--green); }
.case-error   { background: rgba(220, 38, 38, 0.06); border: 1px solid rgba(220, 38, 38, 0.18); color: var(--red); }


/* ============================================================
   Logos Strip
   ============================================================ */
.logos-strip       { padding: 2rem 2rem 3rem; position: relative; z-index: 1; }
.logos-strip-inner { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.logos-strip-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; color: var(--text-muted); text-transform: uppercase; }
.logos-strip-list  { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2rem 2.5rem; }
.logo-item     { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }
.logo-item img { width: 28px; height: 28px; object-fit: contain; opacity: 0.75; filter: grayscale(0.3); }
body:not(.theme-light) .logo-item img { opacity: 0.85; }


/* ============================================================
   Footer
   ============================================================ */
.footer       { border-top: 1px solid var(--glass-border); padding: 2.5rem 2rem; position: relative; z-index: 1; }
.footer-inner { max-width: 1080px; margin: 0 auto; text-align: center; }
.footer-sub   { font-size: 0.72rem; color: var(--text-muted); }
.footer-sub strong { color: var(--text-secondary); font-weight: 600; }


/* ============================================================
   Responsive Breakpoints
   ============================================================ */

/* Tablet: scenarios 2-col, card stacks */
@media (max-width: 1024px) {
  .scenarios-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  /* Stack voice + form vertically, swap divider to horizontal */
  .dg-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1px auto;
  }
  .dg-divider {
    width: auto; height: 1px;
    grid-column: 1; grid-row: 2;
  }
  .dg-col-voice { padding-bottom: 2rem; }
  .dg-col-form  { padding-top: 2rem; }
}

/* Small tablet */
@media (max-width: 768px) {
  .hero        { padding: 7rem 1.5rem 2.5rem; }
  .scenarios   { padding: 0 1.5rem 3.5rem; }
  .interaction { padding: 3.5rem 1.5rem; }
  .nav-inner   { padding: 0 1rem; }
  .orb-wrap    { width: 140px; height: 140px; }
  .orb         { width: 120px; height: 120px; }
}

/* Phone */
@media (max-width: 600px) {
  .scenarios-grid { grid-template-columns: 1fr; }
  .hero-ctas        { flex-direction: column; }
  .btn              { width: 100%; max-width: 280px; }
  .logos-strip-list { gap: 1.5rem; }
  .form-row         { grid-template-columns: 1fr; }
  .dg-col           { padding: 1.75rem 1.25rem; }
}
