/* ============================================
   Policyholder LTV Estimator — BrokerBot
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --color-primary:       #9d248c;
  --color-primary-light: #af3e9f;
  --color-primary-dark:  #7a1b6d;
  --color-accent:        #fc0b7f;
  --color-accent-light:  #fd4a9e;
  --color-accent-dark:   #d10967;
  --color-primary-surface: #2e1a2b;

  --color-bg:            #F5F1F4;
  --color-surface:       #FFFFFF;
  --color-text:          #1A1A2E;
  --color-text-secondary:#5A6577;
  --color-text-muted:    #8896A6;
  --color-border:        #DDE3EB;
  --color-border-light:  #EEF1F5;

  --color-current:       #9d248c;
  --color-current-bg:    rgba(157, 36, 140, 0.08);
  --color-boosted:       #fc0b7f;
  --color-boosted-bg:    rgba(252, 11, 127, 0.08);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:   0 8px 30px rgba(0,0,0,0.12);
  --shadow-card: 0 2px 8px rgba(157,36,140,0.06), 0 0 0 1px rgba(157,36,140,0.04);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --transition-fast:   150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow:   500ms ease;

  --max-width: 780px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--color-primary); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* --- Header --- */
.calc-header {
  background: linear-gradient(160deg, #2e1a2b 0%, #4a1545 40%, #7a1b6d 100%);
  color: #fff;
  padding: 2rem 1.5rem 2.5rem;
  text-align: center;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo-area {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  width: 200px;
}

.logo-icon {
  flex-shrink: 0;
  border-radius: 10px;
  width: 100%;
}

.calc-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.calc-header .accent { color: #fd6aaf; }

.calc-header .subtitle {
  font-size: 1rem;
  opacity: 0.8;
  font-weight: 400;
}

/* --- Progress Bar --- */
.progress-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
  padding: 1.25rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.progress-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.progress-steps {
  list-style: none;
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.progress-track {
  position: absolute;
  top: 16px;
  left: 40px; right: 40px;
  height: 3px;
  background: var(--color-border);
  border-radius: 2px;
  z-index: 1;
}

.progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width var(--transition-slow);
  width: 0%;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
}

.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  border: 3px solid var(--color-surface);
  box-shadow: 0 0 0 2px var(--color-border);
}

.progress-step.active    .step-dot { background: var(--color-primary); color: #fff; box-shadow: 0 0 0 2px var(--color-primary); }
.progress-step.completed .step-dot { background: var(--color-accent);  color: #fff; box-shadow: 0 0 0 2px var(--color-accent); }

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
  transition: color var(--transition-normal);
}

.progress-step.active    .step-label { color: var(--color-primary); }
.progress-step.completed .step-label { color: var(--color-accent); }

/* --- Calculator Container --- */
.calculator-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* --- Step Sections --- */
.step {
  display: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.step.active  { display: block; }
.step.visible { opacity: 1; transform: translateY(0); }

/* --- Step Card --- */
.step-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  position: relative;
}

.step-card-results {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.step-header { margin-bottom: 2rem; }

.step-badge {
  display: inline-block;
  background: var(--color-current-bg);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 0.75rem;
}

.step-badge-results {
  background: var(--color-boosted-bg);
  color: var(--color-accent);
}

.step-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  margin-bottom: 0.35rem;
}

.step-description {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

/* --- Input Groups --- */
.inputs-grid {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* --- Tooltip --- */
.tooltip-trigger {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--color-text-muted);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.tooltip-trigger:hover,
.tooltip-trigger:focus {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  outline: none;
}

.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--color-primary-dark);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  width: 260px;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  box-shadow: var(--shadow-lg);
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-primary-dark);
}

.tooltip.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Sliders --- */
.slider-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(
    to right,
    var(--color-primary) 0%,
    var(--color-primary) var(--progress, 20%),
    var(--color-border)  var(--progress, 20%),
    var(--color-border)  100%
  );
  transition: background var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(157,36,140,0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--color-border);
}

input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--color-primary);
}

.slider-value {
  min-width: 75px;
  text-align: right;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(157,36,140,0.25);
}
.btn-primary:hover {
  background: var(--color-primary-light);
  box-shadow: 0 4px 12px rgba(157,36,140,0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1.5px solid var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.btn-accent {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(252,11,127,0.25);
  width: 100%;
  justify-content: center;
  padding: 0.9rem 1.6rem;
  font-size: 1rem;
}
.btn-accent:hover {
  background: var(--color-accent-light);
  box-shadow: 0 4px 12px rgba(252,11,127,0.3);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* --- Step Actions --- */
.step-actions {
  margin-top: 2rem;
  display: flex;
  justify-content: flex-end;
}

.step-actions-split {
  justify-content: space-between;
}

/* --- Results Grid --- */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  border-top: 3px solid transparent;
}

.current-card { border-top-color: var(--color-current); }
.boosted-card  { border-top-color: var(--color-boosted); }

.card-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
}

.card-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

.current-dot { background: var(--color-current); }
.boosted-dot  { background: var(--color-boosted); }

.metrics-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border-light);
}

.metric-row:last-child { border-bottom: none; padding-bottom: 0; }

.metric-row dt {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.metric-row dd {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.metric-row-highlight dd { font-size: 1.25rem; }
.current-card .metric-row-highlight dd { color: var(--color-current); }
.boosted-card  .metric-row-highlight dd { color: var(--color-boosted); }

/* --- Charts --- */
.chart-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
}

.chart-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.25rem;
}

.chart-description {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.chart-container { position: relative; height: 260px; }
.chart-container-wide { height: 200px; }

/* --- LTV Boost Spotlight --- */
.ltv-spotlight {
  background: linear-gradient(160deg, #2e1a2b 0%, #4a1545 40%, #7a1b6d 100%);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: #fff;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.ltv-spotlight::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(252,11,127,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.spotlight-inner { position: relative; z-index: 1; }

.ltv-spotlight h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
  margin-bottom: 0.5rem;
}

.boost-value {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.35rem;
  color: #fd6aaf;
}

.boost-description {
  font-size: 0.9rem;
  opacity: 0.75;
}

/* --- Lead Capture --- */
.lead-capture {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
  overflow: hidden;
}

.lead-capture-inner {
  padding: 2rem;
  text-align: center;
}

.lead-capture h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
}

.lead-capture-inner > p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.form-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  background: var(--color-surface);
}

.form-field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(157,36,140,0.12);
}

.form-field input::placeholder { color: var(--color-text-muted); }

.form-error {
  color: #D32F2F;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

/* --- CTA Banner --- */
.cta-banner {
  background: var(--color-accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  text-align: center;
  color: #fff;
  margin-bottom: 2rem;
}

.cta-banner p {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.btn-white {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  color: var(--color-accent);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.8rem 2rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.btn-white:hover {
  background: #fff;
  color: var(--color-accent-dark);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

/* --- Footer --- */
.calc-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.calc-footer a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.calc-footer a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

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

@media (max-width: 640px) {
  .calc-header { padding: 1.5rem 1rem 2rem; }
  .calc-header h1 { font-size: 1.35rem; }

  .progress-bar { padding: 1rem; }
  .step-label   { font-size: 0.65rem; }
  .step-dot     { width: 28px; height: 28px; font-size: 0.7rem; }

  .progress-track { left: 30px; right: 30px; top: 14px; }

  .calculator-container { padding: 1.25rem 1rem 2rem; }
  .step-card { padding: 1.5rem 1.25rem; border-radius: var(--radius-lg); }
  .step-header h2 { font-size: 1.25rem; }

  .results-grid { grid-template-columns: 1fr; }
  .form-row     { grid-template-columns: 1fr; }

  .boost-value  { font-size: 2rem; }
  .chart-container { height: 220px; }
  .chart-container-wide { height: 160px; }

  .slider-value { min-width: 60px; font-size: 0.95rem; }

  .step-actions-split { flex-direction: column-reverse; gap: 0.75rem; }
  .step-actions-split .btn { width: 100%; justify-content: center; }
}

@media (min-width: 1024px) {
  .calc-header { padding: 2.5rem 2rem 3rem; }
  .calc-header h1 { font-size: 2rem; }
  .step-card { padding: 2.5rem; }
  .chart-container { height: 300px; }
  .chart-container-wide { height: 220px; }
}
