/* Betty demo — clean minimal styles for the SDK-only trainer.
   Walmart Insurance Services / Sunfire palette per docs/SUNFIRE_DESIGN_SPEC.md
   in the monorepo: navy #2b71da, soft borders, white cards on light bg. */

:root {
  --navy: #2b71da;
  --navy-dark: #1f56b0;
  --bg: #f4f7fb;
  --card-bg: #ffffff;
  --border: #d9e3ef;
  --text: #1b2333;
  --text-soft: #5b6679;
  --danger: #d9342b;
  --danger-soft: #fff0ee;
  --ok: #2f9d63;
  --ok-soft: #eaf7ef;
  --warn: #d49814;
  --warn-soft: #fbf5e6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 50, 0.04), 0 8px 24px rgba(20, 30, 50, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────────────── */

.brand-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.brand-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-mark .brand-walmart {
  font-weight: 800;
  font-size: 22px;
  color: var(--navy);
}

.brand-mark .brand-insurance {
  font-weight: 700;
  font-size: 22px;
  color: #fdbb2f;
  margin-left: 6px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-soft);
  max-width: 480px;
}

.brand-product {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.brand-name {
  font-weight: 800;
  font-size: 17px;
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-soft);
}

/* ── Main layout ───────────────────────────────────────────────────── */

main {
  max-width: 1300px;
  margin: 30px auto;
  padding: 0 28px 60px;
}

/* ── Pre-call ──────────────────────────────────────────────────────── */

.pre-call {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.persona-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow);
  max-width: 640px;
  width: 100%;
}

.persona-card h2 {
  margin: 0 0 16px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-soft);
}

.persona-meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 8px;
}

.persona-name {
  font-size: 22px;
  font-weight: 800;
}

.persona-loc {
  color: var(--text-soft);
  font-size: 14px;
}

.persona-blurb {
  color: var(--text);
  line-height: 1.55;
  margin: 12px 0 18px;
}

.persona-tips {
  background: var(--bg);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-soft);
}

.persona-tips ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

.persona-tips li {
  margin: 4px 0;
}

/* ── Buttons ───────────────────────────────────────────────────────── */

button {
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  padding: 12px 20px;
  transition: background 0.15s, transform 0.05s;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.primary {
  background: var(--navy);
  color: white;
}

button.primary:hover:not(:disabled) {
  background: var(--navy-dark);
}

button.primary.big {
  font-size: 18px;
  padding: 16px 36px;
  border-radius: 50px;
}

button.danger {
  background: var(--danger);
  color: white;
}

button.danger:hover:not(:disabled) {
  background: #b32a22;
}

/* ── Status pill ───────────────────────────────────────────────────── */

.status-row {
  display: flex;
  justify-content: center;
}

.status-pill {
  background: white;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 13px;
  color: var(--text-soft);
}

.status-pill.connecting {
  background: var(--warn-soft);
  border-color: var(--warn);
  color: var(--warn);
}

.status-pill.active {
  background: var(--ok-soft);
  border-color: var(--ok);
  color: var(--ok);
}

.status-pill.error {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

/* ── Call area ─────────────────────────────────────────────────────── */

.call-area {
  display: none;
  grid-template-columns: 1fr auto 1fr;
  gap: 28px;
  align-items: stretch;
}

.call-area.active {
  display: grid;
}

.speaker-panel {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}

.speaker-panel.speaking {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(43, 113, 218, 0.18);
}

.speaker-label {
  font-size: 18px;
  font-weight: 800;
}

.speaker-status {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 600;
}

.speaker-transcript {
  flex: 1;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
}

.call-middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 200px;
}

.call-timer {
  font-size: 42px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.call-active-pill {
  background: var(--ok-soft);
  color: var(--ok);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
}

.compliance-indicator {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
  min-height: 24px;
  transition: background 0.3s, color 0.3s, transform 0.3s;
}

.compliance-indicator.pulse {
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
  transform: scale(1.05);
}

/* ── Scorecard modal ───────────────────────────────────────────────── */

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 30, 50, 0.45);
}

.modal-body {
  position: relative;
  background: white;
  border-radius: var(--radius);
  padding: 28px 32px;
  max-width: 720px;
  width: calc(100% - 40px);
  margin: 60px auto;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.modal-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 16px;
}

.sc-grade {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}

.sc-grade-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--warn-soft);
  color: var(--warn);
  border: 3px solid var(--warn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 800;
}

.sc-reason {
  font-size: 17px;
  color: var(--text-soft);
}

.sc-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.sc-bar {
  display: grid;
  grid-template-columns: 160px 1fr 50px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.sc-bar-label {
  color: var(--text-soft);
  font-weight: 600;
}

.sc-bar-track {
  background: var(--bg);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.sc-bar-fill {
  background: var(--ok);
  height: 100%;
  transition: width 0.5s;
}

.sc-bar-val {
  font-weight: 700;
  text-align: right;
}

.sc-disclosures {
  background: var(--bg);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin: 16px 0;
}

.modal-body h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-soft);
  margin: 20px 0 6px;
}

.modal-body ul {
  margin: 0 0 14px;
  padding-left: 22px;
}

.modal-body li {
  margin: 6px 0;
  line-height: 1.5;
}

.modal-body pre {
  background: var(--bg);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
}

.modal.loading .modal-body {
  position: relative;
}

#close-scorecard-btn {
  margin-top: 18px;
}
