/* ============================================================
   style.css – wievielkredit.de
   Design: Modern & frisch (Grün/Weiß), Mobile-first
   ============================================================ */

:root {
    --gruen:       #1a9e5f;
    --gruen-dark:  #147a49;
    --gruen-light: #e8f7f1;
    --gruen-mid:   #d0f0e3;
    --text:        #1a1a2e;
    --text-light:  #5a6070;
    --bg:          #ffffff;
    --bg-grey:     #f7f9fc;
    --border:      #e2e8f0;
    --radius:      10px;
    --shadow:      0 2px 16px rgba(0,0,0,.07);
    --shadow-lg:   0 8px 32px rgba(0,0,0,.10);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-size: 16px;
}

a { color: var(--gruen); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ---- HEADER ---- */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}
.logo-icon { font-size: 1.5rem; }
.logo-dot  { color: var(--gruen); }

.main-nav {
    display: flex;
    gap: .25rem;
}
.main-nav a {
    padding: .4rem .75rem;
    border-radius: var(--radius);
    color: var(--text-light);
    font-size: .9rem;
    font-weight: 500;
    transition: background .15s, color .15s;
    text-decoration: none;
}
.main-nav a:hover, .main-nav a.active {
    background: var(--gruen-light);
    color: var(--gruen-dark);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .4rem;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

@media (max-width: 640px) {
    .nav-toggle { display: flex; }
    .main-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem;
        gap: .25rem;
    }
    .main-nav.open { display: flex; }
    .main-nav a { display: block; }
}

/* ---- HERO ---- */
.hero {
    background: linear-gradient(135deg, var(--gruen) 0%, var(--gruen-dark) 100%);
    color: #fff;
    padding: 3rem 0 2.5rem;
    text-align: center;
}
.hero h1 {
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    font-weight: 800;
    margin-bottom: .75rem;
    line-height: 1.2;
}
.hero-sub {
    font-size: 1.05rem;
    opacity: .9;
    max-width: 580px;
    margin: 0 auto;
}

/* ---- RECHNER ---- */
.rechner-section {
    padding: 2.5rem 0;
    background: var(--bg-grey);
}

.rechner-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}
.rechner-card h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--gruen-dark);
    border-bottom: 2px solid var(--gruen-light);
    padding-bottom: .5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: .4rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.input-wrap {
    display: flex;
    align-items: center;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .2s;
}
.input-wrap:focus-within {
    border-color: var(--gruen);
    box-shadow: 0 0 0 3px rgba(26,158,95,.12);
}

.input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    padding: .65rem .75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    background: transparent;
    min-width: 0;
}
.input-wrap input::-webkit-inner-spin-button { opacity: .4; }

.unit {
    padding: 0 .75rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-light);
    background: var(--bg-grey);
    border-left: 1px solid var(--border);
    white-space: nowrap;
    height: 100%;
    display: flex;
    align-items: center;
}

/* ---- ERGEBNIS ---- */
.ergebnis-box {
    background: var(--gruen-light);
    border: 2px solid var(--gruen-mid);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all .3s;
}

.ergebnis-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--gruen-mid);
}
.ergebnis-label {
    font-size: .85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gruen-dark);
    margin-bottom: .25rem;
}
.ergebnis-value {
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 800;
    color: var(--gruen-dark);
    line-height: 1.1;
}

.ergebnis-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: .75rem;
}
.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.detail-item span {
    font-size: .8rem;
    color: var(--text-light);
    margin-bottom: .2rem;
}
.detail-item strong {
    font-size: 1rem;
    color: var(--text);
}

/* ---- CTA ---- */
/* TODO: Entfernen wenn Affiliate-Link steht */
.cta-box { display: none; }
.cta-box--active { display: block; }

.cta-box {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}
.cta-box p {
    font-size: .95rem;
    margin-bottom: .75rem;
    color: var(--text);
}
.btn-cta {
    display: inline-block;
    background: var(--gruen);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding: .8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    transition: background .2s, transform .15s;
    box-shadow: 0 2px 8px rgba(26,158,95,.3);
}
.btn-cta:hover {
    background: var(--gruen-dark);
    transform: translateY(-1px);
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(26,158,95,.35);
}

/* ---- WEITERE RECHNER ---- */
.weitere-rechner {
    padding: 3rem 0;
    background: #fff;
}
.weitere-rechner h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
.rechner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.rechner-teaser {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: border-color .2s, transform .15s, box-shadow .2s;
    gap: .5rem;
}
.rechner-teaser:hover {
    border-color: var(--gruen);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
}
.teaser-icon { font-size: 2rem; }
.rechner-teaser strong { font-size: 1.05rem; }
.rechner-teaser span   { font-size: .875rem; color: var(--text-light); }

/* ---- FAQ ---- */
.faq-section {
    padding: 3rem 0;
    background: var(--bg-grey);
}
.faq-section h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}
.faq-list { display: flex; flex-direction: column; gap: .5rem; }
.faq-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.faq-item summary {
    padding: 1rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    font-size: 1.3rem;
    color: var(--gruen);
    flex-shrink: 0;
    margin-left: 1rem;
    transition: transform .2s;
}
.faq-item[open] summary::after {
    transform: rotate(45deg);
}
.faq-item p {
    padding: 0 1.25rem 1rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* ---- INFO SECTION ---- */
.info-section {
    padding: 3rem 0;
    background: #fff;
}
.info-section h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--gruen-dark);
}
.info-section p {
    color: var(--text-light);
    margin-bottom: .75rem;
    line-height: 1.7;
}

/* ---- CONTENT PAGES (Impressum, Datenschutz) ---- */
.content-section {
    padding: 3rem 0;
}
.content-narrow {
    max-width: 720px;
}
.content-narrow h1 {
    font-size: 1.8rem;
    margin-bottom: .5rem;
}
.content-narrow h2 {
    font-size: 1.2rem;
    margin-top: 2rem;
    margin-bottom: .5rem;
    color: var(--gruen-dark);
    border-bottom: 1px solid var(--gruen-light);
    padding-bottom: .25rem;
}
.content-narrow h3 {
    font-size: 1rem;
    margin-top: 1rem;
    margin-bottom: .25rem;
}
.content-narrow p, .content-narrow ul {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: .75rem;
}
.content-narrow ul {
    padding-left: 1.5rem;
}

/* ---- FOOTER ---- */
.site-footer {
    background: var(--text);
    color: #ccc;
    margin-top: 4rem;
}
.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    padding: 3rem 0 2rem;
}
.footer-logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    display: block;
    margin-bottom: .5rem;
}
.footer-tagline {
    font-size: .875rem;
    line-height: 1.5;
    color: #aaa;
}
.footer-col strong {
    display: block;
    color: #fff;
    margin-bottom: .5rem;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.footer-col nav {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.footer-col nav a {
    color: #aaa;
    font-size: .875rem;
    text-decoration: none;
    transition: color .15s;
}
.footer-col nav a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 1.25rem 0;
}
.footer-disclaimer {
    font-size: .8rem;
    color: #888;
    line-height: 1.5;
    margin-bottom: .5rem;
}
.footer-copy {
    font-size: .8rem;
    color: #666;
}
.footer-copy a { color: #888; text-decoration: none; }
.footer-copy a:hover { color: #ccc; }

/* ---- TILGUNGSPLAN TABELLE ---- */
.tilgungsplan-tabelle {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.tilgungsplan-tabelle th {
    background: var(--gruen-light);
    color: var(--gruen-dark);
    font-weight: 600;
    text-align: right;
    padding: .6rem .75rem;
    border-bottom: 2px solid var(--gruen-mid);
    white-space: nowrap;
}
.tilgungsplan-tabelle th:first-child { text-align: center; }
.tilgungsplan-tabelle td {
    padding: .5rem .75rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
}
.tilgungsplan-tabelle td:first-child { text-align: center; font-weight: 600; }
.tilgungsplan-tabelle tr:last-child td { border-bottom: none; }
.tilgungsplan-tabelle tr:hover td { background: var(--bg-grey); }

/* ---- NAV OVERFLOW (viele Rechner) ---- */
@media (min-width: 641px) and (max-width: 900px) {
    .main-nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .main-nav a {
        font-size: .8rem;
        padding: .3rem .5rem;
    }
}

/* ---- MONTE-CARLO CANVAS ---- */
.mc-canvas-container {
    background: #0d1117;
    border-radius: var(--radius);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}
.mc-canvas-container canvas {
    width: 100%;
    height: auto;
    display: block;
}
.mc-canvas-legend {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    margin-top: .75rem;
}
.mc-legend-item {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    color: #8b949e;
}
.mc-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* ---- MONTE-CARLO BAR CHART ---- */
.mc-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 160px;
    padding-top: 20px;
}
.mc-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.mc-bar {
    width: 100%;
    min-width: 12px;
    border-radius: 3px 3px 0 0;
    transition: height .3s;
}
.mc-bar-label {
    font-size: .65rem;
    color: var(--text-light);
    font-weight: 600;
}
.mc-bar-value {
    font-size: .6rem;
    color: var(--text-light);
}

/* ---- BLOG ---- */
.blog-teaser {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}
.blog-teaser:last-child { border-bottom: none; }
.blog-teaser h2 {
    font-size: 1.2rem;
    margin-bottom: .25rem;
    color: var(--gruen-dark);
}
.blog-teaser h2:hover { text-decoration: underline; }
.blog-meta {
    font-size: .8rem;
    color: var(--text-light);
    margin-bottom: .5rem;
}
.blog-read-more {
    font-weight: 600;
    font-size: .9rem;
}

/* ---- SELECT STYLING ---- */
.input-wrap select {
    flex: 1;
    border: none;
    outline: none;
    padding: .65rem .75rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
    background: transparent;
    cursor: pointer;
}
