/* ============================================
   Higher Earner — Interactive Tax Planner
   Design: Monzo × Wealthfront × Apple
   ============================================ */

/* ── Income Slider ── */
.he-slider {
  max-width: 560px;
  margin: 0 auto 3rem;
  text-align: center;
}
.he-slider__value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.he-slider__input {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--color-border);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.he-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid var(--color-white);
  box-shadow: 0 2px 8px rgba(27, 67, 50, 0.25);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.he-slider__input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(27, 67, 50, 0.3);
}
.he-slider__input::-webkit-slider-thumb:active { cursor: grabbing; }
.he-slider__input::-moz-range-thumb {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid var(--color-white);
  box-shadow: 0 2px 8px rgba(27, 67, 50, 0.25);
  cursor: grab;
}
.he-slider__input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}
.he-slider__range {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--color-text-subtle);
  margin-top: 0.5rem;
}

/* ── Dashboard Metrics ── */
.he-dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.he-metric {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}
.he-metric--highlight {
  background: rgba(4, 120, 87, 0.03);
  border-color: rgba(4, 120, 87, 0.12);
}
.he-metric__label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}
.he-metric__value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  letter-spacing: -0.02em;
}
.he-metric--highlight .he-metric__value {
  color: var(--color-positive);
}

/* ── Alerts ── */
.he-alerts {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.he-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  line-height: 1.5;
}
.he-alert--warning {
  background: rgba(180, 83, 9, 0.04);
  border: 1px solid rgba(180, 83, 9, 0.12);
  color: var(--color-text);
}
.he-alert--success {
  background: rgba(4, 120, 87, 0.04);
  border: 1px solid rgba(4, 120, 87, 0.12);
  color: var(--color-text);
}
.he-alert__icon { flex-shrink: 0; font-size: 1rem; }

/* ── Timeline ── */
.he-timeline {
  position: relative;
  padding-left: 2rem;
}
.he-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--color-border);
}
.he-timeline__step {
  position: relative;
  padding-bottom: 2rem;
  padding-left: 2rem;
}
.he-timeline__step:last-child { padding-bottom: 0; }
.he-timeline__marker {
  position: absolute;
  left: -2rem;
  top: 0.2rem;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--color-border);
  border: 3px solid var(--color-bg);
}
.he-timeline__marker--amber { background: var(--color-warning); }
.he-timeline__marker--green { background: var(--color-positive); }
.he-timeline__content h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.3rem;
}
.he-timeline__content p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0;
}

/* ── Comparison ── */
.he-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.he-comp-col {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  background: var(--color-white);
}
.he-comp-col--highlight {
  border-color: rgba(4, 120, 87, 0.15);
  background: rgba(4, 120, 87, 0.02);
}
.he-comp-col__header {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-positive);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border-light);
}
.he-comp-col__header--muted { color: var(--color-text-muted); }
.he-comp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border-light);
}
.he-comp-row:last-of-type { border-bottom: none; }
.he-comp-label {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.he-comp-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}
.he-comp-saving {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(4, 120, 87, 0.06);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-positive);
}

/* ── Knowledge Cards ── */
.he-knowledge {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.he-knowledge__card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.he-knowledge__card[open] {
  border-color: var(--color-primary-light);
}
.he-knowledge__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  list-style: none;
  min-height: 56px;
}
.he-knowledge__trigger::-webkit-details-marker { display: none; }
.he-knowledge__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}
.he-knowledge__chevron {
  flex-shrink: 0;
  color: var(--color-text-subtle);
  transition: transform 0.2s ease;
}
.he-knowledge__card[open] .he-knowledge__chevron {
  transform: rotate(180deg);
}
.he-knowledge__body {
  padding: 0 1.5rem 1.5rem;
  font-size: 0.875rem;
  color: var(--color-text);
  line-height: 1.6;
}
.he-knowledge__body p { margin-bottom: 0.75rem; }
.he-knowledge__tip {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(4, 120, 87, 0.03);
  border: 1px solid rgba(4, 120, 87, 0.1);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .he-dashboard { grid-template-columns: repeat(2, 1fr); }
  .he-comparison { grid-template-columns: 1fr; }
  .he-slider__value { font-size: 2rem; }
}
@media (max-width: 480px) {
  .he-dashboard { grid-template-columns: 1fr; }
  .he-metric { padding: 1.25rem; }
  .he-slider__value { font-size: 1.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .he-metric, .he-slider__input::-webkit-slider-thumb { transition: none; }
}
