/* ============================================================
   HRDelivered — Benefits Risk Calculator (Multi-Step)
   Mirrors the get-started template design language.
   brc- prefix throughout.
   ============================================================ */

/* ── Theme variables (identical to get-started) ─────────────── */
:root {
  --accent:        #094ffe;
  --accent-light:  #5b8cff;
  --crimson:       #d7013f;
  --navy:          #001342;
  --radius:        10px;
  --radius-lg:     16px;
  --shadow-card:   0 20px 60px rgba(0,0,0,0.35);
  --transition:    0.2s ease;
}

[data-theme="dark"] {
  --bg:            #07091c;
  --bg-card:       #0f1629;
  --bg-input:      rgba(255,255,255,0.05);
  --border:        rgba(255,255,255,0.09);
  --border-input:  rgba(255,255,255,0.13);
  --border-focus:  #094ffe;
  --text:          #f0f4ff;
  --text-muted:    rgba(240,244,255,0.55);
  --text-label:    rgba(240,244,255,0.8);
  --check-bg:      rgba(9,79,254,0.15);
  --error:         #f87171;
}

[data-theme="light"] {
  --bg:            #eef1f8;
  --bg-card:       #ffffff;
  --bg-input:      #f9fafb;
  --border:        rgba(0,19,66,0.08);
  --border-input:  #d1d5db;
  --border-focus:  #094ffe;
  --text:          #001342;
  --text-muted:    #6b7280;
  --text-label:    #374151;
  --check-bg:      #eff4ff;
  --error:         #dc2626;
}

/* ── Reset / Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body.page-brc {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

/* ── Outer wrap ─────────────────────────────────────────────── */
.brc-wrap {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════════
   LEFT PANEL
   ══════════════════════════════════════════════════════════════ */
.brc-panel {
  background: var(--navy);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 2.25rem 2rem 2rem;
  scrollbar-width: none;
}
.brc-panel::-webkit-scrollbar { display: none; }

.brc-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.75rem;
}

.brc-logo img {
  height: 28px;
  width: auto;
  display: block;
}

/* Theme toggle */
.brc-theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.75);
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.brc-theme-toggle:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.3);
}
.brc-theme-toggle svg { display: block; }
.brc-theme-toggle .icon-sun  { display: none; }
.brc-theme-toggle .icon-moon { display: block; }
[data-theme="light"] .brc-theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .brc-theme-toggle .icon-moon { display: none; }
[data-theme="light"] .brc-theme-toggle {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}

/* Panel heading */
.brc-panel-heading {
  font-size: 1.375rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}
.brc-panel-heading span { color: var(--accent-light); }

.brc-panel-sub {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 2.25rem;
  line-height: 1.5;
}

/* Step progress nav — 4 steps */
.brc-step-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 2.5rem;
}

.brc-step-nav-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  position: relative;
}
.brc-step-nav-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 13px;
  top: 30px;
  width: 1px;
  height: calc(100% - 6px);
  background: rgba(255,255,255,0.1);
}
.brc-step-nav-item.completed::after,
.brc-step-nav-item.active::after {
  background: rgba(9,79,254,0.45);
}

.brc-step-nav-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
  transition: all 0.3s ease;
  margin-top: 2px;
  z-index: 1;
  position: relative;
}
.brc-step-nav-item.active .brc-step-nav-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(9,79,254,0.2);
}
.brc-step-nav-item.completed .brc-step-nav-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.brc-step-nav-text { padding: 2px 0 22px; }
.brc-step-nav-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  line-height: 1.2;
  transition: color 0.3s ease;
}
.brc-step-nav-desc {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.28);
  margin-top: 2px;
  transition: color 0.3s ease;
}
.brc-step-nav-item.active .brc-step-nav-title  { color: #fff; }
.brc-step-nav-item.active .brc-step-nav-desc   { color: rgba(255,255,255,0.55); }
.brc-step-nav-item.completed .brc-step-nav-title { color: rgba(255,255,255,0.65); }

/* Divider */
.brc-panel-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 1.75rem;
}

/* Bullets */
.brc-panel-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 2rem;
}
.brc-panel-bullets li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.4;
}
.brc-panel-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(9,79,254,0.2);
  border: 1px solid rgba(9,79,254,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-light);
}

/* Testimonial */
.brc-panel-quote {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.brc-panel-quote blockquote {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.65;
  font-style: italic;
  margin-bottom: 0.6rem;
}
.brc-panel-quote cite {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  font-style: normal;
}

/* ══════════════════════════════════════════════════════════════
   RIGHT MAIN
   ══════════════════════════════════════════════════════════════ */
.brc-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  min-height: 100vh;
}

/* Form card */
.brc-card {
  width: 100%;
  max-width: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: background var(--transition), border-color var(--transition), max-width 0.4s ease;
}
.brc-card--results {
  max-width: 620px;
}

/* Progress bar */
.brc-progress-track {
  height: 3px;
  background: var(--border);
}
.brc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 0.45s cubic-bezier(0.4,0,0.2,1);
  border-radius: 0 2px 2px 0;
}

.brc-card-body { padding: 2.25rem 2.5rem 2.5rem; }

/* Step badge */
.brc-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 0.75rem;
}
.brc-step-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-light);
}

/* Step panels */
.brc-step-panel { display: none; }
.brc-step-panel.active {
  display: block;
  animation: brcIn 0.3s ease;
}
.brc-step-panel.back-anim { animation: brcInBack 0.3s ease; }

@keyframes brcIn {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes brcInBack {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}

.brc-step-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
  line-height: 1.25;
}
.brc-step-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.55;
}

/* ── Fields ─────────────────────────────────────────────────── */
.brc-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.brc-field { margin-bottom: 1.1rem; }

.brc-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-label);
  margin-bottom: 0.4rem;
}
.brc-field input,
.brc-field select,
.brc-field textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-input);
  border-radius: var(--radius);
  padding: 0.65rem 0.875rem;
  font-size: 0.9375rem;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
.brc-field input::placeholder { color: var(--text-muted); }
.brc-field input:focus,
.brc-field select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(9,79,254,0.14);
}
.brc-field input.brc-error,
.brc-field select.brc-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}
.brc-field-error {
  font-size: 0.73rem;
  color: var(--error);
  margin-top: 0.3rem;
  display: none;
}
.brc-field-error.show { display: block; }

/* Select arrow */
.brc-select-wrap { position: relative; }
.brc-select-wrap::after {
  content: '';
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted);
  pointer-events: none;
}
.brc-select-wrap select { padding-right: 2.25rem; cursor: pointer; }
[data-theme="dark"] .brc-field select option {
  background: #1a2035;
  color: #f0f4ff;
}

/* Hint text */
.brc-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Checkbox field wrapper */
.brc-field--checkbox-wrap {
  display: flex;
  align-items: flex-end;
  padding-bottom: 1px;
}

/* Inline checkbox (virgin group, TCPA) */
.brc-inline-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
  user-select: none;
}
.brc-inline-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.brc-check-box {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-input);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  position: relative;
  flex-shrink: 0;
}
.brc-inline-check input[type="checkbox"]:checked + .brc-check-box {
  background: var(--accent);
  border-color: var(--accent);
}
.brc-inline-check input[type="checkbox"]:checked + .brc-check-box::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 0px;
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

/* TCPA row */
.brc-tcpa-row {
  margin: 1rem 0 0.25rem;
}
.brc-tcpa-check { align-items: flex-start; }
.brc-tcpa-check .brc-check-box { margin-top: 2px; }

/* Add-state link */
.brc-add-state-link {
  background: none;
  border: none;
  color: var(--accent-light);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.1rem 0;
  margin-bottom: 0.75rem;
  display: inline-block;
  transition: color var(--transition);
}
.brc-add-state-link:hover { color: var(--accent); }

/* Extra state rows */
.brc-extra-state { margin-bottom: 0; }

/* ── Buttons ────────────────────────────────────────────────── */
.brc-btn-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.brc-btn-next,
.brc-btn-calculate {
  flex: 1;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.825rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.brc-btn-next:hover,
.brc-btn-calculate:hover {
  background: #0740e0;
  box-shadow: 0 4px 18px rgba(9,79,254,0.35);
}
.brc-btn-next:active,
.brc-btn-calculate:active { transform: scale(0.98); }
.brc-btn-next:disabled,
.brc-btn-calculate:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.brc-btn-next svg,
.brc-btn-calculate svg { flex-shrink: 0; transition: transform 0.2s; }
.brc-btn-next:hover svg,
.brc-btn-calculate:hover svg { transform: translateX(2px); }

.brc-btn-back {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border-input);
  border-radius: 999px;
  padding: 0.825rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.brc-btn-back:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ── Privacy note ───────────────────────────────────────────── */
.brc-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1.25rem;
  font-size: 0.73rem;
  color: var(--text-muted);
}
.brc-privacy svg { flex-shrink: 0; opacity: 0.6; }

/* ══════════════════════════════════════════════════════════════
   RESULTS — STEP 4
   ══════════════════════════════════════════════════════════════ */

/* Score row */
.brc-score-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0.5rem 0 1.75rem;
}

/* Dial — SVG arc approach (no clipping) */
.brc-dial {
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brc-dial-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg); /* start arc at 12 o'clock */
}
.brc-dial-track {
  fill: none;
  stroke: var(--border-input);
  stroke-width: 9;
}
.brc-dial-arc {
  fill: none;
  stroke: #0f766e; /* overridden by JS */
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 238.76;   /* 2 x pi x 38 */
  stroke-dashoffset: 238.76;  /* fully hidden until JS sets it */
  transition: stroke-dashoffset 0.7s cubic-bezier(0.4,0,0.2,1), stroke 0.4s ease;
}
.brc-dial-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  position: relative;
  z-index: 1;
}

/* Band badge */
.brc-band-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.brc-band-low    { background: rgba(22,163,74,0.15);  color: #16a34a; }
.brc-band-medium { background: rgba(217,119,6,0.15);  color: #d97706; }
.brc-band-high   { background: rgba(220,38,38,0.15);  color: #dc2626; }

.brc-score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.brc-score-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* KPI grid */
.brc-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.brc-kpi {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  background: var(--bg-input);
  transition: background var(--transition), border-color var(--transition);
}
.brc-kpi small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}
.brc-kpi strong {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.brc-kpi--savings strong {
  font-size: 1.4rem;
  color: var(--accent-light);
}

/* Factor table */
.brc-factors {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.brc-factors summary {
  padding: 0.7rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--transition), background var(--transition);
}
.brc-factors summary::-webkit-details-marker { display: none; }
.brc-factors summary::before {
  content: '▶';
  font-size: 0.6rem;
  transition: transform 0.2s ease;
  color: var(--text-muted);
}
.brc-factors[open] summary::before { transform: rotate(90deg); }
.brc-factors summary:hover { color: var(--text); background: var(--bg-input); }

.brc-factors table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.brc-factors th,
.brc-factors td {
  text-align: left;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text);
}
.brc-factors th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-input);
}
.brc-factors tbody tr:hover { background: var(--bg-input); }

/* Results CTA buttons */
.brc-results-cta {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.brc-btn-expert {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.925rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.brc-btn-expert:hover {
  background: #0740e0;
  box-shadow: 0 4px 18px rgba(9,79,254,0.35);
  color: #fff;
}
.brc-btn-expert:active { transform: scale(0.98); }
.brc-btn-expert svg { flex-shrink: 0; transition: transform 0.2s; }
.brc-btn-expert:hover svg { transform: translateX(3px); }

.brc-btn-benchmark {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  border: 1.5px solid var(--border-input);
  border-radius: 999px;
  padding: 0.825rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  text-align: center;
  transition: border-color var(--transition), color var(--transition);
}
.brc-btn-benchmark:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* Restart */
.brc-restart-row {
  text-align: center;
  margin-top: 1rem;
}
.brc-btn-restart {
  background: none;
  border: none;
  font-size: 0.8125rem;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
}
.brc-btn-restart:hover { color: var(--text); }

/* ── Mobile ─────────────────────────────────────────────────── */
.brc-mobile-steps { display: none; }

@media (max-width: 860px) {
  .brc-wrap { grid-template-columns: 1fr; }

  .brc-panel {
    position: static;
    height: auto;
    padding: 1.2rem 1.5rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .brc-panel-top { margin-bottom: 0; gap: 1.25rem; }
  .brc-logo img { height: 3rem; width: auto; }
  .brc-panel-heading,
  .brc-panel-sub,
  .brc-step-nav,
  .brc-panel-divider,
  .brc-panel-bullets,
  .brc-panel-quote { display: none; }

  .brc-mobile-steps {
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }
  .brc-mobile-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: width 0.3s, background 0.3s, border-radius 0.3s;
  }
  .brc-mobile-step-dot.active {
    width: 22px;
    border-radius: 4px;
    background: var(--accent-light);
  }
  .brc-mobile-step-dot.completed { background: rgba(9,79,254,0.55); }

  .brc-main {
    padding: 2rem 1.25rem 3rem;
    min-height: auto;
    justify-content: flex-start;
  }
  .brc-card-body  { padding: 1.75rem 1.5rem 2rem; }
  .brc-field-row  { grid-template-columns: 1fr; gap: 0; }
  .brc-kpi-grid   { grid-template-columns: 1fr; }
  .brc-field--checkbox-wrap { align-items: flex-start; }
}

@media (max-width: 480px) {
  .brc-step-title { font-size: 1.2rem; }
  .brc-card-body  { padding: 1.5rem 1.25rem 1.75rem; }
  .brc-panel      { padding: 1rem 1.25rem; }
  .brc-dial       { width: 90px; height: 90px; }
  .brc-dial-value { font-size: 1.4rem; }
}
