/* ========================================
   milia.io Pricing Calculator
   Design System: milia-2026.webflow.io
   ======================================== */

:root {
  --blue: #1129F5;
  --blue-light: rgba(17, 41, 245, 0.1);
  --blue-hover: #0d21c4;
  --green: #0d8a3e;
  --green-light: #edf7f1;
  --text: #2F383D;
  --text-heading: #151F25;
  --text-muted: #6b7780;
  --text-faint: #9ca8b0;
  --bg-section: #F7F9FA;
  --bg-card: #fff;
  --border: #E1E5E8;
  --border-light: #f0f2f4;
  --radius-card: 12px;
  --radius-pill: 999px;
  --radius-sm: 8px;
  --font: 'TT Norms Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  background: #fff;
}

/* ── Section wrapper ── */

.calc-section {
  background: var(--bg-section);
  padding: 56px 24px;
}

.calc-section h2 {
  text-align: center;
  font-size: 2.25rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.calc-section .sub {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 40px;
}

/* ── Two-column layout ── */

.calc-wrap {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

/* ── Card ── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px 32px;
}

.card + .card { margin-top: 12px; }

.card h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breakdown-divider {
  border-top: 1px solid var(--border);
  margin: 24px 0 16px;
}

/* ── Slider inputs ── */

.slider-group { margin-bottom: 20px; }
.slider-group:last-child { margin-bottom: 0; }

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.slider-label label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.slider-label input[type="text"] {
  width: 80px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-heading);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  text-align: right;
  font-family: inherit;
  background: var(--bg-section);
  outline: none;
  font-variant-numeric: tabular-nums;
  cursor: text;
  transition: border-color 0.15s;
}

.slider-label input[type="text"]:hover { border-color: var(--text-muted); }
.slider-label input[type="text"]:focus { border-color: var(--blue); background: #fff; }

.free-label {
  font-size: 13px;
  color: var(--text-faint);
  font-weight: 400;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  outline: none;
  border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(17, 41, 245, 0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(17, 41, 245, 0.3);
}

.hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
}

/* ── Laufzeit toggle ── */

.laufzeit-group { margin-top: 20px; }

.laufzeit-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.toggle-group {
  display: flex;
  background: var(--border);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.toggle-group button {
  flex: 1;
  padding: 10px 12px 8px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  line-height: 1.2;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.toggle-group button.active {
  background: #fff;
  color: var(--text-heading);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.save-badge {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--blue);
  margin-top: 2px;
}

/* ── Add-on ── */

.addon-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.addon-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
}

.addon-optional {
  font-size: 11px;
  font-weight: 600;
  color: rgb(99, 102, 241);
  background: rgb(238, 242, 255);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  margin-left: 4px;
}

.addon-price {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 8px;
}

.addon-sub {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 2px;
}

.addon-detail {
  display: none;
  margin-top: 16px;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
}

.addon-detail.visible { display: block; }

.addon-detail input[type="text"] {
  width: 50px;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  border: 1px solid var(--border);
  border-bottom: 2px solid var(--border);
  padding: 6px 8px;
  font-family: inherit;
  background: #fff;
  outline: none;
  border-radius: 4px;
}

.addon-detail input[type="text"]:focus { border-color: var(--blue); }

/* ── Toggle switch ── */

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border);
  transition: 0.2s;
  border-radius: 24px;
}

.switch-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  transition: 0.2s;
  border-radius: 50%;
}

.switch input:checked + .switch-slider { background: var(--blue); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* ── Line items & totals ── */

.line-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}

.line-item:last-of-type { border-bottom: none; }

.line-l { color: var(--text-heading); font-weight: 600; }
.line-l small { color: var(--text-faint); font-size: 11px; font-weight: 400; }
.line-r { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-heading); }

.line-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 20px 0 0;
  margin-top: 8px;
  margin-bottom: 4px;
}

.line-total .line-l { font-size: 15px; font-weight: 600; color: var(--text-heading); }
.line-total .line-r { font-size: 22px; font-weight: 700; color: var(--text-heading); }
.line-total .line-r small { font-size: 11px; color: var(--text-faint); font-weight: 400; }

/* ── Setup ── */

.setup-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.setup-title { font-size: 15px; font-weight: 600; color: var(--text-heading); }
.setup-tier { font-size: 13px; color: var(--text-faint); margin-top: 2px; }
.setup-price { font-size: 18px; font-weight: 700; color: var(--text-heading); }
.setup-price small { font-size: 11px; color: var(--text-faint); font-weight: 400; }
.setup-note { font-size: 11px; color: var(--text-faint); margin-top: 8px; }

.tax-note {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 12px;
  text-align: center;
}

/* ── ROI Sidebar ── */

.roi-col {
  position: sticky;
  top: 20px;
}

.roi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
}

.roi-card h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.roi-big {
  font-size: 42px;
  font-weight: 500;
  color: var(--text-heading);
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.roi-sublabel {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.roi-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--border-light);
}

.roi-metric-l { font-size: 12px; color: var(--text-muted); }
.roi-metric-r { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-heading); }
.roi-metric-r.positive { color: var(--blue); }

.roi-details summary {
  font-size: 11px;
  color: var(--text-faint);
  cursor: pointer;
  list-style: none;
  padding-top: 8px;
}

.roi-details summary::-webkit-details-marker { display: none; }

.roi-details-body { margin-top: 8px; }

.roi-footnote {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ── CTAs ── */

.cta-box { margin-top: 16px; }

.btn-primary {
  display: block;
  width: 100%;
  padding: 1.15rem 1.75rem;
  border: 2.5px solid #cfd4fd;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
  cursor: pointer;
  background: var(--blue);
  color: #fff;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-pill);
  transition: color 0.2s, background-color 0.2s;
}

.btn-primary:hover { background: var(--blue-hover); }

.btn-secondary {
  display: block;
  width: 100%;
  padding: 1.15rem 1.75rem;
  border: none;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
  cursor: pointer;
  background: #1129f51a;
  color: var(--blue);
  margin-top: 8px;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-pill);
  transition: color 0.2s, background-color 0.2s;
}

.btn-secondary:hover { background: #1129f533; }

/* ── Responsive ── */

@media (max-width: 960px) {
  .calc-wrap { grid-template-columns: 1fr; }
  .roi-col { position: static; }
}

@media (max-width: 640px) {
  .calc-section { padding: 32px 16px; }
  .calc-section h2 { font-size: 22px; }
  .calc-section .sub { font-size: 14px; margin-bottom: 24px; }

  .card { padding: 20px 18px; }

  .slider-label label { font-size: 14px; }
  .slider-label input[type="text"] { width: 72px; font-size: 15px; padding: 6px 10px; }

  .toggle-group { flex-wrap: wrap; }
  .toggle-group button { font-size: 12px; padding: 8px 8px 6px; }

  .line-item { font-size: 13px; padding: 6px 0; }
  .line-total .line-r { font-size: 18px; }

  .setup-row { flex-direction: column; gap: 4px; }
  .setup-price { font-size: 16px; }

  .roi-big { font-size: 32px; }
  .roi-card { padding: 20px; }

  .btn-primary, .btn-secondary { font-size: 14px; padding: 12px; }
}
