/* =========================================================
   Kostenrechner Qualitätssicherung — gemeinsames Stylesheet
   Wird von allen Seiten (index.html, rechner-*.html) eingebunden.
   Keine externen Fonts, keine externen Ressourcen.
   ========================================================= */

:root{
  --bg-deep:#17181b;
  --bg-panel:#212327;
  --bg-panel-2:#2a2d33;
  --line:#383b42;
  --line-soft:#2f323a;
  --orange:#ff6a1a;
  --orange-dim:#c9530f;
  --text:#edeff2;
  --text-dim:#9a9fa8;
  --text-faint:#6a6f78;
  --good:#4ecb7a;
  --warn:#e8b93e;
  --bad:#e2584f;
  --font-display: 'Bahnschrift', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

*{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }
body{
  background:var(--bg-deep);
  color:var(--text);
  font-family:var(--font-body);
  min-height:100vh;
  display:flex;
  -webkit-font-smoothing:antialiased;
}

/* --- Messskala als Hintergrund-Textur --- */
.scale-bg{
  position:fixed; inset:0; z-index:0; pointer-events:none; opacity:0.5;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0px, transparent 39px,
    var(--line-soft) 39px, var(--line-soft) 40px
  );
}

/* --- Sidebar / Menü --- */
.sidebar{
  width:280px;
  min-width:280px;
  background:var(--bg-panel);
  border-right:1px solid var(--line);
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  flex-direction:column;
  height:100vh;
}
.brand{
  padding:28px 24px 20px 24px;
  border-bottom:1px solid var(--line);
}
.brand-mark{ display:flex; align-items:center; gap:10px; margin-bottom:6px; }
.brand-tick{ width:8px; height:22px; background:var(--orange); }
.brand h1{
  font-family:var(--font-display);
  font-size:18px;
  font-weight:600;
  letter-spacing:0.02em;
  line-height:1.15;
}
.brand p{ font-size:12px; color:var(--text-dim); margin-top:6px; line-height:1.5; }

nav{ padding:18px 12px; flex:1; overflow-y:auto; }
.nav-label{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:0.12em;
  color:var(--text-faint);
  padding:0 12px 10px 12px;
  font-weight:600;
}
a.nav-item{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  text-align:left;
  background:none;
  border:none;
  color:var(--text-dim);
  text-decoration:none;
  font-family:var(--font-body);
  font-size:14px;
  font-weight:500;
  padding:13px 12px;
  border-radius:6px;
  cursor:pointer;
  position:relative;
  transition:background 0.15s ease, color 0.15s ease;
}
.nav-item .idx{
  font-family:var(--font-display);
  font-size:12px;
  color:var(--text-faint);
  min-width:20px;
}
.nav-item:hover{ background:var(--bg-panel-2); color:var(--text); }
.nav-item.active{ background:var(--bg-panel-2); color:var(--text); }
.nav-item.active::before{
  content:"";
  position:absolute;
  left:0; top:8px; bottom:8px;
  width:3px;
  background:var(--orange);
}
.nav-item.active .idx{ color:var(--orange); }
.soon-tag{
  margin-left:auto;
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  background:var(--bg-deep);
  border:1px solid var(--line);
  color:var(--text-faint);
  padding:3px 6px;
  border-radius:3px;
  font-weight:600;
}
.sidebar-foot{
  padding:16px 24px;
  border-top:1px solid var(--line);
  font-size:11px;
  color:var(--text-faint);
  line-height:1.6;
}

/* --- Hauptbereich --- */
main{ flex:1; position:relative; z-index:1; min-width:0; }
.page{
  padding:48px 56px 80px 56px;
  max-width:1180px;
  animation:fadeIn 0.35s ease;
}
@keyframes fadeIn{
  from{ opacity:0; transform:translateY(6px); }
  to{ opacity:1; transform:translateY(0); }
}

.eyebrow{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:12px;
  letter-spacing:0.12em;
  text-transform:uppercase;
  color:var(--orange);
  font-weight:600;
  margin-bottom:14px;
}
.eyebrow .tick-row{ display:flex; gap:2px; }
.eyebrow .tick-row span{ width:2px; height:10px; background:var(--orange); opacity:0.5; }
.eyebrow .tick-row span:nth-child(2){ height:14px; opacity:1; }

h2.page-title{
  font-family:var(--font-display);
  font-size:38px;
  font-weight:600;
  line-height:1.15;
  max-width:720px;
  letter-spacing:0.01em;
}
.page-sub{
  color:var(--text-dim);
  font-size:15px;
  max-width:640px;
  margin-top:14px;
  line-height:1.65;
}

.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:28px;
  margin-top:40px;
  align-items:start;
}

.panel{
  background:var(--bg-panel);
  border:1px solid var(--line);
  border-radius:10px;
  padding:28px 28px 30px 28px;
}
.panel h3{
  font-family:var(--font-display);
  font-size:15px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.06em;
  color:var(--text-dim);
  margin-bottom:22px;
  display:flex;
  align-items:center;
  gap:10px;
}
.panel h3::after{ content:""; flex:1; height:1px; background:var(--line); }

.field{ margin-bottom:20px; }
.field:last-child{ margin-bottom:0; }
.field label{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  font-size:13px;
  color:var(--text-dim);
  margin-bottom:9px;
  font-weight:500;
}
.field label .val{
  font-family:var(--font-display);
  color:var(--orange);
  font-size:15px;
  font-weight:600;
}
input[type="range"]{
  -webkit-appearance:none;
  width:100%;
  height:4px;
  background:var(--line);
  border-radius:2px;
  outline:none;
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:16px; height:16px;
  background:var(--orange);
  border-radius:2px;
  cursor:pointer;
  border:2px solid var(--bg-panel);
  box-shadow:0 0 0 1px var(--orange);
}
input[type="range"]::-moz-range-thumb{
  width:16px; height:16px;
  background:var(--orange);
  border-radius:2px;
  cursor:pointer;
  border:2px solid var(--bg-panel);
}
input[type="number"]{
  width:100%;
  background:var(--bg-deep);
  border:1px solid var(--line);
  color:var(--text);
  font-family:var(--font-body);
  font-size:14px;
  padding:11px 12px;
  border-radius:6px;
  outline:none;
}
input[type="number"]:focus, input[type="range"]:focus{
  border-color:var(--orange);
  box-shadow:0 0 0 3px rgba(255,106,26,0.15);
}
.field-hint{ font-size:11.5px; color:var(--text-faint); margin-top:7px; line-height:1.5; }

/* Ergebnis-Panel */
.result-panel{
  background:linear-gradient(180deg, var(--bg-panel-2), var(--bg-panel));
  border:1px solid var(--line);
  border-radius:10px;
  padding:30px 28px;
  position:sticky;
  top:28px;
}
.result-hero{ text-align:left; padding-bottom:24px; border-bottom:1px solid var(--line); margin-bottom:24px; }
.result-hero .label{
  font-size:12px; text-transform:uppercase; letter-spacing:0.1em;
  color:var(--text-dim); font-weight:600; margin-bottom:10px;
}
.result-hero .amount{
  font-family:var(--font-display);
  font-size:50px;
  font-weight:700;
  color:var(--good);
  line-height:1;
  letter-spacing:-0.01em;
}
.result-hero .amount span{ font-size:22px; color:var(--text-dim); font-weight:500; margin-left:6px; }
.result-hero .sub{ font-size:13px; color:var(--text-dim); margin-top:10px; }

.result-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:24px; }
.stat{ background:var(--bg-deep); border:1px solid var(--line); border-radius:8px; padding:16px; }
.stat .label{
  font-size:11px; text-transform:uppercase; letter-spacing:0.06em;
  color:var(--text-faint); font-weight:600; margin-bottom:8px;
}
.stat .value{ font-family:var(--font-display); font-size:22px; font-weight:600; }
.stat .value.orange{ color:var(--orange); }

/* Balken-Vergleich */
.bars{ margin-top:4px; }
.bar-row{ margin-bottom:16px; }
.bar-row:last-child{ margin-bottom:0; }
.bar-row .bar-label{ display:flex; justify-content:space-between; font-size:12.5px; color:var(--text-dim); margin-bottom:7px; }
.bar-row .bar-label b{ color:var(--text); font-weight:600; }
.bar-track{ height:10px; background:var(--bg-deep); border-radius:2px; overflow:hidden; border:1px solid var(--line); }
.bar-fill{ height:100%; border-radius:1px; transition:width 0.4s ease; }
.bar-fill.manual{ background:var(--text-faint); }
.bar-fill.digital{ background:var(--orange); }

.amort-note{ margin-top:22px; padding-top:20px; border-top:1px solid var(--line); font-size:12.5px; color:var(--text-dim); line-height:1.6; }
.amort-note b{ color:var(--text); }

.disclaimer{ margin-top:36px; font-size:11.5px; color:var(--text-faint); line-height:1.6; max-width:760px; }

/* Platzhalter-Seiten */
.placeholder-box{
  margin-top:40px;
  border:1px dashed var(--line);
  border-radius:10px;
  padding:56px 40px;
  text-align:center;
  max-width:560px;
}
.placeholder-box .ph-mark{
  width:40px; height:40px;
  margin:0 auto 18px auto;
  border:1px solid var(--line);
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--text-faint);
  font-family:var(--font-display);
  font-weight:600;
}
.placeholder-box h4{ font-family:var(--font-display); font-size:19px; font-weight:600; margin-bottom:10px; }
.placeholder-box p{ font-size:13.5px; color:var(--text-dim); line-height:1.6; }

/* Startseite / Übersichtskarten */
.overview-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));
  gap:20px;
  margin-top:40px;
  max-width:900px;
}
.overview-card{
  display:block;
  background:var(--bg-panel);
  border:1px solid var(--line);
  border-radius:10px;
  padding:26px;
  text-decoration:none;
  color:var(--text);
  transition:border-color 0.15s ease, transform 0.15s ease;
}
.overview-card:hover{ border-color:var(--orange); transform:translateY(-2px); }
.overview-card .idx{
  font-family:var(--font-display);
  color:var(--orange);
  font-size:13px;
  font-weight:600;
  margin-bottom:10px;
  display:block;
}
.overview-card h4{ font-family:var(--font-display); font-size:18px; font-weight:600; margin-bottom:8px; }
.overview-card p{ font-size:13px; color:var(--text-dim); line-height:1.55; }
.overview-card .tag{
  display:inline-block;
  margin-top:14px;
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:var(--text-faint);
  border:1px solid var(--line);
  padding:3px 7px;
  border-radius:3px;
}

/* 1-10-100-Regel */
.rule-steps{
  display:flex;
  align-items:stretch;
  gap:0;
  margin-top:4px;
}
.rule-step{
  flex:1;
  background:var(--bg-deep);
  border:1px solid var(--line);
  border-radius:8px;
  padding:20px 18px;
  text-align:center;
}
.rule-mult{
  font-family:var(--font-display);
  font-size:30px;
  font-weight:700;
  color:var(--orange);
  line-height:1;
  margin-bottom:8px;
}
.rule-step:first-child .rule-mult{ color:var(--good); }
.rule-name{
  font-family:var(--font-display);
  font-size:13px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.04em;
  margin-bottom:8px;
}
.rule-desc{
  font-size:11.5px;
  color:var(--text-dim);
  line-height:1.5;
}
.rule-arrow{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 10px;
  color:var(--text-faint);
  font-size:18px;
}

/* Section-Toggle (Ein/Aus für ganzen Rechnungsteil) */
.section-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  background:var(--bg-panel);
  border:1px solid var(--line);
  border-radius:10px;
  padding:18px 22px;
  margin-top:56px;
}
.section-toggle-text .eyebrow{ margin-top:0; margin-bottom:6px; }
.section-toggle-text h3{
  font-family:var(--font-display);
  font-size:17px;
  font-weight:600;
}
.section-toggle-text p{
  font-size:12.5px;
  color:var(--text-dim);
  margin-top:5px;
  max-width:520px;
  line-height:1.5;
}
.switch{
  position:relative;
  display:inline-block;
  width:46px;
  height:26px;
  flex-shrink:0;
}
.switch input{
  opacity:0;
  width:0;
  height:0;
}
.switch-track{
  position:absolute;
  cursor:pointer;
  inset:0;
  background:var(--bg-deep);
  border:1px solid var(--line);
  border-radius:14px;
  transition:background 0.15s ease, border-color 0.15s ease;
}
.switch-track::before{
  content:"";
  position:absolute;
  height:18px;
  width:18px;
  left:3px;
  top:2px;
  background:var(--text-faint);
  border-radius:50%;
  transition:transform 0.15s ease, background 0.15s ease;
}
.switch input:checked + .switch-track{
  background:rgba(255,106,26,0.15);
  border-color:var(--orange);
}
.switch input:checked + .switch-track::before{
  transform:translateX(20px);
  background:var(--orange);
}
.fehler-content{
  transition:opacity 0.15s ease;
}
.fehler-content.is-disabled{
  display:none;
}
.section-toggle-status{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:0.06em;
  color:var(--text-faint);
  font-weight:600;
  min-width:70px;
  text-align:right;
}

/* Ampel-Bewertung */
.metric-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:16px 0;
  border-bottom:1px solid var(--line);
}
.metric-row:last-child{ border-bottom:none; }
.metric-row .metric-name{
  font-size:13px;
  color:var(--text-dim);
  font-weight:500;
}
.metric-row .metric-value-wrap{
  display:flex;
  align-items:center;
  gap:12px;
}
.metric-row .metric-value{
  font-family:var(--font-display);
  font-size:24px;
  font-weight:600;
  min-width:70px;
  text-align:right;
}
.ampel{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:11px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.04em;
  padding:5px 10px;
  border-radius:20px;
  white-space:nowrap;
}
.ampel-dot{ width:7px; height:7px; border-radius:50%; }
.ampel.good{ background:rgba(78,203,122,0.12); color:var(--good); }
.ampel.good .ampel-dot{ background:var(--good); }
.ampel.warn{ background:rgba(232,185,62,0.12); color:var(--warn); }
.ampel.warn .ampel-dot{ background:var(--warn); }
.ampel.bad{ background:rgba(226,88,79,0.12); color:var(--bad); }
.ampel.bad .ampel-dot{ background:var(--bad); }

textarea{
  width:100%;
  background:var(--bg-deep);
  border:1px solid var(--line);
  color:var(--text);
  font-family:var(--font-body);
  font-size:13px;
  padding:11px 12px;
  border-radius:6px;
  outline:none;
  resize:vertical;
  min-height:64px;
}
textarea:focus{ border-color:var(--orange); box-shadow:0 0 0 3px rgba(255,106,26,0.15); }

.btn-secondary{
  background:var(--bg-panel-2);
  border:1px solid var(--line);
  color:var(--text);
  font-family:var(--font-body);
  font-size:12.5px;
  font-weight:600;
  padding:9px 16px;
  border-radius:6px;
  cursor:pointer;
  margin-top:10px;
  transition:border-color 0.15s ease, color 0.15s ease;
}
.btn-secondary:hover{ border-color:var(--orange); color:var(--orange); }

.series-note{
  font-size:11.5px;
  color:var(--text-faint);
  margin-top:8px;
  line-height:1.5;
}

/* Segmented Control (z. B. Einmalig / Monatlich) */
.seg-control{
  display:inline-flex;
  background:var(--bg-deep);
  border:1px solid var(--line);
  border-radius:8px;
  padding:3px;
  gap:3px;
}
.seg-btn{
  background:none;
  border:none;
  color:var(--text-dim);
  font-family:var(--font-body);
  font-size:13px;
  font-weight:600;
  padding:9px 18px;
  border-radius:6px;
  cursor:pointer;
  transition:background 0.15s ease, color 0.15s ease;
}
.seg-btn:hover{ color:var(--text); }
.seg-btn.active{
  background:var(--orange);
  color:#1a1200;
}

/* Norm-Hinweis (kurze Einordnung, kein Zitat) */
.norm-note{
  display:flex;
  gap:10px;
  align-items:flex-start;
  background:var(--bg-deep);
  border-left:2px solid var(--orange);
  border-radius:0 6px 6px 0;
  padding:10px 14px;
  margin-top:16px;
  margin-bottom:4px;
  max-width:640px;
}
.norm-note .norm-label{
  font-family:var(--font-display);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:0.06em;
  color:var(--orange);
  font-weight:600;
  white-space:nowrap;
  padding-top:1px;
}
.norm-note p{
  font-size:12px;
  color:var(--text-dim);
  line-height:1.55;
  margin:0;
}

@media (max-width:980px){
  .rule-steps{ flex-direction:column; gap:10px; }
  .rule-arrow{ transform:rotate(90deg); padding:0; }
  body{ flex-direction:column; }
  .sidebar{ width:100%; min-width:0; height:auto; position:relative; flex-direction:row; align-items:center; overflow-x:auto; }
  .brand{ border-bottom:none; border-right:1px solid var(--line); white-space:nowrap; }
  nav{ display:flex; padding:12px; gap:4px; }
  .nav-label{ display:none; }
  .sidebar-foot{ display:none; }
  .page{ padding:32px 22px 60px 22px; }
  .grid{ grid-template-columns:1fr; }
  .result-panel{ position:relative; top:0; }
  h2.page-title{ font-size:28px; }
  .result-hero .amount{ font-size:38px; }
}
