@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --white: #ffffff;
  --bg: #f8f9fa;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --primary: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --red: #dc2626;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  line-height: 1.6;
}

/* ── HEADER ── */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}
.logo-icon {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.hamburger {
  background: none; border: none;
  cursor: pointer; padding: 8px; display: flex; flex-direction: column; gap: 5px;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.2s; }

/* Mobile Nav */
.mobile-nav {
  display: none;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px 16px;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block; padding: 10px 12px; font-size: 15px; color: var(--text);
  text-decoration: none; border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.mobile-nav a:hover { background: var(--bg); }
.mobile-nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* ── AD BANNER ── */
.ad-banner {
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.ad-banner-inner {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px dashed #d1d5db;
  border-radius: var(--radius-sm);
  max-width: 1280px;
  margin: 0 auto;
}

/* ── MAIN ── */
main {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 28px 20px 48px;
}

/* ── PAGE TITLE ── */
h1.page-title {
  font-size: clamp(1.6rem, 5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  line-height: 1.2;
}
.page-sub {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 24px;
}

/* ── CARD ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

/* ── FORM ── */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
label.lbl {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.input-wrap { position: relative; }
.input-suffix {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%); color: var(--muted); font-size: 15px; pointer-events: none;
}
input[type=text], input[type=number], select {
  width: 100%; padding: 12px 40px 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--white); color: var(--text);
  font-family: 'Inter', sans-serif; font-size: 16px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
input[type=text]:focus, input[type=number]:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,0.12);
}
select { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' 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 12px center; }
input[type=range] {
  width: 100%; height: 4px; background: #e5e7eb;
  border-radius: 2px; outline: none; cursor: pointer;
  margin-top: 10px; -webkit-appearance: none; appearance: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px;
  border-radius: 50%; background: var(--primary); cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
input[type=range]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); cursor: pointer; border: none;
}
.check-row {
  display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
}
.check-row input[type=checkbox] {
  width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0;
}
.check-row span { font-size: 15px; }

/* ── RESULT HIGHLIGHT ── */
.result-box {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.result-label { font-size: 13px; color: #3b82f6; margin-bottom: 2px; }
.result-value {
  font-size: 2.2rem; font-weight: 800; color: var(--primary);
  letter-spacing: -0.02em; line-height: 1.1;
}
.result-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── BREAKDOWN ── */
.breakdown { font-size: 14px; }
.brow {
  display: flex; justify-content: space-between;
  align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.brow:last-child { border-bottom: none; }
.brow .bl { color: var(--muted); }
.brow .bv { font-weight: 500; }
.brow .neg { color: var(--red); }
.brow .pos { color: var(--primary); }
.brow.total .bl, .brow.total .bv { font-weight: 700; font-size: 15px; }
.brow.total .bv.pos { color: var(--primary); }
.divline { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ── PROSE ── */
.prose { margin-top: 40px; }
.prose h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 12px; }
.prose h3 { font-size: 1rem; font-weight: 700; margin: 20px 0 6px; }
.prose p { font-size: 14px; color: #374151; line-height: 1.75; margin-bottom: 10px; }

/* ── FAQ ── */
.faq { margin-top: 36px; }
.faq h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; margin-bottom: 8px; background: var(--white);
}
.faq-q {
  width: 100%; background: none; border: none; text-align: left;
  padding: 14px 18px; font-family: 'Inter', sans-serif; font-size: 14px;
  font-weight: 500; color: var(--text); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-q:hover { background: var(--bg); }
.faq-q .chev { font-size: 11px; color: var(--muted); transition: transform 0.2s; flex-shrink: 0; }
.faq-q.open .chev { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 18px 14px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.faq-a.open { display: block; }

/* ── OTHER CALCS ── */
.other-calcs { margin-top: 36px; }
.other-calcs h2 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.calc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px;
}
.calc-link {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--white);
  color: var(--text); text-decoration: none; font-size: 13px; font-weight: 500;
  transition: all 0.15s;
}
.calc-link:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.calc-link.current { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ── FOOTER ── */
footer {
  background: #111827;
  color: rgba(255,255,255,0.7);
  padding: 48px 20px 24px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px;
}
.footer-logo {
  font-size: 1.1rem; font-weight: 700; color: white; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.footer-logo .logo-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.footer-desc { font-size: 13px; line-height: 1.7; }
.footer-h { font-size: 14px; font-weight: 700; color: white; margin-bottom: 12px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.footer-links a { font-size: 13px; color: rgba(255,255,255,0.65); text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: white; }
.footer-bottom {
  max-width: 1280px; margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px; font-size: 12px; color: rgba(255,255,255,0.35); text-align: center;
}

/* ── CONTENT PAGE ── */
.content-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px;
  box-shadow: var(--shadow);
}
.content-card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.content-card h3 { font-size: 1rem; font-weight: 600; margin: 18px 0 6px; }
.content-card p { font-size: 14px; color: #374151; line-height: 1.75; margin-bottom: 10px; }

/* ── MULTI RESULT BOXES ── */
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.result-box-sm {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; text-align: center;
}
.result-box-sm.primary { background: var(--primary-light); border-color: var(--primary-border); }
.result-box-sm .rsl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.result-box-sm.primary .rsl { color: var(--primary); }
.result-box-sm .rsv { font-size: 1.2rem; font-weight: 800; color: var(--text); }
.result-box-sm.primary .rsv { color: var(--primary); }

/* ── MWST 3-col ── */
.mwst-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 0;
}
.mwst-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; text-align: center;
}
.mwst-box.primary { background: var(--primary-light); border-color: var(--primary-border); }
.mwst-box .ml { font-size: 11px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.mwst-box.primary .ml { color: var(--primary); }
.mwst-box .mv { font-size: 1.2rem; font-weight: 800; color: var(--text); }
.mwst-box.primary .mv { color: var(--primary); }

/* ── PROZENT sub-cards ── */
.sub-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 18px; margin-bottom: 14px;
}
.sub-card:last-child { margin-bottom: 0; }
.sub-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: end; }
.mini-result {
  background: var(--primary-light); border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm); padding: 10px; text-align: center;
}
.mini-result .ml { font-size: 11px; color: var(--primary); font-weight: 600; margin-bottom: 2px; }
.mini-result .mv { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.small-note { font-size: 12px; color: var(--muted); margin-top: 6px; display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .result-grid { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
  .mwst-row { grid-template-columns: 1fr; }
  h1.page-title { font-size: 1.4rem; }
  .result-value { font-size: 1.8rem; }

  /* Better mobile layout */
  main { padding: 0 12px 32px; }
  .card { padding: 16px 14px; border-radius: 10px; }
  .field { margin-bottom: 14px; }
  .lbl { font-size: 13px; }
  .input-wrap input[type="text"],
  .input-wrap select { font-size: 16px; padding: 10px 12px; }
  input[type="range"] { margin-top: 6px; }
  .result-box { padding: 18px 14px; border-radius: 10px; }
  .result-label { font-size: 11px; }
  .result-value { font-size: 2rem; }
  .breakdown { margin-top: 12px; }
  .brow { padding: 8px 0; font-size: 13px; }
  .prose { padding: 18px 14px; }
  .prose h2 { font-size: 1rem; }
  .prose h3 { font-size: 0.92rem; }
  .prose p { font-size: 13.5px; }
  .faq { padding: 18px 14px; }
  .faq h2 { font-size: 1rem; }
  .faq-q { font-size: 13.5px; padding: 12px 10px; }
  .other-calcs { padding: 16px 14px; }
  .calc-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .calc-link { padding: 10px 8px; font-size: 12px; }
  .page-sub { font-size: 13.5px; margin-bottom: 14px; }
  .header-inner { height: 50px; padding: 0 14px; }
  .logo { font-size: 1rem; }
}
