:root {
  --primary: #1E88E5;
  --primary-dark: #1565C0;
  --primary-darker: #0D47A1;
  --bg: #FAFBFC;
  --surface: #FFFFFF;
  --text: #1A1D1F;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --success: #16A34A;
  --warn: #F59E0B;
  --error: #DC2626;
  --salary: #1E88E5;
  --tax: #F59E0B;
  --finance: #16A34A;
  --vehicle: #8B5CF6;
  --lifestyle: #EC4899;
}

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

html { scroll-behavior: smooth; }

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

a { color: var(--primary); }

/* Header */
.site-header {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
}

.site-header .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.site-header .logo img {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: 7px;
  box-shadow: 0 1px 3px rgba(30, 136, 229, 0.25);
}

.site-header .logo span {
  display: inline-block;
}

@media (max-width: 480px) {
  .site-header .logo span { display: none; }
}

.site-header nav a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 20px;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-header nav a:hover { color: var(--primary); }

@media (max-width: 600px) {
  .site-header nav a { margin-left: 12px; font-size: 0.85rem; }
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  text-align: center;
  padding: 70px 20px 60px;
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero .tagline {
  font-size: 1.15rem;
  opacity: 0.92;
  margin-bottom: 28px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

.hero .badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-bottom: 24px;
  font-weight: 500;
}

.cta-btn {
  display: inline-block;
  background: white;
  color: var(--primary);
  padding: 12px 28px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.cta-btn.secondary {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.6);
  margin-left: 8px;
}

@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  .hero .tagline { font-size: 1rem; }
  .cta-btn { display: block; margin: 8px auto; max-width: 280px; }
  .cta-btn.secondary { margin-left: auto; }
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.container.narrow { max-width: 760px; }

/* Section */
section { padding: 60px 0; }

section h2 {
  text-align: center;
  font-size: 1.8rem;
  color: var(--primary-dark);
  margin-bottom: 12px;
}

section .section-sub {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 36px;
  font-size: 1rem;
}

/* Category filter */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.category-filter button {
  background: white;
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.2s;
  font-family: inherit;
  font-weight: 500;
}

.category-filter button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.category-filter button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Calculator grid */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.calc-card {
  background: white;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
  border: 1px solid var(--border);
  display: block;
}

.calc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(30,136,229,0.12);
  border-color: var(--primary);
}

.calc-card .icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.calc-card.cat-salary .icon-circle { background: #E3F2FD; color: var(--salary); }
.calc-card.cat-tax .icon-circle { background: #FEF3C7; color: var(--tax); }
.calc-card.cat-finance .icon-circle { background: #DCFCE7; color: var(--finance); }
.calc-card.cat-vehicle .icon-circle { background: #EDE9FE; color: var(--vehicle); }
.calc-card.cat-lifestyle .icon-circle { background: #FCE7F3; color: var(--lifestyle); }

.calc-card h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
  font-weight: 700;
}

.calc-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.calc-card.hidden { display: none; }

/* Calculator detail page */
.calc-page {
  padding: 36px 20px 60px;
}

.calc-page .breadcrumb {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.calc-page .breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.calc-page .breadcrumb a:hover { color: var(--primary); }

.calc-page h1 {
  font-size: 1.9rem;
  margin-bottom: 6px;
  color: var(--text);
}

.calc-page .calc-subtitle {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 1rem;
}

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

@media (min-width: 900px) {
  .calc-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .calc-layout.single { grid-template-columns: 1fr; max-width: 600px; }
}

/* Form */
.calc-form,
.calc-result-box,
.info-box {
  background: white;
  border-radius: 14px;
  padding: 24px;
  border: 1px solid var(--border);
}

.calc-form h2,
.calc-result-box h2 {
  font-size: 1.15rem;
  margin-bottom: 18px;
  color: var(--text);
  text-align: left;
}

.field { margin-bottom: 18px; }

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

.field .hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: white;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,136,229,0.15);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 500px) {
  .field-row { grid-template-columns: 1fr; }
}

/* Mode toggle */
.mode-toggle {
  display: flex;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}

.mode-toggle button {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.mode-toggle button.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Checkbox */
.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 0.9rem;
}

.checkbox input { width: auto; margin: 0; }

/* Submit */
.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-top: 8px;
}

/* Result */
.result-empty {
  color: var(--text-secondary);
  text-align: center;
  padding: 24px 0;
  font-size: 0.95rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.result-row:last-child { border-bottom: none; }

.result-row .label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.result-row .value {
  font-weight: 600;
  font-size: 0.95rem;
}

.result-row.highlight .value {
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 800;
}

.result-row.highlight .label {
  color: var(--text);
  font-weight: 600;
}

.result-row.minus .value { color: var(--error); }
.result-row.plus .value { color: var(--success); }

.result-error {
  background: #FEE2E2;
  color: var(--error);
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* Info box */
.info-box {
  background: #F0F7FF;
  border: 1px solid #BBDEFB;
  margin-top: 24px;
}

.info-box h3 {
  font-size: 1rem;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.info-box p { font-size: 0.9rem; color: var(--text); margin-bottom: 8px; }

.info-box ul { font-size: 0.88rem; color: var(--text); margin-left: 18px; }

.info-box ul li { margin-bottom: 4px; }

.info-box .legal-basis {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 12px;
}

/* Table */
.payment-table {
  width: 100%;
  font-size: 0.85rem;
  margin-top: 16px;
  border-collapse: collapse;
}

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

.payment-table th {
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
}

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

.payment-table-wrap {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 16px;
}

.toggle-table {
  text-align: center;
  margin-top: 12px;
}

.toggle-table button {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  text-decoration: underline;
}

/* Ad slot */
.ad-slot {
  margin: 32px 0;
  text-align: center;
  min-height: 90px;
}

.ad-slot-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Highlights */
.highlights {
  background: white;
}

.highlight-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  list-style: none;
  margin-top: 24px;
}

.highlight-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  padding: 12px 16px;
  background: #F0F7FF;
  border-radius: 10px;
}

.highlight-list li .check {
  color: var(--primary);
  font-weight: bold;
  font-size: 1.1rem;
}

/* Download CTA */
.download-section {
  text-align: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-darker) 100%);
  color: white;
}

.download-section h2 {
  color: white;
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.download-section p {
  opacity: 0.92;
  margin-bottom: 24px;
  font-size: 1.05rem;
}

/* Footer */
.site-footer {
  background: #1A1D1F;
  color: #9CA3AF;
  text-align: center;
  padding: 32px 20px;
  font-size: 0.85rem;
}

.site-footer .footer-links {
  margin-bottom: 14px;
}

.site-footer .footer-links a {
  color: #9CA3AF;
  text-decoration: none;
  margin: 0 12px;
}

.site-footer .footer-links a:hover { color: white; }

/* Mini headline within calc page */
.calc-page .badges {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: #E3F2FD;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}
