/* ================================
   Kalkulator-dat.pl — main.css
   System designu: tokens → reset → layout → komponenty → utility
   ============================================================ */

/* ------- 1. TOKENS ---------- */
:root {
  --c-primary: #2563eb;
  --c-primary-dark: #1d4ed8;
  --c-primary-light: #dbeafe;
  --c-accent: #f59e0b;
  --c-success: #10b981;
  --c-error: #ef4444;
  --c-warning: #f59e0b;

  --c-bg: #ffffff;
  --c-bg-soft: #f8fafc;
  --c-bg-muted: #f1f5f9;
  --c-text: #0f172a;
  --c-text-soft: #334155;
  --c-text-muted: #64748b;
  --c-border: #e2e8f0;
  --c-border-strong: #cbd5e1;

  --ff-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 1.875rem;
  --fs-3xl: 2.25rem;
  --fs-4xl: 3rem;

  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;

  --sh-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --sh-md: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --sh-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.05);

  --container-w: 1200px;
  --container-narrow: 800px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #0f172a;
    --c-bg-soft: #1e293b;
    --c-bg-muted: #334155;
    --c-text: #f1f5f9;
    --c-text-soft: #cbd5e1;
    --c-text-muted: #94a3b8;
    --c-border: #334155;
    --c-border-strong: #475569;
    --c-primary-light: #1e3a8a;
  }
}

/* ------- 2. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--sp-4);
  font-weight: 700;
  line-height: 1.25;
  color: var(--c-text);
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); margin-top: var(--sp-10); }
h3 { font-size: var(--fs-xl); margin-top: var(--sp-8); }
h4 { font-size: var(--fs-lg); }
p { margin:0 0 var(--sp-4); color: var(--c-text-soft); }
a {
  color: var(--c-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
a:hover { color: var(--c-primary-dark); }
ul, ol { padding-left: var(--sp-6); margin: 0 0 var(--sp-4); }
li { margin-bottom: var(--sp-2); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: var(--fs-base); }
:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ---------- 3. LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 var(--sp-4);
}
.container--narrow { max-width: var(--container-narrow); }
@media (min-width: 768px) {
  .container { padding: 0 var(--sp-6); }
}
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-primary);
  color: #fff;
  z-index: 100;
}
.skip-link:focus { top: 0; }

/* ---------- 4. HEADER --------- */
.site-header {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: var(--sp-4);
}
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 800;
  font-size: var(--fs-lg);
  color: var(--c-text);
  text-decoration: none;
}
.site-logo__icon { font-size: 1.5em; }

.site-nav { display: none; }
.site-nav__list {
  display: flex;
  gap: var(--sp-1);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav__link {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  color: var(--c-text-soft);
  text-decoration: none;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  background: var(--c-bg-muted);
  color: var(--c-primary);
}
@media (min-width: 1024px) {
  .site-nav { display: block; }
  .nav-toggle { display: none; }
}
.nav-toggle {
  background: none;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-base);
}
.mobile-nav {
  display: none;
  border-top: 1px solid var(--c-border);
  padding: var(--sp-4) 0;
}
.mobile-nav.is-open { display: block; }
.mobile-nav__list { list-style: none; padding: 0; margin: 0; }
.mobile-nav__link {
  display: block;
  padding: var(--sp-3) var(--sp-2);
  color: var(--c-text);
  text-decoration: none;
  border-bottom: 1px solid var(--c-border);
}

/* ---------- 5. FOOTER ------- */
.site-footer {
  background: var(--c-bg-soft);
  border-top: 1px solid var(--c-border);
  margin-top: var(--sp-16);
  padding: var(--sp-12) 0 var(--sp-6);
}
.footer-grid {
  display: grid;
  gap: var(--sp-8);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-col__title {
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-3);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: var(--sp-2); }
.footer-col a {
  color: var(--c-text-soft);
  text-decoration: none;
  font-size: var(--fs-sm);
}
.footer-col a:hover { color: var(--c-primary); text-decoration: underline; }
.footer-bottom {
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  text-align: center;
}

/* ---------- 6. HERO ---------- */
.hero {
  padding: var(--sp-12) 0 var(--sp-10);
  text-align: center;
  background: linear-gradient(180deg, var(--c-primary-light) 0%, var(--c-bg) 100%);
}
.hero h1 { font-size: var(--fs-3xl); margin-bottom: var(--sp-4); }
@media (min-width: 768px) {
  .hero { padding: var(--sp-16) 0; }
  .hero h1 { font-size: var(--fs-4xl); }
}
.hero__lead {
  font-size: var(--fs-md);
  color: var(--c-text-soft);
  max-width: 720px;
  margin: 0 auto var(--sp-6);
}

/* ---------- 7. CARD ---------- */
.card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--sh-sm);
}
.card--soft { background: var(--c-bg-soft); }

.tools-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
  margin-top: var(--sp-8);
}
@media (min-width: 600px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tools-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .tools-grid { grid-template-columns: repeat(4, 1fr); } }

.tool-card {
  display: block;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  text-decoration: none;
  color: var(--c-text);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.tool-card:hover {
  border-color: var(--c-primary);
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}
.tool-card__icon { font-size: 2rem; margin-bottom: var(--sp-2); }
.tool-card__title {
  font-size: var(--fs-md);
  font-weight: 700;
  margin-bottom: var(--sp-1);
  color: var(--c-text);
}
.tool-card__desc {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  margin: 0;
}

/* ---------- 8. CALCULATOR ---------- */
.calc {
  margin: var(--sp-8) 0;
  padding: var(--sp-6);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
}
.calc__title { font-size: var(--fs-xl); margin: 0 0 var(--sp-4); }

.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.field__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text);
}
.field__hint { font-size: var(--fs-xs); color: var(--c-text-muted); }
.field__control,
input[type="date"],
input[type="time"],
input[type="number"],
input[type="text"],
select,
textarea {
  width: 100%;
  padding: var(--sp-3);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-bg);
  color: var(--c-text);
  font-size: var(--fs-base);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field__control:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 3px var(--c-primary-light);
  outline: none;
}

.row {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .row--2 { grid-template-columns: 1fr 1fr; }
  .row--3 { grid-template-columns: 1fr 1fr 1fr; }
}

.checkbox {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--c-text-soft);
  cursor: pointer;
}
.checkbox input { width: auto; }

.btn {
  display: inline-block;
  padding: var(--sp-3) var(--sp-6);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  min-height: 48px;
}
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn--secondary {
  background: transparent;
  border-color: var(--c-border-strong);
  color: var(--c-text);
}
.btn--secondary:hover { background: var(--c-bg-muted); }
.btn:active { transform: translateY(1px); }
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.result {
  margin-top: var(--sp-6);
  padding: var(--sp-5);
  background: var(--c-primary-light);
  border-left: 4px solid var(--c-primary);
  border-radius: var(--r-md);
  display: none;
}
.result.is-visible { display: block; }
.result--error { background: #fee2e2; border-color: var(--c-error); }
.result__main {
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--c-primary-dark);
  margin: 0 0 var(--sp-2);
}
.result__details { font-size: var(--fs-sm); color: var(--c-text-soft); }
.result__details ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); }

/* ---------- 9. CONTENT (prose) ---------- */
.prose { max-width: var(--container-narrow); margin: 0 auto; }
.prose h2 { border-bottom: 1px solid var(--c-border); padding-bottom: var(--sp-2); }
.prose blockquote {
  margin: var(--sp-6) 0;
  padding: var(--sp-3) var(--sp-5);
  border-left: 4px solid var(--c-primary);
  background: var(--c-bg-soft);
  font-style: italic;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-6) 0;
  font-size: var(--fs-sm);
}
.prose th, .prose td {
  padding: var(--sp-3);
  border: 1px solid var(--c-border);
  text-align: left;
}
.prose th { background: var(--c-bg-muted); font-weight: 700; }

.faq details {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.faq summary { cursor: pointer; font-weight: 600; color: var(--c-text); }
.faq details[open] summary { margin-bottom: var(--sp-3); }

.breadcrumbs {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  padding: var(--sp-3) 0;
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: 0;
  margin: 0;
}
.breadcrumbs li::after { content: "›"; margin-left: var(--sp-2); color: var(--c-text-muted); }
.breadcrumbs li:last-child::after { content: ""; }
.breadcrumbs a { color: var(--c-text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--c-primary); text-decoration: underline; }

.holidays-table { font-size: var(--fs-sm); }
.holidays-table caption {
  text-align: left;
  font-weight: 700;
  margin-bottom: var(--sp-2);
}

.section { padding: var(--sp-12) 0; }
.section--alt { background: var(--c-bg-soft); }

/* Utilities */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-8 { margin-top: var(--sp-8); }
.mb-8 { margin-bottom: var(--sp-8); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0);
  border: 0;
}

/* Print */
@media print {
  .site-header, .site-footer, .calc__buttons, .nav-toggle, .ad-slot { display: none !important; }
  .calc { box-shadow: none; border: 1px solid #999; }
  body { color: #000; background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}