/* AboPilot Kostenrechner – bewusst ohne externe Dienste oder Tracking. */

.calculator-hero {
  padding: clamp(2.25rem, 4.5vw, 3.6rem) 0 clamp(2rem, 3.8vw, 3rem);
  background:
    radial-gradient(circle at 78% 22%, color-mix(in srgb, var(--brand) 21%, transparent), transparent 26rem),
    radial-gradient(circle at 92% 82%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 22rem),
    var(--bg);
  overflow: hidden;
}

.calculator-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}
.calculator-hero .hero-copy { max-width: 48rem; }
.calculator-hero h1 { max-width: 18ch; font-size: clamp(2rem, 1.45rem + 2.2vw, 2.9rem); }
.calculator-hero .lead { margin-top: 1rem; font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); }

.calculator-trust {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: .92rem;
  font-weight: 620;
}
.calculator-trust li::before { content: "\2713"; color: var(--ok); margin-right: .38rem; }
.calculator-jump { margin-top: 1.2rem; }
.calculator-jump .button { box-shadow: 0 10px 25px color-mix(in srgb, var(--brand) 20%, transparent); }

.cost-visual {
  position: relative;
  min-height: 285px;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.cost-visual::before,
.cost-visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  z-index: -1;
}
.cost-visual::before { width: 270px; height: 270px; }
.cost-visual::after { width: 204px; height: 204px; border-style: dashed; }
.cost-core {
  width: 168px;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  color: #f4fdff;
  background: linear-gradient(145deg, #0b4154, #087c89 58%, #1aa9b6);
  border: 8px solid color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: 0 22px 55px rgba(5, 71, 84, .28), inset 0 1px rgba(255,255,255,.24);
}
.cost-core small { font-size: .72rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; opacity: .82; }
.cost-core strong { margin-top: .28rem; font-size: 1.7rem; line-height: 1; letter-spacing: -.04em; }
.cost-core span { margin-top: .35rem; font-size: .8rem; opacity: .85; }
.cost-chip {
  position: absolute;
  min-width: 142px;
  padding: .72rem .85rem;
  border: 1px solid color-mix(in srgb, var(--line-2) 82%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 91%, transparent);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  color: var(--ink-2);
  font-size: .78rem;
}
.cost-chip b { display: block; color: var(--ink); font-size: 1rem; }
.cost-chip-one { top: 20px; right: 2%; transform: rotate(2deg); }
.cost-chip-two { left: 0; bottom: 35px; transform: rotate(-2deg); }
.cost-chip-three { right: 5%; bottom: 5px; }
.cost-live {
  position: absolute;
  top: 38px;
  left: 7%;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .65rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--ink-2);
  font-size: .72rem;
  font-weight: 700;
}
.cost-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 14%, transparent); }

.calculator-workspace {
  position: relative;
  background:
    linear-gradient(color-mix(in srgb, var(--line) 35%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 35%, transparent) 1px, transparent 1px),
    var(--bg-alt);
  background-size: 42px 42px;
}
.calculator-workspace::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, var(--bg-alt), transparent 22%, transparent 78%, var(--bg-alt));
}
.calculator-workspace .container { position: relative; }

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
  gap: 1.25rem;
  align-items: start;
}

.calculator-panel,
.result-panel,
.calculator-info-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.calculator-panel { padding: clamp(1.1rem, 2vw, 1.6rem); box-shadow: var(--shadow-lg); }
.calculator-panel-head { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.calculator-panel-head p { color: var(--ink-2); font-size: .93rem; }

.expense-list { display: grid; gap: .72rem; }
.expense-row {
  position: relative;
  counter-increment: expense;
  display: grid;
  grid-template-columns: minmax(130px, 1.2fr) minmax(110px, .72fr) minmax(145px, .9fr) 42px;
  gap: .65rem;
  align-items: end;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  overflow: hidden;
}
.expense-list { counter-reset: expense; }
.expense-row::before {
  content: counter(expense, decimal-leading-zero);
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 24px;
  border-radius: 0 0 0 10px;
  background: color-mix(in srgb, var(--brand) 16%, var(--surface));
  color: var(--brand);
  font-size: .66rem;
  font-weight: 800;
}
.expense-row:nth-child(3n+2)::before { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); }
.expense-row:nth-child(3n)::before { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); }

.field { display: grid; gap: .34rem; }
.field label { color: var(--ink-2); font-size: .78rem; font-weight: 700; }
.field input,
.field select {
  width: 100%;
  min-height: 44px;
  padding: .62rem .72rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
}
.field input::placeholder { color: var(--muted); opacity: .85; }
.field input:focus,
.field select:focus { border-color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 22%, transparent); outline-offset: 1px; }

.remove-expense {
  width: 42px;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}
.remove-expense:hover { color: var(--ink); background: var(--bg-alt); }
.remove-expense:disabled { opacity: .38; cursor: not-allowed; }

.calculator-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }
.calculator-actions .button { min-height: 44px; }
.button-example {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.button-example:hover { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); color: var(--accent); }
.button-minimal { padding-inline: .75rem; background: transparent; color: var(--muted); border-color: transparent; }
.button-minimal:hover { color: var(--ink); background: var(--surface-2); }
.calculator-privacy { margin-top: 1rem; color: var(--muted); font-size: .85rem; }

.result-panel {
  position: sticky;
  top: 86px;
  padding: clamp(1.2rem, 2vw, 1.6rem);
  overflow: hidden;
  color: #f3fbff;
  background:
    radial-gradient(circle at 100% 0, rgba(62, 201, 216, .2), transparent 45%),
    linear-gradient(155deg, #082235, #0b3b4c);
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 22px 55px rgba(4, 33, 49, .22);
}
.result-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.result-panel .eyebrow { color: #55d9e5; }
.result-panel h2 { font-size: 1.35rem; }
.result-kicker { margin-top: .35rem; color: rgba(239,248,255,.72); font-size: .9rem; }
.result-total { padding: 1.15rem 0; border-bottom: 1px solid rgba(255,255,255,.13); }
.result-total span { display: block; color: rgba(239,248,255,.62); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.result-total strong { display: block; margin-top: .15rem; font-size: clamp(2rem, 1.6rem + 1.4vw, 2.7rem); line-height: 1.1; letter-spacing: -.04em; }
.result-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; padding: 1rem 0; }
.result-secondary div { min-width: 0; }
.result-secondary span { display: block; color: rgba(239,248,255,.62); font-size: .78rem; }
.result-secondary strong { display: block; margin-top: .18rem; font-size: 1.03rem; }
.result-insight { padding: .8rem; border-radius: var(--r-sm); background: rgba(255,255,255,.08); color: rgba(244,252,255,.82); font-size: .87rem; border: 1px solid rgba(255,255,255,.06); }
.result-panel.is-updated .result-total strong { animation: result-pop .28s ease-out; }

@keyframes result-pop {
  0% { transform: translateY(4px); opacity: .65; }
  100% { transform: none; opacity: 1; }
}

.calculator-story { position: relative; overflow: hidden; }
.calculator-story::before {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -120px;
  top: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  filter: blur(2px);
}
.calculator-explainer { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.calculator-explainer::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  opacity: .22;
}
.calculator-info-card { position: relative; min-height: 230px; padding: 1.4rem; overflow: hidden; box-shadow: var(--shadow-md); }
.calculator-info-card::after {
  content: attr(data-step);
  position: absolute;
  right: .7rem;
  bottom: -1.5rem;
  color: color-mix(in srgb, var(--brand) 8%, transparent);
  font-size: 7rem;
  font-weight: 850;
  line-height: 1;
  pointer-events: none;
}
.calculator-info-card:nth-child(2) { transform: translateY(14px); }
.calculator-info-card:nth-child(3) { background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 10%, var(--surface)), var(--surface)); }
.calculator-info-card .number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: .85rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 14%, var(--surface));
  color: var(--brand);
  font-weight: 800;
}
.calculator-info-card p { margin-top: .5rem; color: var(--ink-2); font-size: .94rem; }

.calculator-cta {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 8% 90%, color-mix(in srgb, var(--brand) 19%, transparent), transparent 17rem),
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, var(--surface)), var(--surface));
  border: 1px solid var(--line);
}
.calculator-cta-copy p { margin-top: .65rem; color: var(--ink-2); }
.calculator-cta .cta-row { margin-top: 1.1rem; justify-content: flex-start; }
.calculator-cta-device {
  position: relative;
  width: 160px;
  margin-inline: auto;
  padding: 7px;
  border-radius: 28px;
  background: #071523;
  box-shadow: var(--shadow-lg);
  transform: rotate(-2deg);
}
.calculator-cta-device::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 42px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #071523;
  z-index: 1;
}
.calculator-cta-device picture { display: block; }
.calculator-cta-device img {
  width: 100%;
  height: auto;
  aspect-ratio: 640 / 1422;
  object-fit: contain;
  border-radius: 22px;
}

.calculator-faq-grid { display: grid; grid-template-columns: minmax(230px, .72fr) minmax(0, 1.28fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.calculator-faq-intro { position: sticky; top: 100px; }
.calculator-faq-intro .lead { margin-top: .8rem; }
.calculator-faq-grid .faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.calculator-faq-grid .faq details + details { margin-top: .7rem; }

@media (max-width: 880px) {
  .calculator-hero-grid,
  .calculator-shell,
  .calculator-cta,
  .calculator-faq-grid { grid-template-columns: 1fr; }
  .cost-visual { min-height: 280px; max-width: 520px; width: 100%; margin-inline: auto; }
  .result-panel { position: static; }
  .calculator-cta .cta-row { justify-content: flex-start; }
  .calculator-faq-intro { position: static; }
}

@media (max-width: 700px) {
  .expense-row { grid-template-columns: 1fr 1fr 42px; }
  .expense-row .field:first-child { grid-column: 1 / -1; }
  .calculator-explainer { grid-template-columns: 1fr; }
  .calculator-explainer::before { display: none; }
  .calculator-info-card { min-height: 0; }
  .calculator-info-card:nth-child(2) { transform: none; }
}

@media (max-width: 480px) {
  .calculator-hero { padding-top: 2rem; }
  .calculator-panel { padding: .85rem; }
  .calculator-panel-head { align-items: start; flex-direction: column; }
  .expense-row { grid-template-columns: 1fr 42px; padding: .75rem; }
  .expense-row .field:first-child,
  .expense-row .field:nth-child(2),
  .expense-row .field:nth-child(3) { grid-column: 1 / -1; }
  .expense-row .remove-expense { grid-column: 2; grid-row: 2; align-self: end; }
  .expense-row .field:nth-child(2) { padding-right: 50px; }
  .result-secondary { grid-template-columns: 1fr; }
  .cost-visual { min-height: 250px; transform: scale(.92); margin-block: -1rem; }
  .cost-visual::before { width: 245px; height: 245px; }
  .cost-visual::after { width: 185px; height: 185px; }
  .cost-core { width: 158px; }
  .cost-chip { min-width: 125px; padding: .58rem .7rem; }
  .cost-chip-one { right: -2%; }
  .cost-chip-two { left: -3%; }
}

@media (prefers-reduced-motion: reduce) {
  .remove-expense { transition: none; }
  .result-panel.is-updated .result-total strong { animation: none; }
}
