/**
 * Zinsrechner Portal - CSS
 */
:root {
    --primary: #1e3a5f;
    --primary-light: #2d5a8a;
    --primary-dark: #0f1f33;
    --accent: #00a67d;
    --accent-light: #00c896;
    --accent-dark: #008563;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 16px; line-height: 1.6; color: var(--gray-800); background: var(--gray-50); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
ul { list-style: none; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; color: var(--primary); }
h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 1.875rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 768px) { .container { padding: 0 2rem; } }
main { padding: 2rem 0 4rem; }

/* Header */
.header { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; padding: 1rem 0; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-lg); }
.header-content { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.25rem; color: white; }
.logo:hover { color: white; opacity: 0.9; }
.logo img { height: 40px; width: auto; }
.header-nav { display: none; }
@media (min-width: 768px) { .header-nav { display: flex; gap: 0.25rem; } }
.header-nav a { color: rgba(255,255,255,0.85); padding: 0.5rem 1rem; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; transition: all 0.2s; }
.header-nav a:hover, .header-nav a.active { background: rgba(255,255,255,0.15); color: white; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; font-size: 0.9rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--gray-500); display: inline-flex; align-items: center; gap: 0.25rem; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--gray-400); }
.breadcrumb-current { color: var(--gray-700); font-weight: 500; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 600; border-radius: var(--radius); border: none; cursor: pointer; transition: all 0.2s; font-family: inherit; }
.btn-primary { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%); color: white; box-shadow: 0 4px 14px 0 rgba(0, 166, 125, 0.4); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px 0 rgba(0, 166, 125, 0.5); color: white; }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); color: var(--gray-800); }
.btn-outline { background: transparent; border: 2px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 0.875rem 2rem; font-size: 1.1rem; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; padding: 3rem 0 4rem; text-align: center; }
.hero h1 { color: white; margin-bottom: 1rem; }
.hero p { font-size: 1.1rem; opacity: 0.9; max-width: 700px; margin: 0 auto 2rem; }

/* Calculator Grid */
.calc-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 3rem; }
.calc-card { background: white; border-radius: var(--radius-xl); padding: 2rem; text-align: center; box-shadow: var(--shadow-md); transition: all 0.3s; display: flex; flex-direction: column; }
.calc-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); }
.calc-card-icon { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%); border-radius: var(--radius-lg); margin: 0 auto 1.25rem; color: white; }
.calc-card h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.calc-card p { font-size: 0.95rem; color: var(--gray-500); margin-bottom: 1.5rem; flex-grow: 1; }

/* Calculator Wrapper */
.calculator-wrapper { background: white; border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); overflow: hidden; margin-bottom: 2rem; }
.calculator-header { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; padding: 2rem; }
.calculator-header h1, .calculator-header h2 { display: flex; align-items: center; gap: 0.75rem; color: white; margin-bottom: 0.5rem; }
.calculator-header p { opacity: 0.9; margin: 0; font-size: 1.05rem; }
.calculator-body { padding: 2rem; }

/* Forms */
.form-section { background: var(--gray-50); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; }
.form-section-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 1rem; color: var(--primary); margin-bottom: 1.25rem; }
.form-section-title svg { color: var(--accent); }
.form-row { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row-2 { grid-template-columns: repeat(2, 1fr); } .form-row-3 { grid-template-columns: repeat(3, 1fr); } .form-row-4 { grid-template-columns: repeat(4, 1fr); } }
.form-group { display: flex; flex-direction: column; }
.form-label { font-weight: 600; font-size: 0.875rem; color: var(--gray-700); margin-bottom: 0.5rem; }
.form-hint { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.375rem; }
.form-control { width: 100%; padding: 0.875rem 1rem; font-size: 1rem; font-family: inherit; color: var(--gray-800); background: white; border: 2px solid var(--gray-200); border-radius: var(--radius); transition: all 0.2s; outline: none; }
.form-control:hover { border-color: var(--gray-300); }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 166, 125, 0.15); }
.form-control:disabled { background: var(--gray-100); color: var(--gray-400); cursor: not-allowed; }
.input-with-unit { display: flex; }
.input-with-unit .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none; }
.input-unit { display: flex; align-items: center; padding: 0 1rem; background: var(--gray-100); border: 2px solid var(--gray-200); border-left: none; border-radius: 0 var(--radius) var(--radius) 0; color: var(--gray-500); font-weight: 500; }
.input-with-unit:focus-within .input-unit { border-color: var(--accent); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2.5rem; cursor: pointer; }

/* Option Cards */
.option-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .option-grid-3 { grid-template-columns: repeat(3, 1fr); } .option-grid-4 { grid-template-columns: repeat(4, 1fr); } }
.option-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.25rem 1rem; background: white; border: 2px solid var(--gray-200); border-radius: var(--radius-lg); cursor: pointer; transition: all 0.2s; }
.option-card:hover { border-color: var(--accent); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card.active, .option-card:has(input:checked) { border-color: var(--accent); background: linear-gradient(135deg, rgba(0, 166, 125, 0.05) 0%, rgba(0, 166, 125, 0.1) 100%); box-shadow: 0 0 0 3px rgba(0, 166, 125, 0.15); }
.option-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--gray-100); border-radius: var(--radius); margin-bottom: 0.75rem; color: var(--gray-500); transition: all 0.2s; }
.option-card.active .option-icon, .option-card:has(input:checked) .option-icon { background: var(--accent); color: white; }
.option-title { font-weight: 600; font-size: 0.9rem; color: var(--gray-800); margin-bottom: 0.25rem; }
.option-desc { font-size: 0.75rem; color: var(--gray-500); }

/* Collapsible */
.collapsible-section { background: white; border: 2px solid var(--gray-200); border-radius: var(--radius-lg); margin-bottom: 1.5rem; overflow: hidden; }
.collapsible-toggle { width: 100%; display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.5rem; background: transparent; border: none; cursor: pointer; font-size: 0.95rem; font-weight: 600; color: var(--gray-600); font-family: inherit; }
.collapsible-toggle:hover { color: var(--primary); }
.collapsible-toggle svg:last-child { margin-left: auto; transition: transform 0.3s; }
.collapsible-toggle.open svg:last-child { transform: rotate(180deg); }
.collapsible-content { padding: 0 1.5rem 1.5rem; display: none; }
.collapsible-content.open { display: block; }
.form-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 2px solid var(--gray-100); }

/* Results */
.result-wrapper { background: white; border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); margin-bottom: 2rem; overflow: hidden; animation: slideUp 0.4s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.result-header { display: flex; align-items: center; gap: 1rem; padding: 1.5rem 2rem; background: var(--gray-50); border-bottom: 1px solid var(--gray-100); }
.result-header-icon { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--success) 0%, #059669 100%); border-radius: var(--radius-lg); color: white; flex-shrink: 0; }
.result-title { margin: 0; font-size: 1.25rem; }
.result-subtitle { color: var(--gray-500); margin: 0; font-size: 0.9rem; }
.result-highlight { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; padding: 2rem; text-align: center; margin: 1.5rem 2rem; border-radius: var(--radius-lg); }
.result-highlight-label { display: block; font-size: 0.9rem; opacity: 0.9; margin-bottom: 0.5rem; }
.result-highlight-value { display: block; font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 700; }
.result-highlight-sub { display: block; margin-top: 0.5rem; font-size: 0.95rem; opacity: 0.85; }
.result-cards { display: grid; gap: 1rem; padding: 0 2rem 1.5rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .result-cards-3 { grid-template-columns: repeat(3, 1fr); } .result-cards-4 { grid-template-columns: repeat(4, 1fr); } }
.result-card { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: var(--gray-50); border-radius: var(--radius-lg); }
.result-card-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: white; border-radius: var(--radius); color: var(--accent); flex-shrink: 0; box-shadow: var(--shadow-sm); }
.result-label { display: block; font-size: 0.75rem; color: var(--gray-500); margin-bottom: 0.125rem; }
.result-value { display: block; font-size: 1.125rem; font-weight: 700; color: var(--gray-800); }
.result-value.accent { color: var(--accent); }
.result-section { padding: 1.5rem 2rem; border-top: 1px solid var(--gray-100); }
.result-section-title { display: flex; align-items: center; gap: 0.5rem; font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.result-section-title svg { color: var(--accent); }
.result-actions { display: flex; flex-wrap: wrap; gap: 1rem; padding: 1.5rem 2rem; background: var(--gray-50); }

/* Tables */
.table-scroll { overflow-x: auto; margin: 0 -0.5rem; padding: 0 0.5rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th { background: var(--primary); color: white; padding: 0.875rem 1rem; font-weight: 600; text-align: left; white-space: nowrap; }
.data-table th:first-child { border-radius: var(--radius) 0 0 0; }
.data-table th:last-child { border-radius: 0 var(--radius) 0 0; }
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--gray-100); }
.data-table tbody tr:hover { background: var(--gray-50); }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Charts */
.chart-box { background: var(--gray-50); padding: 1.5rem; border-radius: var(--radius-lg); }
.bar-chart .bar-row { display: grid; grid-template-columns: 70px 1fr 90px; gap: 0.75rem; align-items: center; margin-bottom: 0.5rem; }
.bar-chart .bar-label { font-size: 0.8rem; color: var(--gray-600); font-weight: 500; }
.bar-chart .bar-track { height: 22px; background: var(--gray-200); border-radius: var(--radius-sm); overflow: hidden; display: flex; }
.bar-chart .bar-fill { height: 100%; display: flex; }
.bar-chart .bar-kapital { background: var(--primary); }
.bar-chart .bar-zinsen { background: var(--accent); }
.bar-chart .bar-value { font-size: 0.8rem; font-weight: 600; text-align: right; color: var(--gray-700); }
.chart-legend { display: flex; justify-content: center; gap: 2rem; margin-top: 1rem; font-size: 0.85rem; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; }
.legend-dot.kapital { background: var(--primary); }
.legend-dot.zinsen { background: var(--accent); }

/* Content Boxes */
.content-box { background: white; border-radius: var(--radius-xl); padding: 2rem; margin-bottom: 2rem; box-shadow: var(--shadow); }
.content-box h2, .content-box h3 { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.content-box h2 svg, .content-box h3 svg { color: var(--accent); }

/* Info/Tip/Warning Boxes */
.info-box { display: flex; gap: 1rem; padding: 1.25rem; background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.15) 100%); border-left: 4px solid var(--info); border-radius: var(--radius); margin: 1.5rem 0; }
.info-box svg { flex-shrink: 0; color: var(--info); margin-top: 2px; }
.info-box-content { flex: 1; }
.info-box-title { font-weight: 600; margin-bottom: 0.5rem; color: var(--gray-800); }
.tip-box { display: flex; gap: 1rem; padding: 1.25rem; background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.15) 100%); border-left: 4px solid var(--success); border-radius: var(--radius); margin: 1.5rem 0; }
.tip-box svg { flex-shrink: 0; color: var(--success); margin-top: 2px; }
.warning-box { display: flex; gap: 1rem; padding: 1.25rem; background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.15) 100%); border-left: 4px solid var(--warning); border-radius: var(--radius); margin: 1.5rem 0; }
.warning-box svg { flex-shrink: 0; color: var(--warning); margin-top: 2px; }

/* Example/Formula Boxes */
.example-box { background: var(--gray-50); border: 2px dashed var(--gray-300); border-radius: var(--radius-lg); padding: 1.5rem; margin: 1.5rem 0; }
.example-box-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--primary); margin-bottom: 1rem; }
.example-box-title svg { color: var(--accent); }
.formula-box { background: var(--primary-dark); color: white; padding: 1.5rem; border-radius: var(--radius-lg); margin: 1.5rem 0; text-align: center; }
.formula-box-title { font-size: 0.9rem; opacity: 0.8; margin-bottom: 0.75rem; }
.formula-box code { display: block; font-size: 1.25rem; font-family: 'Courier New', monospace; padding: 1rem; background: rgba(255,255,255,0.1); border-radius: var(--radius); }

/* Content Grid */
.content-grid { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .content-grid-2 { grid-template-columns: repeat(2, 1fr); } .content-grid-3 { grid-template-columns: repeat(3, 1fr); } }
.content-card { background: var(--gray-50); padding: 1.5rem; border-radius: var(--radius-lg); }
.content-card h4 { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; font-size: 1rem; }
.content-card h4 svg { color: var(--accent); }
.content-card ul { margin-left: 1.25rem; list-style: disc; }
.content-card li { margin-bottom: 0.25rem; }

/* Features Grid */
.features-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.feature-card { background: var(--gray-50); padding: 1.5rem; border-radius: var(--radius-lg); text-align: center; }
.feature-icon { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: white; border-radius: var(--radius-lg); margin: 0 auto 1rem; color: var(--accent); box-shadow: var(--shadow); }
.feature-card h5 { font-size: 1rem; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.875rem; color: var(--gray-500); margin: 0; }

/* Related Grid */
.related-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.related-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.5rem; background: var(--gray-50); border-radius: var(--radius-lg); color: var(--gray-700); transition: all 0.3s; }
.related-card:hover { background: var(--primary); color: white; transform: translateY(-4px); }
.related-card svg { color: var(--accent); margin-bottom: 0.75rem; }
.related-card:hover svg { color: white; }
.related-card strong { font-size: 0.95rem; margin-bottom: 0.25rem; }
.related-card span { font-size: 0.8rem; opacity: 0.7; }

/* FAQ */
.faq-section { background: white; border-radius: var(--radius-xl); padding: 2rem; margin-bottom: 2rem; box-shadow: var(--shadow); }
.faq-item { border-bottom: 1px solid var(--gray-200); }
.faq-item:last-child { border-bottom: none; }
.faq-question { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 0; background: none; border: none; cursor: pointer; font-size: 1rem; font-weight: 600; color: var(--gray-800); text-align: left; font-family: inherit; }
.faq-question:hover { color: var(--accent); }
.faq-question svg { flex-shrink: 0; color: var(--gray-400); transition: transform 0.3s; }
.faq-item.open .faq-question svg { transform: rotate(180deg); color: var(--accent); }
.faq-answer { display: none; padding-bottom: 1.25rem; color: var(--gray-600); line-height: 1.7; }
.faq-item.open .faq-answer { display: block; }

/* Footer */
.footer { background: var(--primary-dark); color: rgba(255,255,255,0.8); padding: 3rem 0 2rem; margin-top: 4rem; }
.footer-content { display: grid; gap: 2rem; }
@media (min-width: 768px) { .footer-content { grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand { font-size: 1.25rem; font-weight: 700; color: white; margin-bottom: 0.75rem; }
.footer-desc { font-size: 0.9rem; max-width: 300px; }
.footer-title { color: white; font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer-links a:hover { color: white; }
.footer-bottom { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; text-align: center; }

/* Utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.hidden { display: none !important; }

/* Print */
@media print { .header, .footer, .btn, .form-actions, .result-actions, .collapsible-section, .faq-section, .related-grid { display: none !important; } body { background: white; } .calculator-wrapper, .result-wrapper, .content-box { box-shadow: none; border: 1px solid var(--gray-300); } }
