/* FinanzCalc - High-Performance Financial Tools & Monetization Stylesheet */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --primary: #0f766e;
  --primary-hover: #0d5f59;
  --primary-soft: #ccfbf1;
  --accent: #0284c7;
  --accent-soft: #e0f2fe;
  --gold: #d97706;
  --gold-soft: #fef3c7;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --max-w: 1140px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none !important;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.93rem;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  text-decoration: none;
}

.currency-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.currency-picker select {
  border: none;
  background: transparent;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  outline: none;
  font-size: 0.85rem;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 100%);
  color: #fff;
  padding: 56px 0 48px;
}

.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.15;
  margin-bottom: 14px;
  font-weight: 800;
}

.hero p {
  font-size: 1.1rem;
  color: #cbd5e1;
  max-width: 680px;
}

.hero-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

/* Breadcrumbs */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 20px 0 10px;
}

.breadcrumb a {
  color: var(--text-muted);
}

/* Cards Grid (Homepage) */
.section {
  padding: 40px 0;
}

.section-title {
  font-size: 1.6rem;
  margin-bottom: 8px;
  font-weight: 800;
}

.section-subtitle {
  color: var(--text-muted);
  margin-bottom: 26px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, border-color 0.15s ease;
  text-decoration: none !important;
  color: var(--text);
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}

.tool-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.tool-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.tool-card p {
  font-size: 0.94rem;
  color: var(--text-muted);
  flex: 1;
}

.tool-cta {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.92rem;
}

/* Calculator Layout */
.calc-header {
  padding: 18px 0 24px;
}

.calc-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 800;
  margin-bottom: 8px;
}

.calc-header p {
  color: var(--text-muted);
  max-width: 760px;
}

.calc-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel h2 {
  font-size: 1.15rem;
  margin-bottom: 16px;
  font-weight: 700;
}

/* Form Elements */
.field {
  margin-bottom: 16px;
}

.field label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.field small {
  color: var(--text-muted);
  font-size: 0.8rem;
  display: block;
  margin-top: 4px;
}

.input-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s;
}

.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.input-prefix,
.input-suffix {
  padding: 10px 12px;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  user-select: none;
}

.input-group input,
.input-group select,
.field > input,
.field > select {
  width: 100%;
  border: none;
  padding: 10px 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  outline: none;
}

.field > input[type="range"] {
  padding: 6px 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.93rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  text-decoration: none;
}

/* KPI Result Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.kpi.highlight {
  background: linear-gradient(135deg, #0f766e, #0284c7);
  color: #fff;
  border: none;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.85;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 800;
  line-height: 1.15;
}

.kpi-sub {
  font-size: 0.8rem;
  opacity: 0.85;
  margin-top: 4px;
}

/* Charts */
.chart-box {
  margin: 18px 0 22px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.chart-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-legend {
  display: flex;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 360px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  padding: 10px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

th:first-child, td:first-child {
  text-align: left;
}

th {
  background: var(--surface-alt);
  position: sticky;
  top: 0;
  font-weight: 700;
  color: var(--text);
}

tr:last-child td {
  border-bottom: none;
}

/* Monetization: Affiliate Cards */
.affiliate-section {
  margin-top: 26px;
  padding: 20px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%);
  border: 1px solid #99f6e4;
}

.affiliate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.affiliate-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #134e4a;
}

.disclosure-pill {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: #fff;
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
}

.affiliate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.affiliate-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.affiliate-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--gold-soft);
  color: #92400e;
}

.affiliate-card h4 {
  font-size: 1rem;
  font-weight: 700;
}

.affiliate-card p {
  font-size: 0.86rem;
  color: var(--text-muted);
  flex: 1;
}

/* Monetization: AdSense Slots */
.ad-slot {
  margin: 22px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ad-slot-placeholder {
  width: 100%;
  padding: 18px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.82rem;
}

/* SEO Content & FAQ */
.seo-content {
  margin-top: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.seo-content h2 {
  font-size: 1.4rem;
  margin: 22px 0 10px;
  font-weight: 800;
}

.seo-content h2:first-child {
  margin-top: 0;
}

.seo-content p,
.seo-content li {
  color: var(--text-muted);
  margin-bottom: 10px;
}

.seo-content ul {
  padding-left: 20px;
  margin-bottom: 14px;
}

.faq-item {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}

.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}

.faq-item p {
  margin-top: 8px;
}

/* Footer */
.site-footer {
  margin-top: 56px;
  background: #0f172a;
  color: #cbd5e1;
  padding: 40px 0 28px;
}

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

.footer-col h4 {
  color: #fff;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 7px;
  font-size: 0.88rem;
}

.footer-col a {
  color: #94a3b8;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 18px;
  font-size: 0.82rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

@media print {
  .site-header, .site-footer, .ad-slot, .affiliate-section, .btn-row {
    display: none !important;
  }
  .calc-layout {
    grid-template-columns: 1fr;
  }
  body {
    background: #fff;
  }
}
