/* ============================================================
   COST CALCULATOR — interactive cost-per-effective-hour compare
   Self-contained component. Brand colours via scoped variables,
   so the teal accent can be swapped without touching the page.
   Loaded alongside site.css on the pricing pages.
============================================================ */
.cost-calc {
  --cc-teal:        #1D9E75;
  --cc-teal-light:  #9FE1CB;
  --cc-teal-bg:     #E1F5EE;
  --cc-teal-dark:   #085041;
  --cc-teal-dark-2: #0F6E56;
  --cc-emp-bg:      #F1EFE8;
  --cc-gray-1:      #5F5E5A;
  --cc-gray-2:      #888780;
  --cc-gray-3:      #B4B2A9;
  --cc-gray-4:      #D3D1C7;
  --cc-coral:       #D85A30;
  --cc-coral-text:  #993C1D;
  --cc-track:       #E7E5DD;
  --cc-radius:      12px;

  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
}
.cc-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.cost-calc__title {
  margin: 0.5rem 0 -0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---- Controls card ---- */
.cc-controls {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--cc-radius);
  padding: 1.75rem 1.9rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.cc-controls__eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cc-control {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 1.3fr) auto;
  align-items: center;
  gap: 1.5rem;
}
.cc-control__label { font-size: 1rem; color: var(--text); }
.cc-control__value {
  font-size: 1.15rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cc-control input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--cc-track);
  outline: none;
  cursor: pointer;
}
.cc-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border-3);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color .15s ease;
}
.cc-control input[type="range"]::-webkit-slider-thumb:hover { border-color: var(--cc-teal); }
.cc-control input[type="range"]:focus-visible::-webkit-slider-thumb { border-color: var(--cc-teal); box-shadow: 0 0 0 4px rgba(29,158,117,.2); }
.cc-control input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border-3);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* ---- Two cost cards ---- */
.cc-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
.cc-card {
  border-radius: var(--cc-radius);
  padding: 1.5rem 1.6rem;
}
.cc-card--emp   { background: var(--cc-emp-bg); }
.cc-card--agent { background: var(--cc-teal-bg); }
.cc-card__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.cc-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}
.cc-card--emp   .cc-card__icon { background: rgba(15,17,22,.07); color: var(--text); }
.cc-card--agent .cc-card__icon { background: var(--cc-teal); color: #fff; }
.cc-card--agent .cc-card__head { color: var(--cc-teal-dark); }
.cc-card__big {
  margin: 0.7rem 0 0.15rem;
  font-size: clamp(2.2rem, 4vw, 2.9rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.cc-card--agent .cc-card__big { color: var(--cc-teal-dark); }
.cc-card__sub { font-size: 0.92rem; color: var(--text-muted); }
.cc-card--agent .cc-card__sub { color: var(--cc-teal-dark-2); }
.cc-card__stacklabel {
  margin: 1.3rem 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cc-card--agent .cc-card__stacklabel { color: var(--cc-teal-dark-2); }

/* ---- Stacked bar ---- */
.cc-bar {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(15,17,22,.05);
}
.cc-card--agent .cc-bar { background: rgba(8,80,65,.08); }
.cc-bar__seg { height: 100%; transition: width .18s var(--ease, ease); }

/* ---- Legend ---- */
.cc-legend {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.cc-legend li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
}
/* The middle cell is the label. A single long word like "Sozialversicherung"
   has no break point, so on narrow phones it overflows its cell and collides
   with the price. Allow it to wrap / hyphenate so it never overlaps. */
.cc-legend li > span:not([class]) {
  min-width: 0;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}
.cc-legend__dot { width: 12px; height: 12px; border-radius: 3px; }
.cc-legend__val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-legend li.is-accent { color: var(--cc-coral-text); font-weight: 600; }
.cc-legend li.is-accent .cc-legend__val { color: var(--cc-coral-text); }

/* ---- Time breakdown card ---- */
.cc-time {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--cc-radius);
  padding: 1.6rem 1.7rem;
}
.cc-time__title { margin: 0 0 0.5rem; font-size: 1.3rem; font-weight: 600; }
.cc-time__intro { margin: 0 0 1.1rem; color: var(--text-muted); font-size: 0.97rem; max-width: 64ch; }
.cc-time__legend {
  list-style: none; margin: 1rem 0 0; padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 2rem;
}
.cc-note {
  margin-top: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--cc-teal-bg);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  font-size: 0.92rem;
  color: var(--cc-teal-dark);
}
.cc-note__swatch {
  flex-shrink: 0;
  width: 64px; height: 18px;
  border-radius: 5px;
  background: var(--cc-teal);
}

/* ---- Multiplier ---- */
.cc-mult {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--cc-radius);
  padding: 1.5rem;
  text-align: center;
}
.cc-mult__num {
  font-size: clamp(2.2rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--cc-teal-dark);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.cc-mult__cap { font-size: 1.05rem; color: var(--text-muted); }

/* ---- Monthly cards ---- */
.cc-months {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
.cc-month {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--cc-radius);
  padding: 1.4rem 1.6rem;
}
.cc-month__label { font-size: 1.05rem; font-weight: 600; }
.cc-month__big {
  margin: 0.5rem 0 0.3rem;
  font-size: clamp(1.9rem, 3.4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.cc-month__sub { font-size: 0.92rem; color: var(--text-muted); }
.cc-badge {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--cc-teal-bg);
  color: var(--cc-teal-dark);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ---- Savings bar ---- */
.cc-savings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: var(--cc-teal-bg);
  border-radius: var(--cc-radius);
  padding: 1.5rem 1.9rem;
  color: var(--cc-teal-dark);
}
.cc-savings__label { font-size: 1.1rem; font-weight: 700; }
.cc-savings__year { font-size: 0.95rem; font-weight: 400; color: var(--cc-teal-dark-2); }
.cc-savings__big {
  font-size: clamp(2rem, 3.6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.cc-cta-wrap { text-align: center; }

/* ---- Lead paragraph under the section heading ---- */
.cc-lead {
  margin: 0.6rem auto 0;
  max-width: 56ch;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ---- Footnote ---- */
.cc-foot {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 80ch;
  margin: 0 auto;
  text-align: center;
}

/* ---- Responsive ---- */
@media (max-width: 540px) {
  .cc-cards, .cc-months, .cc-time__legend { grid-template-columns: 1fr; }
  .cc-card, .cc-month { min-width: 0; }
  .cc-legend li { grid-template-columns: 14px minmax(0, 1fr) auto; }
  .cc-control { grid-template-columns: minmax(0, 1fr) auto; gap: 0.4rem 1rem; }
  .cc-control__label { min-width: 0; }
  .cc-control input[type="range"] { grid-column: 1 / -1; order: 3; }
  .cc-controls { padding: 1.4rem 1.3rem; }
  .cc-savings { gap: 0.6rem; }
}
