/* =============================================================
   FinanzRechner.de — Globales Stylesheet
   Mobile-First, Vanilla CSS, kein Framework
   ============================================================= */

/* ---- CSS-Variablen ---- */
:root {
  --c-brand:      #1a56db;
  --c-brand-dk:   #1546c0;
  --c-brand-lt:   #ebf5ff;
  --c-dark:       #0d1b2a;
  --c-slate:      #1e3a5f;
  --c-body:       #1a202c;
  --c-muted:      #64748b;
  --c-bg:         #f7f9fc;
  --c-white:      #ffffff;
  --c-border:     #e2e8f0;
  --c-success:    #15803d;
  --c-error:      #b91c1c;
  --c-warn-bg:    #fffbeb;
  --c-warn-bdr:   #f59e0b;
  --c-result-bg:  #eff6ff;
  --c-result-bdr: #bfdbfe;
  --radius:       10px;
  --radius-lg:    16px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:       0 4px 12px rgba(0,0,0,.1);
  --shadow-lg:    0 10px 30px rgba(0,0,0,.12);
  --transition:   0.25s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-body);
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--c-brand); text-decoration: none; transition: color var(--transition); }
a:hover { text-decoration: underline; color: var(--c-brand-dk); }
ul, ol { padding-left: 1.5rem; }

/* ---- Typografie ---- */
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; color: var(--c-dark); margin-bottom: 1rem; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; line-height: 1.2; color: var(--c-dark); margin: 2.5rem 0 1rem; }
h3 { font-size: 1.25rem; font-weight: 700; color: var(--c-dark); margin: 1.5rem 0 .75rem; }
h4 { font-size: 1.05rem; font-weight: 600; color: var(--c-dark); margin: 1rem 0 .5rem; }
p  { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }
strong { color: var(--c-dark); }

/* ---- Layout ---- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.container--narrow { max-width: 780px; }
.main-content { flex: 1; padding: 3rem 0 4rem; }
section + section { margin-top: 3rem; }

/* ---- Navigation ---- */
.site-header {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
  gap: 2rem;
}
.site-logo {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--c-dark);
  white-space: nowrap;
  letter-spacing: -.03em;
}
.site-logo span { color: var(--c-brand); }
.site-logo:hover { text-decoration: none; opacity: .9; }

/* Dropdown Nav */
.nav-menu { display: flex; list-style: none; padding: 0; margin: 0; gap: .25rem; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  display: block;
  padding: .5rem .75rem;
  font-size: .95rem;
  font-weight: 600;
  color: var(--c-body);
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}
.nav-menu > li > a:hover,
.nav-menu > li.active > a {
  background: var(--c-brand-lt);
  color: var(--c-brand);
  text-decoration: none;
}
/* Dropdown */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 230px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: .5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all var(--transition);
  z-index: 200;
}
.nav-menu > li:hover .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown li a {
  display: block;
  padding: .55rem 1.1rem;
  font-size: .9rem;
  color: var(--c-body);
  transition: background var(--transition);
}
.nav-dropdown li a:hover { background: var(--c-brand-lt); color: var(--c-brand); text-decoration: none; }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: .45rem .6rem;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--c-dark);
  line-height: 1;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--c-brand); color: #fff; border-color: var(--c-brand); }
.btn-primary:hover { background: var(--c-brand-dk); border-color: var(--c-brand-dk); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(26,86,219,.35); }
.btn-outline { background: transparent; color: var(--c-brand); border-color: var(--c-brand); }
.btn-outline:hover { background: var(--c-brand-lt); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--c-muted); border-color: var(--c-border); }
.btn-ghost:hover { background: var(--c-bg); color: var(--c-body); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: .5rem 1rem; font-size: .875rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.125rem; }
.btn-group { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1.25rem; }
label.form-label { display: block; font-size: .9rem; font-weight: 600; color: var(--c-dark); margin-bottom: .4rem; }
.form-control {
  width: 100%;
  padding: .7rem 1rem;
  font-size: 1rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--c-body);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus { outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 3px rgba(26,86,219,.15); }
.input-addon { display: flex; }
.input-addon .form-control { border-right: none; border-radius: var(--radius) 0 0 var(--radius); }
.input-addon-text {
  display: flex; align-items: center;
  padding: 0 .9rem;
  background: #f1f5f9;
  border: 1.5px solid var(--c-border);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 700;
  font-size: .9rem;
  color: var(--c-muted);
  white-space: nowrap;
}
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%2364748b'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
textarea.form-control { resize: vertical; min-height: 130px; }

/* ---- Card ---- */
.card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-link:hover { border-color: #93c5fd; box-shadow: var(--shadow); transform: translateY(-4px); }

/* ---- Calculator Card (main page element) ---- */
.calc-wrapper {
  background: var(--c-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.calc-wrapper__header {
  background: linear-gradient(135deg, var(--c-brand) 0%, var(--c-slate) 100%);
  padding: 2rem 2rem 1.5rem;
  color: white;
}
.calc-wrapper__header h1 { color: white; margin-bottom: .5rem; }
.calc-wrapper__header p { color: rgba(255,255,255,.85); margin: 0; font-size: 1.05rem; }
.calc-wrapper__body { padding: 2rem; }

/* ---- Result Box ---- */
.result-box {
  background: var(--c-result-bg);
  border: 2px solid var(--c-result-bdr);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
  display: none;
}
.result-box.is-active { display: block; animation: fadeUp .4s ease; }
.result-box__heading {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: #1e40af;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 1.25rem;
}
.result-row { display: flex; justify-content: space-between; align-items: center; padding: .65rem 0; border-bottom: 1px solid #dbeafe; }
.result-row:last-child { border-bottom: none; }
.result-row--total { margin-top: .5rem; padding-top: .75rem; border-top: 2px solid #93c5fd; border-bottom: none; }
.result-label { font-size: .95rem; color: #1e40af; font-weight: 500; }
.result-value { font-weight: 800; font-size: 1rem; color: var(--c-dark); }
.result-value.is-highlight { color: var(--c-brand); font-size: 1.3rem; }
.result-value.is-deduct { color: var(--c-error); }
.result-value.is-plus  { color: var(--c-success); }

/* ---- Notice / Hinweis ---- */
.notice {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: .875rem;
  line-height: 1.55;
}
.notice--warn { background: var(--c-warn-bg); border-left: 4px solid var(--c-warn-bdr); color: #78350f; }
.notice--info { background: #eff6ff; border-left: 4px solid #60a5fa; color: #1e3a8a; }
.notice p { margin: 0; }

/* ---- Hero (Homepage) ---- */
.hero {
  padding: 4.5rem 0 3.5rem;
  text-align: center;
  background: linear-gradient(160deg, #fff 0%, #eff6ff 100%);
  border-bottom: 1px solid var(--c-border);
}
.hero__eyebrow { display: inline-block; background: var(--c-brand-lt); color: var(--c-brand); font-size: .85rem; font-weight: 700; padding: .35rem .85rem; border-radius: 30px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 1.25rem; }
.hero__title { max-width: 800px; margin: 0 auto 1.25rem; }
.hero__sub { max-width: 650px; margin: 0 auto 2.25rem; font-size: 1.125rem; color: var(--c-muted); }
.hero__badges { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 2rem; }
.badge { display: inline-flex; align-items: center; gap: .4rem; background: var(--c-white); border: 1px solid var(--c-border); border-radius: 30px; padding: .35rem .9rem; font-size: .82rem; font-weight: 600; color: var(--c-muted); }
.badge svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ---- Tool Grid ---- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.tool-card { display: flex; flex-direction: column; }
.tool-card__icon { width: 44px; height: 44px; background: var(--c-brand-lt); border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; font-size: 1.4rem; }
.tool-card h3 { font-size: 1.1rem; margin: 0 0 .5rem; }
.tool-card p { font-size: .9rem; color: var(--c-muted); flex: 1; margin-bottom: 1.25rem; }

/* ---- Blog Grid ---- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1.5rem; }
.blog-card { display: flex; flex-direction: column; border-radius: var(--radius-lg); }
.blog-card__img { aspect-ratio: 16/9; background: linear-gradient(135deg, #1a56db, #1e3a5f); border-radius: var(--radius) var(--radius) 0 0; display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.blog-card__body { padding: 1.25rem 1.5rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.blog-card__tag { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-brand); margin-bottom: .5rem; }
.blog-card__title { font-size: 1.1rem; font-weight: 700; color: var(--c-dark); margin-bottom: .6rem; line-height: 1.3; }
.blog-card__title a { color: inherit; }
.blog-card__title a:hover { color: var(--c-brand); text-decoration: none; }
.blog-card__excerpt { font-size: .9rem; color: var(--c-muted); flex: 1; margin-bottom: 1rem; }
.blog-card__meta { font-size: .8rem; color: var(--c-muted); }

/* ---- FAQ ---- */
.faq-list { list-style: none; padding: 0; margin: 0; }
.faq-item { border: 1px solid var(--c-border); border-radius: var(--radius); margin-bottom: .75rem; overflow: hidden; }
.faq-question {
  width: 100%; background: none; border: none; text-align: left;
  padding: 1rem 1.25rem; font-size: 1rem; font-weight: 700; color: var(--c-dark);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  transition: background var(--transition);
}
.faq-question:hover { background: var(--c-bg); }
.faq-question .icon { width: 22px; height: 22px; flex-shrink: 0; background: var(--c-brand-lt); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .9rem; color: var(--c-brand); transition: transform var(--transition); }
.faq-item.is-open .faq-question { background: var(--c-brand-lt); color: var(--c-brand); }
.faq-item.is-open .icon { transform: rotate(45deg); background: var(--c-brand); color: white; }
.faq-answer { display: none; padding: 0 1.25rem 1.25rem; font-size: .95rem; color: var(--c-body); line-height: 1.7; }
.faq-item.is-open .faq-answer { display: block; }

/* ---- Related Tools ---- */
.related-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.related-card { display: flex; align-items: center; gap: .75rem; padding: .9rem 1.1rem; background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius); transition: all var(--transition); text-decoration: none; color: var(--c-body); font-weight: 600; font-size: .9rem; }
.related-card:hover { border-color: #93c5fd; background: var(--c-brand-lt); color: var(--c-brand); text-decoration: none; transform: translateX(4px); }
.related-card .rc-icon { font-size: 1.4rem; flex-shrink: 0; }

/* ---- Article (Blog Post) ---- */
.article-header { margin-bottom: 2.5rem; }
.article-content { font-size: 1.05rem; line-height: 1.8; }
.article-content h2 { margin-top: 2.5rem; }
.article-content h3 { margin-top: 2rem; }
.article-content ul, .article-content ol { margin-bottom: 1.5rem; }
.article-content li { margin-bottom: .5rem; }
.article-content blockquote { border-left: 4px solid var(--c-brand); padding: 1rem 1.5rem; background: var(--c-brand-lt); border-radius: 0 var(--radius) var(--radius) 0; margin: 2rem 0; }
.article-content blockquote p { margin: 0; font-style: italic; color: var(--c-slate); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .85rem; color: var(--c-muted); margin-bottom: 1.25rem; list-style: none; padding: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: .4rem; }

/* ---- Page Header ---- */
.page-hero { background: linear-gradient(135deg, var(--c-dark) 0%, var(--c-slate) 100%); color: white; padding: 3.5rem 0 2.5rem; }
.page-hero .breadcrumb { color: rgba(255,255,255,.65); }
.page-hero .breadcrumb a { color: rgba(255,255,255,.75); }
.page-hero h1 { color: white; }
.page-hero p { color: rgba(255,255,255,.8); max-width: 650px; margin: .75rem 0 0; }

/* ---- Stats Bar ---- */
.stats-bar { display: flex; flex-wrap: wrap; gap: 1rem; }
.stat-item { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius); padding: .75rem 1.25rem; text-align: center; }
.stat-item .stat-number { display: block; font-size: 1.6rem; font-weight: 900; color: white; line-height: 1; }
.stat-item .stat-label { font-size: .78rem; color: rgba(255,255,255,.7); margin-top: .25rem; display: block; }

/* ---- Footer ---- */
.site-footer { background: var(--c-dark); color: #94a3b8; }
.footer-top { padding: 4rem 0 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 2.5rem; }
.footer-brand h2 { color: white; font-size: 1.3rem; margin: 0 0 .75rem; }
.footer-brand h2 span { color: var(--c-brand); }
.footer-brand p { font-size: .9rem; line-height: 1.65; margin-bottom: 1.25rem; }
.footer-col h4 { color: #e2e8f0; font-size: .95rem; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 1.1rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: .6rem; }
.footer-col ul li a { color: #94a3b8; font-size: .9rem; transition: color var(--transition); }
.footer-col ul li a:hover { color: #7dd3fc; text-decoration: none; }
.footer-sep { height: 1px; background: #1e293b; }
.footer-bottom { padding: 1.5rem 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; font-size: .82rem; }
.footer-bottom-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-bottom-links a { color: #64748b; }
.footer-bottom-links a:hover { color: white; }

/* ---- Breadcrumbs (light) ---- */
.breadcrumb-light { color: var(--c-muted); }
.breadcrumb-light a { color: var(--c-brand); }

/* ---- Animations ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.animate { animation: fadeUp .5s ease both; }
.animate-d1 { animation-delay: .1s; }
.animate-d2 { animation-delay: .2s; }
.animate-d3 { animation-delay: .3s; }

/* ---- Utilities ---- */
.text-center { text-align: center; }
.text-muted  { color: var(--c-muted); }
.mt-0 { margin-top: 0!important; }
.mb-0 { margin-bottom: 0!important; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-6 { margin-top: 3rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
.gap-2 { gap: 1rem; }
.d-none { display: none; }
.divider { height: 1px; background: var(--c-border); margin: 2rem 0; }
.label-tag { display: inline-block; background: var(--c-brand-lt); color: var(--c-brand); font-size: .78rem; font-weight: 700; padding: .25rem .65rem; border-radius: 4px; letter-spacing: .04em; text-transform: uppercase; }
.success-msg { padding: 1rem 1.25rem; background: #f0fdf4; border: 1px solid #86efac; border-radius: var(--radius); color: var(--c-success); font-weight: 600; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-menu { display: none; flex-direction: column; position: absolute; top: 4.25rem; left: 0; right: 0; background: var(--c-white); border-bottom: 1px solid var(--c-border); padding: 1rem; box-shadow: var(--shadow); z-index: 99; }
  .nav-menu.is-open { display: flex; }
  .nav-toggle { display: flex; }
  .nav-dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; border-left: 3px solid var(--c-brand-lt); border-radius: 0; padding: .5rem 0 .5rem 1rem; margin-top: .25rem; }
  .hero { padding: 3rem 0 2.5rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .calc-wrapper__body { padding: 1.25rem; }
  .calc-wrapper__header { padding: 1.5rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-bottom-links { justify-content: center; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .btn-group { flex-direction: column; }
  .tools-grid { grid-template-columns: 1fr; }
  .related-tools { grid-template-columns: 1fr; }
}
