/* ==========================================================================
   Tesla Empfehlungscode - Stylesheet
   Light theme (default) with CSS custom properties for easy theme switching.
   To switch to dark mode: change :root to use the values from [data-theme="dark"]
   ========================================================================== */

/* --- Theme Variables --- */

:root {
    /* Light mode (default) */
    --bg-primary: #ffffff;
    --bg-secondary: transparent;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafa;
    --bg-input: #f0f0f2;
    --bg-nav: #ffffff;
    --bg-hero: transparent;
    --bg-footer: transparent;
    --bg-result: #fafafa;
    --bg-result-total: linear-gradient(135deg, #ecfdf5, #fafafa);

    --border-color: #e8e8ec;
    --border-light: #f0f0f2;

    --text-primary: #1f1f1f;
    --text-secondary: #6b6b73;
    --text-muted: #9b9ba3;
    --text-on-accent: #ffffff;

    --accent: #3e6ae1;
    --accent-hover: #2f55c4;
    --accent-light: #eef3fc;
    --success: #059669;
    --success-bg: #ecfdf5;
    --link: #2563eb;
    --link-hover: #1d4ed8;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);

    --radius: 8px;
    --radius-lg: 12px;
}

/* --- Dark mode (preserved for rollback) ---
   To activate: add data-theme="dark" to <html>, or
   swap :root values with these */
[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222;
    --bg-input: #111;
    --bg-nav: #111;
    --bg-hero: linear-gradient(180deg, #111 0%, #0a0a0a 100%);
    --bg-footer: #111;
    --bg-result: #111;
    --bg-result-total: linear-gradient(135deg, #0d1f0d, #1a1a1a);

    --border-color: #2a2a2a;
    --border-light: #1a1a1a;

    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666;
    --text-on-accent: #ffffff;

    --accent: #e31937;
    --accent-hover: #ff2d4b;
    --accent-light: #1f1015;
    --success: #00d46a;
    --success-bg: rgba(0,212,106,0.1);
    --link: #4a9eff;
    --link-hover: #7ab8ff;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

/* --- Reset & Base --- */

body {
    background: #ffffff;
}
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(180deg, #e8eefc 0%, #f0f4fd 40%, rgba(255,255,255,0) 100%);
    z-index: -1;
    pointer-events: none;
}
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.25rem; }
p { margin-bottom: 1rem; }
strong { font-weight: 600; }

/* --- Glassmorphism Nav --- */
.nav {
    background: rgba(255,255,255,0.72);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid rgba(232,232,236,0.6);
}

/* --- Nav Status Badge --- */
.nav-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--success-bg);
    border: 1px solid rgba(5,150,105,0.2);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--success);
    letter-spacing: .3px;
    white-space: nowrap;
}
.nav-badge-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(5,150,105,0.4); }
    50% { opacity: .7; box-shadow: 0 0 0 4px rgba(5,150,105,0); }
}

/* --- Hero Savings Counter --- */
.hero-savings {
    display: inline-flex;
    align-items: baseline;
    gap: .35rem;
    margin-bottom: .5rem;
}
.hero-savings-label {
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-weight: 400;
}
.hero-savings-amount {
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    letter-spacing: -1px;
}
.hero-savings-suffix {
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-weight: 400;
}
@media (max-width: 768px) {
    .hero-savings {
        flex-direction: column;
        align-items: center;
        gap: .1rem;
    }
    .hero-savings-amount { font-size: 3rem; }
    .hero-savings-label, .hero-savings-suffix { font-size: 1rem; }
    .nav-badge { display: none; }
    .nav-brand span { display: none; }
    .nav-links a { font-size: .85rem; }
    .comparison-table th, .comparison-table td { padding: .75rem .5rem; font-size: .85rem; }
    .btn-cta-sm { padding: 8px 12px; font-size: .75rem; }
}

/* --- Sections --- */

section {
    padding: 4rem 0;
}
section:nth-child(even) {
    background: none;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.section-header p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: .5rem auto 0;
    font-size: 1rem;
}

/* --- Benefits Grid --- */

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}
.benefit-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: border-color .2s, box-shadow .2s;
    box-shadow: var(--shadow-sm);
}
.benefit-card.erfahrungsbericht {
    text-align: left;
}
.benefit-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}
.benefit-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    border-radius: 50%;
    color: var(--accent);
}
.benefit-icon svg {
    width: 20px;
    height: 20px;
}
.benefit-card h3 {
    font-size: 1.1rem;
    margin-bottom: .5rem;
}
.benefit-card p {
    color: var(--text-secondary);
    font-size: .95rem;
    margin-bottom: 0;
}
.benefit-value {
    color: var(--success);
    font-size: 1.3rem;
    font-weight: 700;
    display: block;
    margin-bottom: .5rem;
}

/* --- Comparison Table --- */

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 2rem 0;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    background: #ffffff;
}
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
    background: #ffffff;
}
.comparison-table th,
.comparison-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}
.comparison-table th {
    background: #ffffff;
    font-weight: 600;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
}
.comparison-table td {
    background: var(--bg-card);
}
.comparison-table tr:hover td {
    background: var(--bg-card-hover);
}
.comparison-table .savings {
    color: var(--success);
    font-weight: 700;
}

/* --- Calculator --- */

.calculator {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}
.calc-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 0;
}
.calc-tab {
    padding: .75rem 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .2s, border-color .2s;
    font-family: inherit;
}
.calc-tab:hover {
    color: var(--text-primary);
}
.calc-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.model-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.model-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}
.model-card:hover {
    border-color: var(--text-muted);
}
.model-card.active {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 1px var(--accent);
}
.model-card h3 {
    margin-bottom: .25rem;
}
.model-card .model-price {
    color: var(--text-secondary);
    font-size: .9rem;
}
.model-card .model-icon {
    width: 160px;
    height: 160px;
    margin: 0 auto .5rem;
    opacity: .7;
    transition: opacity .2s;
}
.model-card.active .model-icon {
    opacity: 1;
}
.model-card .model-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.calc-inputs {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.input-group {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.input-group label {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: .35rem;
}

/* Tooltip hint icons */
.calc-hint {
    position: relative;
    cursor: help;
    display: inline-flex;
}
.calc-hint-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-muted);
    font-size: .65rem;
    font-weight: 600;
    line-height: 1;
    flex-shrink: 0;
    transition: background .2s, color .2s;
}
.calc-hint:hover .calc-hint-icon,
.calc-hint:focus .calc-hint-icon {
    background: var(--accent);
    color: #fff;
}
.calc-hint-text {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    width: 240px;
    padding: .6rem .75rem;
    background: var(--text-primary);
    color: #fff;
    font-size: .78rem;
    font-weight: 400;
    line-height: 1.45;
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    z-index: 10;
    pointer-events: none;
}
.calc-hint-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-primary);
}
.calc-hint:hover .calc-hint-text,
.calc-hint:focus .calc-hint-text {
    display: block;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.input-row input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
    height: 6px;
}
.input-row .input-value {
    min-width: 100px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: .5rem .75rem;
    color: var(--text-primary);
    font-size: .95rem;
    font-family: inherit;
    text-align: right;
}

.calc-results {
    background: var(--bg-result);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 1.5rem;
}
.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.result-item {
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 6px;
}
.result-item .label {
    font-size: .85rem;
    color: var(--text-secondary);
    margin-bottom: .25rem;
}
.result-item .value {
    font-size: 1.3rem;
    font-weight: 700;
}
.result-item .value.green {
    color: var(--success);
}
.result-total {
    margin-top: 1.5rem;
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-result-total);
    border: 1px solid rgba(5,150,105,0.2);
    border-radius: var(--radius);
}
.result-total .label {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: .5rem;
}
.result-total .value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--success);
}
.result-compare {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.result-old {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: #e53e3e;
    text-decoration-thickness: 2px;
}
.result-new {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--success);
}
.calc-cta {
    margin-top: 2rem;
    text-align: center;
}

/* --- Steps (HowTo) --- */

.steps {
    counter-reset: step;
    list-style: none;
    padding: 0;
    max-width: 700px;
    margin: 2rem auto;
}
.step {
    counter-increment: step;
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-light);
}
.step:last-child {
    border-bottom: none;
}
.step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: var(--text-on-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}
.step-content h3 {
    margin-bottom: .5rem;
}
.step-content p {
    color: var(--text-secondary);
    margin-bottom: 0;
}
.step-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.step-icon svg {
    width: 18px;
    height: 18px;
}
.step-tip {
    background: var(--bg-secondary);
    border-left: 3px solid var(--link);
    padding: 1rem 1.25rem;
    border-radius: 0 6px 6px 0;
    margin-top: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
.step-tip p {
    color: var(--text-secondary);
    margin: 0;
    font-size: .95rem;
}

/* --- FAQ Accordion --- */

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}
.faq-item {
    border-bottom: 1px solid var(--border-color);
}
.faq-question {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 500;
    text-align: left;
    padding: 1.25rem 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-family: inherit;
    line-height: 1.5;
}
.faq-question:hover {
    color: var(--accent);
}
.faq-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    position: relative;
    transition: transform .3s;
}
.faq-icon::before,
.faq-icon::after {
    content: '';
    position: absolute;
    background: var(--text-muted);
    transition: transform .3s;
}
.faq-icon::before {
    width: 16px;
    height: 2px;
    top: 11px;
    left: 4px;
}
.faq-icon::after {
    width: 2px;
    height: 16px;
    top: 4px;
    left: 11px;
}
.faq-item.active .faq-icon::after {
    transform: rotate(90deg);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease-out;
}
.faq-answer-inner {
    padding: 0 0 1.25rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.faq-answer-inner p {
    margin-bottom: .75rem;
}
.faq-answer-inner p:last-child {
    margin-bottom: 0;
}

/* --- Cross-Link Card --- */

.cross-link-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    margin: 2rem 0;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    text-decoration: none;
    transition: border-color .2s, box-shadow .2s, transform .2s;
    box-shadow: var(--shadow-sm);
}
.cross-link-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.cross-link-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.cross-link-icon svg {
    width: 18px;
    height: 18px;
}
.cross-link-text {
    flex: 1;
}
.cross-link-card h3 {
    color: var(--text-primary);
    margin-bottom: .5rem;
}
.cross-link-card p {
    color: var(--text-secondary);
    margin-bottom: .75rem;
}
.cross-link-card .arrow {
    color: var(--accent);
    font-weight: 600;
}

/* --- Supercharger Stats --- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.stat-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto .5rem;
    background: var(--accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.stat-icon svg {
    width: 16px;
    height: 16px;
}
.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: .25rem;
}
.stat-label {
    color: var(--text-secondary);
    font-size: .9rem;
}

/* --- Charging Comparison Table --- */

.charging-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: #ffffff;
    border-radius: var(--radius);
}
.charging-table th,
.charging-table td {
    padding: .75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}
.charging-table th {
    background: #ffffff;
    color: var(--text-muted);
    font-size: .85rem;
    text-transform: uppercase;
    font-weight: 600;
}
.charging-table td {
    background: #ffffff;
}
.charging-table .highlight {
    color: var(--success);
    font-weight: 600;
}

/* --- Legal Pages --- */

.legal-content {
    padding: 3rem 0;
}
.legal-content h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
}
.legal-content h2 {
    font-size: 1.4rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}
.legal-content h3 {
    margin-top: 1.5rem;
}
.legal-content p,
.legal-content li {
    color: var(--text-secondary);
    line-height: 1.8;
}
.legal-content a {
    color: var(--link);
}
.legal-content ul {
    margin-bottom: 1rem;
}

/* --- Footer --- */

.site-footer {
    background: var(--bg-footer);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: 4rem;
}
.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.footer-links a {
    color: var(--text-secondary);
    font-size: .9rem;
    text-decoration: none;
    transition: color .2s;
}
.footer-links a:hover {
    color: var(--text-primary);
}
.footer-disclaimer {
    max-width: 700px;
    margin: 0 auto 1rem;
    text-align: center;
}
.footer-disclaimer p {
    color: var(--text-muted);
    font-size: .8rem;
    line-height: 1.6;
    margin: 0;
}
.footer-meta {
    text-align: center;
}
.footer-meta p {
    color: var(--text-muted);
    font-size: .8rem;
    margin: 0;
}

/* --- Utility --- */

.text-green { color: var(--success); }
.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.btn-cta-sm { padding: 10px 20px; font-size: .85rem; }
.text-sm { font-size: .85rem; }
.calc-highlight { margin: 2rem 0; text-align: center; }
.benefit-value-lg { font-size: 2rem; margin-top: 1rem; }
.matomo-optout { border: 1px solid var(--border-color); border-radius: 4px; width: 100%; max-width: 600px; height: 200px; background: var(--bg-secondary); }

/* --- Responsive --- */

@media (max-width: 768px) {
    section { padding: 2.5rem 0; }
    .benefits-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; gap: 1rem; }
    .model-selector { grid-template-columns: 1fr; }
    .model-card { display: flex; align-items: center; gap: 1rem; text-align: left; padding: 1rem; }
    .model-card .model-icon { width: 60px; height: 40px; margin: 0; flex-shrink: 0; }
    .result-grid { grid-template-columns: 1fr; }
    .calculator { padding: 1.5rem; }
    .result-total .value { font-size: 2rem; }
    .result-old { font-size: 1.1rem; }
    .result-new { font-size: 2rem; }
    .nav { padding: .5rem 1rem; }
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: .8rem; }
    .footer-links { flex-direction: column; align-items: center; gap: .75rem; }
}

@media (max-width: 480px) {
    .hero { padding: 2.5rem 1rem 2rem; }
    .calc-tabs { flex-direction: column; }
    .calc-tab { text-align: center; }
    .input-row { flex-direction: column; align-items: stretch; }
    .input-row .input-value { min-width: unset; text-align: left; }
    .calc-hint-text { width: 200px; left: 0; transform: none; }
    .calc-hint-text::after { left: 8px; transform: none; }
    .cross-link-card { flex-direction: column; align-items: center; text-align: center; }
}

/* --- Tab Panels --- */
.calc-panel { display: none; }
.calc-panel.active { display: block; }
