/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1c2531;
  background: #ffffff;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: #153d6f; text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
ul, ol { padding-left: 1.25rem; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; color: #10192b; }
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: .5rem; }
h3 { font-size: 1.15rem; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: #153d6f;
  color: #fff;
  padding: .75rem 1.25rem;
  z-index: 1000;
  border-radius: 0 0 6px 0;
}
.skip-link:focus {
  left: 0;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffffee;
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #e7eaf0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.25rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: #10192b;
}
.logo:hover { text-decoration: none; }
.logo-img {
  height: 52px;
  width: auto;
  display: block;
}
.primary-nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0; padding: 0;
}
.primary-nav a {
  color: #33405a;
  font-weight: 600;
  font-size: .95rem;
}
.primary-nav a.active { color: #153d6f; text-decoration: underline; }
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none;
  border: 1px solid #d8dbe3;
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: #10192b;
}

/* ===== Hero ===== */
.hero {
  padding: 3.5rem 0 2.5rem;
  background: linear-gradient(180deg, #f4f7fc 0%, #ffffff 100%);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
  font-weight: 700;
  color: #f5b301;
  margin: 0 0 .5rem;
}
.hero-lead {
  max-width: 62ch;
  font-size: 1.1rem;
  color: #3c4658;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 1.25rem;
}
.disclaimer-inline {
  font-size: .85rem;
  color: #6b7385;
  max-width: 70ch;
  border-left: 3px solid #f5b301;
  padding-left: .75rem;
}

.article-disclosure {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  font-size: .78rem;
  color: #8a91a3;
  text-align: center;
  border-top: 1px solid #e5e8ee;
}

.btn {
  display: inline-block;
  padding: .75rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: .95rem;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn:hover, .btn:focus-visible { text-decoration: none; }
.btn-primary {
  background: #153d6f;
  color: #fff;
}
.btn-primary:hover { background: #0e2c52; }
.btn-ghost {
  background: transparent;
  border-color: #153d6f;
  color: #153d6f;
}
.btn-ghost:hover { background: #153d6f; color: #fff; }

/* ===== Sections ===== */
.section { padding: 3.25rem 0; scroll-margin-top: 80px; }
.section-alt { background: #f6f8fc; }
.section-kicker {
  display: inline-block;
  background: #f5b301;
  color: #10192b;
  font-weight: 800;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .25rem .6rem;
  border-radius: 999px;
  margin-bottom: .75rem;
}
#top1, #ranking, #porownanie, #kategorie, #faq, #wniosek { scroll-margin-top: 80px; }
.score-pill {
  display: inline-block;
  background: #10192b;
  color: #f5b301;
  font-weight: 800;
  font-size: .85rem;
  padding: .2rem .65rem;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: .5rem;
}

/* ===== Table ===== */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; -webkit-overflow-scrolling: touch; }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 720px;
  background: #fff;
}
.criteria-table { min-width: 0; max-width: 480px; }
th, td {
  padding: .75rem .9rem;
  text-align: left;
  border-bottom: 1px solid #e7eaf0;
  font-size: .92rem;
  white-space: nowrap;
}
.ranking-table thead th {
  background: #10192b;
  color: #fff;
  font-weight: 700;
  position: sticky;
  top: 0;
}
.ranking-table tbody tr:hover { background: #f6f8fc; }
.ranking-table tr.rank-1 { background: #fffaf0; }
.criteria-table th { background: transparent; color: #10192b; font-weight: 600; white-space: normal; }

/* Desktop/tablet: fit the ranking table inside the container, no horizontal scroll */
.ranking-table {
  table-layout: fixed;
  min-width: 0;
}
.ranking-table th,
.ranking-table td {
  white-space: normal;
  word-break: break-word;
  padding: .65rem .55rem;
  font-size: .85rem;
  text-align: center;
}
.ranking-table th:nth-child(2),
.ranking-table td:nth-child(2) { text-align: left; }
.ranking-table th:nth-child(1), .ranking-table td:nth-child(1) { width: 8%; }
.ranking-table th:nth-child(2), .ranking-table td:nth-child(2) { width: 16%; }
.ranking-table th:nth-child(3), .ranking-table td:nth-child(3) { width: 9%; }
.ranking-table th:nth-child(4), .ranking-table td:nth-child(4) { width: 10%; }
.ranking-table th:nth-child(5), .ranking-table td:nth-child(5) { width: 13%; }
.ranking-table th:nth-child(6), .ranking-table td:nth-child(6) { width: 14%; }
.ranking-table th:nth-child(7), .ranking-table td:nth-child(7) { width: 9%; }
.ranking-table th:nth-child(8), .ranking-table td:nth-child(8) { width: 11%; }
.ranking-table th:nth-child(9), .ranking-table td:nth-child(9) { width: 10%; }
.ranking-table .tag { white-space: nowrap; }
.ranking-table thead th { font-size: .78rem; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #e7eaf0;
  color: #33405a;
  font-weight: 800;
  font-size: .85rem;
}
.rank-badge.gold { background: #f5b301; color: #10192b; }
.rank-badge.silver { background: #c7cdd8; color: #10192b; }
.rank-badge.bronze { background: #d99a5b; color: #10192b; }

.tag {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
}
.tag-yes { background: #e3f6ea; color: #17794a; }
.tag-partial { background: #fdf1de; color: #a3660b; }

/* ===== Check list ===== */
.check-list { list-style: none; padding: 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 1.25rem 0; }
.check-list li {
  background: #fff;
  border: 1px solid #e7eaf0;
  border-radius: 8px;
  padding: .6rem .85rem .6rem 2.1rem;
  position: relative;
  font-size: .93rem;
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: .75rem;
  color: #17794a;
  font-weight: 800;
}

.callout {
  background: #10192b;
  color: #e7eaf0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}
.callout strong { color: #f5b301; }

/* ===== TOP 1 winner panel ===== */
.top1-lead { max-width: 68ch; font-size: 1.05rem; }
.top1-panel {
  background: #fff;
  border-radius: 16px;
  border-top: 4px solid #f5b301;
  box-shadow: 0 12px 32px rgba(16, 25, 43, .09);
  padding: 2rem;
  margin-top: 1.75rem;
}
.top1-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: start;
}
.top1-col h3 { margin-top: 0; }
.top1-col .criteria-table { max-width: none; }
.check-list-stack { grid-template-columns: 1fr; margin-top: 1rem; }
@media (max-width: 860px) {
  .top1-panel { padding: 1.5rem; }
  .top1-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ===== Company cards ===== */
.company-list { display: grid; gap: 1.25rem; margin-top: 1.75rem; }
.company-card {
  background: #fff;
  border: 1px solid #e7eaf0;
  border-radius: 12px;
  padding: 1.5rem;
  scroll-margin-top: 80px;
}
.company-card-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.company-card-header h3 { margin: 0; }
.company-tagline { font-weight: 700; color: #153d6f; margin-top: 0; }
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}
.pros h4, .cons h4 { margin: 0 0 .35rem; font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
.pros h4 { color: #17794a; }
.cons h4 { color: #b23b3b; }
.pros ul, .cons ul { margin: 0; padding-left: 1.1rem; font-size: .92rem; }
.pros li, .cons li { margin-bottom: .25rem; }

/* ===== Category grid ===== */
.section-lead { max-width: 62ch; color: #5a6472; margin: 0 0 .5rem; }

.category-card {
  background: #fff;
  border: 1px solid #e7eaf0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}
.category-card h3 { margin-top: 0; font-size: 1.05rem; }
.category-note { margin: .75rem 0 0; font-size: .85rem; color: #5a6472; }

.category-card-top { margin-bottom: .85rem; }
.category-card-top h3 { margin: 0; }

.category-badge {
  display: inline-block;
  background: #fdf1de;
  color: #a3660b;
  font-weight: 800;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .25rem .55rem;
  border-radius: 999px;
  margin-bottom: .5rem;
}

.category-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .45rem;
}
.category-rank-list li {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .93rem;
}
.mini-rank {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e7eaf0;
  color: #33405a;
  font-weight: 800;
  font-size: .78rem;
}
.mini-rank--gold { background: #f5b301; color: #10192b; }
.mini-rank--silver { background: #c7cdd8; color: #10192b; }
.mini-rank--bronze { background: #d99a5b; color: #10192b; }

/* Featured category card */
.category-card--featured {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  align-items: center;
  border: none;
  border-top: 4px solid #f5b301;
  box-shadow: 0 12px 32px rgba(16, 25, 43, .09);
  padding: 2rem;
}
.category-featured-main h3 { font-size: 1.3rem; }
.category-featured-main .category-note { margin-top: .6rem; }
.category-card--featured .category-rank-list { gap: .6rem; }
.category-card--featured .mini-rank { width: 28px; height: 28px; font-size: .85rem; }
.category-card--featured .category-rank-list a { font-weight: 700; }

/* Secondary category grid */
.category-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-top: 1.25rem;
}
.category-card--accent-navy { border-top: 3px solid #153d6f; }
.category-card--accent-green { border-top: 3px solid #17794a; }
.category-card--accent-slate { border-top: 3px solid #5a6472; }
.category-card--accent-gold { border-top: 3px solid #f5b301; }

@media (max-width: 760px) {
  .category-card--featured {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
}

/* ===== FAQ ===== */
.faq-list { display: grid; gap: .75rem; margin-top: 1.5rem; }
.faq-item {
  background: #fff;
  border: 1px solid #e7eaf0;
  border-radius: 10px;
  padding: .9rem 1.1rem;
}
.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  float: right;
  font-weight: 800;
  color: #153d6f;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin: .6rem 0 .1rem; color: #3c4658; }

/* ===== Footer ===== */
.site-footer {
  background: #10192b;
  color: #c7cdd8;
  padding: 3rem 0 1.5rem;
}
.logo-footer { color: #fff; margin-bottom: .75rem; }
.logo-footer .logo-img { filter: brightness(0) invert(1); }
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 2fr 1fr 1.4fr;
}
.footer-grid h3 { color: #fff; font-size: .95rem; margin-top: 0; }
.footer-grid p { font-size: .9rem; color: #a7aec1; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.footer-grid a { color: #c7cdd8; font-size: .9rem; }
.footer-bottom {
  border-top: 1px solid #26314a;
  margin-top: 2rem;
  padding-top: 1.25rem;
  font-size: .82rem;
  color: #7d8496;
}

/* ===== Back to top ===== */
.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #153d6f;
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16,25,43,.25);
  z-index: 90;
}
.back-to-top:hover { background: #0e2c52; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .pros-cons { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid #e7eaf0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
  }
  .primary-nav.open { max-height: 320px; }
  .primary-nav ul {
    flex-direction: column;
    gap: 0;
    padding: .5rem 1.25rem 1rem;
  }
  .primary-nav li { border-top: 1px solid #f1f3f7; }
  .primary-nav a { display: block; padding: .75rem 0; }
}

/* Mobile: turn table rows into stacked cards, no horizontal scroll */
@media (max-width: 640px) {
  .table-wrap { overflow-x: visible; }

  .ranking-table { min-width: 0; }
  .ranking-table thead { display: none; }
  .ranking-table, .ranking-table tbody, .ranking-table tr, .ranking-table td {
    display: block;
    width: 100%;
  }
  .ranking-table th:nth-child(n), .ranking-table td:nth-child(n) {
    width: auto;
  }
  .ranking-table tr {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: .75rem;
    margin-bottom: 1rem;
    padding: .85rem 1rem .95rem;
    border: 1px solid #e7eaf0;
    border-radius: 12px;
  }
  .ranking-table td {
    padding: .4rem 0;
    border-bottom: 1px dashed #eef0f5;
  }
  .ranking-table td[data-label="Miejsce"] {
    grid-column: 1;
    grid-row: 1;
    border-bottom: none;
  }
  .ranking-table td[data-label="Firma"] {
    grid-column: 2;
    grid-row: 1;
    border-bottom: none;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
  }
  .ranking-table td:not([data-label="Miejsce"]):not([data-label="Firma"]) {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
  }
  .ranking-table td:not([data-label="Miejsce"]):not([data-label="Firma"])::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6b7385;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .02em;
  }
  .ranking-table td:last-child { border-bottom: none; }

  .criteria-table { max-width: none; }
  .criteria-table th, .criteria-table td { padding: .6rem .5rem; }
}
