/* =========================================
   CALCULATOR.CSS (DOMAIN C - BAUKOSTEN-RECHNER)
   100% FEHLERFREI & SAUBER - Perfektes Layout
   ========================================= */

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-hero: #020617;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #f97316;
  --accent-hover: #ea580c;
  --border: #334155;
  --font-base: ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, monospace;
  --radius: 8px;
  
  /* Zentrale Layout-Breiten */
  --width-content: 1000px; 
  --width-layout: 1200px;  
}

*, *::before, *::after { box-sizing: border-box; }

body, html {
  margin: 0;
  padding: 0;
  font-family: var(--font-base);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

img, video, iframe { max-width: 100%; height: auto; }

/* --- TYPOGRAFIE --- */
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); line-height: 1.2; margin-top: 0; margin-bottom: 1.2rem; color: var(--text-main); }
h2 { font-size: clamp(1.5rem, 4vw, 1.8rem); line-height: 1.3; color: var(--text-main); margin-top: 3rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); line-height: 1.4; color: var(--text-main); margin-top: 2rem; margin-bottom: 1rem; }
a { color: var(--accent); text-decoration: none; transition: all 0.2s; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

p, ul, ol { margin-bottom: 1.5rem; line-height: 1.7; font-size: 1.05rem; color: var(--text-muted); }
strong { color: var(--text-main); }
ul { padding-left: 1.5rem; }
li { margin-bottom: 0.5rem; }

.page-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

/* --- 1. HEADER --- */
.calc-site-header {
  background-color: var(--bg-hero);
  border-bottom: 1px solid var(--border);
  padding: 1.2rem 1.5rem;
  
  /* Sauberer Ausbruch aus dem main-Container für volle Breite */
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  
  /* Zieht den Header exakt um das main-Padding nach oben, damit er bündig abschließt */
  margin-top: -3rem; 
  margin-bottom: 3rem;
  box-sizing: border-box;
  z-index: 100;
}

.calc-header-container {
  max-width: var(--width-layout);
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.calc-logo {
  font-family: var(--font-base);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
}

.calc-logo:hover { text-decoration: none; }

.calc-nav-list {
  display: flex;
  flex-direction: row;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
  align-items: center;
}

.calc-nav-list li { margin: 0; }

.calc-nav-list a {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
}

.calc-nav-list a:hover { color: var(--accent); text-decoration: none; }

.calc-has-submenu { position: relative; }

.calc-submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  list-style: none;
  padding: 0.5rem 0;
  min-width: 220px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 1000;
}

.calc-has-submenu:hover .calc-submenu { display: block; }
.calc-submenu li { margin: 0; }
.calc-submenu li a { display: block; padding: 0.6rem 1rem; font-weight: 400; color: var(--text-muted); text-decoration: none; }
.calc-submenu li a:hover { background: var(--bg-primary); color: var(--accent); }

.calc-btn-outline {
  background-color: var(--accent);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}

.calc-btn-outline:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
}

/* Mobile Optimierung Header Domain C */
@media (max-width: 768px) {
  .calc-site-header { padding: 1rem 1.5rem; margin-bottom: 2rem; }
  .calc-header-container { flex-direction: column; text-align: center; gap: 1.2rem; }
  .calc-logo { font-size: 1.15rem; white-space: normal; line-height: 1.3; }
  .calc-nav-list { flex-wrap: wrap; justify-content: center; gap: 1rem; }
  .calc-btn-outline { display: block; width: 100%; text-align: center; box-sizing: border-box; }
  .calc-has-submenu:hover .calc-submenu, .calc-has-submenu:active .calc-submenu { display: none; }
}

/* --- 2. DIE LAYOUT-REGEL (1200px / 1000px) --- */
main, .content-area, .calc-content-wrapper { 
  max-width: var(--width-layout); 
  margin: 0 auto; 
  padding: 3rem 1.5rem; 
  width: 100%; 
  overflow-x: visible; 
}

/* Texte werden auf 1000px limitiert. Header, Rechner und Dashboard dürfen volle 1200px nutzen. */
main > *:not(.calc-site-header):not(.calc-engine-ui):not(.calc-dash-card), 
.content-area > *:not(.calc-site-header):not(.calc-engine-ui):not(.calc-dash-card), 
.calc-content-wrapper > *:not(.calc-site-header):not(.calc-engine-ui):not(.calc-dash-card) { 
  max-width: var(--width-content); 
  margin-left: 0; 
  margin-right: auto; 
}

/* --- 3. DASHBOARD KARTEN --- */
.calc-dash-card { 
  background: var(--bg-secondary); 
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  padding: 2.5rem; 
  margin: 3rem 0; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.2); 
  width: 100%; 
}
.calc-dash-header-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 1.5rem; border-bottom: 1px dashed var(--border); padding-bottom: 1rem; }
.calc-dash-dot { width: 10px; height: 10px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 8px var(--accent); flex-shrink: 0; }
.calc-dash-heading { margin: 0; font-size: 1.2rem; color: var(--text-main); font-weight: 600; }

.calc-bar-track { display: flex; height: 28px; background: var(--bg-hero); border-radius: 6px; overflow: hidden; margin: 2rem 0; font-size: 0.8rem; font-weight: 700; border: 1px solid var(--border); }
.calc-bar-subs { background: #10b981; color: #ffffff; display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; }
.calc-bar-own { background: var(--accent); color: #ffffff; display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; }

.calc-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin-top: 1.5rem; }
.calc-stat-box { background: transparent; padding: 0; border: none; }
.calc-stat-label { color: var(--text-muted); display: block; margin-bottom: 5px; font-size: 0.85rem; }
.calc-stat-val { font-size: 1.6rem; font-weight: bold; font-family: var(--font-mono); }
.calc-val-total { color: var(--text-main); }
.calc-val-sub { color: #10b981; }
.calc-val-net { color: var(--accent); }

/* Mobile Optimierung Dashboard */
@media (max-width: 768px) {
  .calc-dash-card { padding: 1.5rem; margin: 1.5rem 0; }
  .calc-dash-heading { font-size: 1.05rem; line-height: 1.4; }
  .calc-bar-track { height: 24px; font-size: 0.65rem; margin: 1.5rem 0; }
  .calc-bar-subs, .calc-bar-own { padding: 0 4px; letter-spacing: -0.2px; text-overflow: clip; }
  .calc-stats-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .calc-stat-val { font-size: 1.4rem; }
}
/* --- 4. KALKULATOR / QUIZ ENGINE (Formulare - VOLLE BREITE) --- */
.calc-engine-ui { 
  background: var(--bg-secondary); 
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  padding: 2.5rem; 
  margin: 3rem 0; 
  width: 100%; 
  max-width: 100% !important; /* Erzwingt volle 1200px Breite */
  box-shadow: 0 10px 30px rgba(0,0,0,0.2); 
}
.calc-engine-head h3 { margin-top: 0; margin-bottom: 1rem; font-size: 1.6rem; color: var(--text-main); }
.calc-engine-head p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; }

progress#calc-prog { width: 100%; height: 6px; appearance: none; border: none; background-color: var(--bg-hero); border-radius: 4px; overflow: hidden; margin-bottom: 2.5rem; }
progress#calc-prog::-webkit-progress-bar { background-color: var(--bg-hero); border-radius: 4px; }
progress#calc-prog::-webkit-progress-value { background-color: var(--accent); border-radius: 4px; }
progress#calc-prog::-moz-progress-bar { background-color: var(--accent); border-radius: 4px; }

.calc-phase { border: none; padding: 0; margin: 0; background: transparent; max-width: 100%; }
.calc-phase legend { padding: 0; color: var(--text-main); font-weight: bold; font-size: 1.2rem; margin-bottom: 1.5rem; width: 100%; }

.calc-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-top: 0; }
.calc-opt-box { background: var(--bg-hero); border: 2px solid var(--border); padding: 1.5rem; border-radius: var(--radius); cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; gap: 15px; transition: all 0.2s; color: var(--text-main); font-size: 1.1rem; font-weight: 600; position: relative; }
.calc-opt-box input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.calc-opt-box::before { content: ''; display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--border); transition: all 0.2s; }
.calc-opt-box:hover { border-color: rgba(249, 115, 22, 0.5); transform: translateY(-3px); }
.calc-opt-box:has(input:checked) { border-color: var(--accent); background: rgba(249, 115, 22, 0.05); }
.calc-opt-box:has(input:checked)::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.calc-opt-box span { display: block; line-height: 1.4; }

/* --- 5. BREADCRUMBS --- */
.calc-path-nav { max-width: var(--width-layout); margin: 0 auto; padding: 1.2rem 1.5rem; font-family: var(--font-mono); font-size: 0.8rem; border-bottom: 1px solid var(--border); }
.calc-path-track { list-style: none; padding: 0; margin: 0; display: flex; align-items: center; gap: 10px; color: var(--text-muted); }
.calc-path-link { color: var(--accent); text-decoration: none; text-transform: uppercase; }
.calc-path-link:hover { text-decoration: underline; }
.calc-path-divider { font-size: 0.75rem; opacity: 0.7; }
.calc-path-active { color: var(--text-main); font-weight: bold; text-transform: uppercase; }

/* --- 6. HUB & SILO A-Z VERZEICHNIS --- */
.calc-hub-dashboard { max-width: var(--width-layout); margin: 0 auto; padding: 2rem 1.5rem; }
.calc-hub-head { margin: 3rem 0; border-bottom: 1px solid var(--border); padding-bottom: 2rem; text-align: left; }
.calc-hub-head h1 { font-family: var(--font-mono); font-size: 2.5rem; color: var(--text-main); text-transform: uppercase; margin: 0 0 10px 0; letter-spacing: -1px; }
.calc-hub-head p { color: var(--text-muted); font-size: 1.15rem; margin: 0; max-width: var(--width-content); }

.calc-az-panel { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; margin-top: 4rem; max-width: var(--width-content); }
.calc-panel-title { background: var(--bg-hero); color: var(--accent); padding: 12px 15px; font-weight: bold; text-transform: uppercase; font-size: 1rem; margin-bottom: 1.5rem; font-family: var(--font-mono); border: 1px solid var(--border); border-radius: var(--radius); }
.calc-index-links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 2rem; }
.calc-index-tag, .calc-az-panel a { display: inline-block; background: var(--bg-hero); border: 1px solid var(--border); color: var(--text-muted); padding: 8px 15px; font-family: var(--font-mono); font-size: 0.9rem; text-decoration: none; border-radius: var(--radius); transition: all 0.2s; }
.calc-index-tag:hover, .calc-az-panel a:hover { border-color: var(--accent); color: var(--text-main); box-shadow: 0 0 10px rgba(249, 115, 22, 0.2); }

/* --- 7. RATGEBER (DOC-VIEW) --- */
.calc-doc-view { max-width: var(--width-layout); margin: 0 auto; padding: 2rem 1.5rem; }
.calc-doc-header { background: var(--bg-secondary); border: 1px solid var(--border); padding: 3rem; border-radius: var(--radius); margin-bottom: 3rem; max-width: var(--width-content); }
.calc-doc-tag { font-family: var(--font-mono); background: var(--bg-hero); color: var(--accent); padding: 6px 12px; border-radius: var(--radius); font-size: 0.85rem; border: 1px solid var(--border); display: inline-block; margin-bottom: 1.5rem; text-transform: uppercase; }
.calc-doc-title { font-size: 2.2rem; color: var(--text-main); margin: 0 0 1.5rem 0; }
.calc-doc-summary { font-size: 1.1rem; color: var(--text-muted); margin: 0; line-height: 1.7; }

/* --- 7.b RATGEBER WEITERE ARTIKEL (Fehlender Block) --- */
.calc-doc-related { background: var(--bg-hero); border: 1px solid var(--border); padding: 2.5rem; border-radius: var(--radius); margin-top: 4rem; width: 100%; max-width: var(--width-content); }
.calc-doc-related h3 { color: var(--text-main); font-size: 1.2rem; text-transform: uppercase; margin-bottom: 1.5rem; font-family: var(--font-mono); }
.calc-related-links { display: flex; flex-direction: column; gap: 10px; }
.calc-related-tag { color: var(--accent); text-decoration: none; font-size: 1rem; padding: 12px 15px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); transition: all 0.2s; display: block; font-weight: 600; }
.calc-related-tag:hover { border-color: var(--accent); color: var(--text-main); padding-left: 20px; box-shadow: 0 0 10px rgba(249, 115, 22, 0.2); }

/* --- 8. FOOTER --- */
.calc-site-footer { background-color: var(--bg-hero); color: var(--text-muted); padding: 4rem 0 2rem; margin-top: 5rem; border-top: 1px solid var(--border); }
.calc-footer-container { max-width: var(--width-layout); margin: 0 auto; padding: 0 1.5rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 3rem; margin-bottom: 3rem; }
.calc-footer-logo { font-size: 1.4rem; font-weight: 800; margin-bottom: 1rem; display: block; font-family: var(--font-mono); color: var(--text-main); text-transform: uppercase; }
.calc-footer-text { font-size: 0.95rem; line-height: 1.6; }
.calc-footer-heading { font-size: 1rem; font-weight: bold; margin-bottom: 1.2rem; display: block; color: var(--text-main); font-family: var(--font-mono); text-transform: uppercase; }
.calc-footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.calc-footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; transition: color 0.2s; }
.calc-footer-links a:hover { color: var(--accent); }
.calc-footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; text-align: center; font-size: 0.85rem; color: #475569; font-family: var(--font-mono); }