/* ==========================================================================
   RankPay — warstwa wspólna
   Tokeny, reset, typografia, nawigacja, stopka, przyciski, elementy powtarzalne.
   Wartości przeniesione 1:1 z makiet klienta (_docs/*.html).
   ========================================================================== */

/* --- FONTY (self-hosted, zmienne woff2) ---------------------------------- */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/fraunces-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/fraunces-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- TOKENY --------------------------------------------------------------- */

:root {
  --ink: #10302B;          /* atramentowy zielono-granat */
  --ink-soft: #3C5650;
  --paper: #FBFAF6;        /* ciepła biel */
  --paper-2: #F2EEE4;      /* karta / tło sekcji */
  --line: #E4DECF;         /* hairline */
  --mint: #0FA877;         /* akcent miętowo-szmaragdowy */
  --mint-d: #0A7F59;
  --mint-bg: #E4F4ED;
  --amber: #E8902B;        /* ciepły bursztyn — wyróżnienie #1 */
  --amber-bg: #FBEBD4;
  --gold: #C9A227;
  --grey: #8A958F;
  --blue-bg: #E6F0FB;
  --purple-bg: #EEE8FB;
  --red-bg: #FBEAEA;
  --teal-bg: #E2F4F0;
  --shadow: 0 1px 2px rgba(16, 48, 43, .04), 0 8px 30px rgba(16, 48, 43, .07);
  --shadow-lift: 0 2px 6px rgba(16, 48, 43, .06), 0 22px 50px rgba(16, 48, 43, .13);
  --r: 18px;
}

/* --- RESET ---------------------------------------------------------------- */

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }

/* --- UKŁAD I TYPOGRAFIA --------------------------------------------------- */

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3, .display {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.01em;
}

a { color: inherit; text-decoration: none; }

.mint { color: var(--mint-d); }

.eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mint-d);
}

.section { padding: 72px 0; }
.section-head { max-width: 60ch; margin-bottom: 48px; }
.section-head h2 { font-size: 40px; margin: 12px 0 14px; }
.section-head p { color: var(--ink-soft); font-size: 17px; line-height: 1.65; }

/* Sekcja przylegająca do poprzedniej — makiety redukują tu górny odstęp. */
.section-tight { padding-top: 10px; }
.section-flush { padding-top: 0; }

.wrap-narrow { max-width: 840px; }

.note { font-size: 13px; color: var(--grey); margin-top: 14px; }
.note-small { font-size: 12.5px; margin-top: 12px; }

.page-disclaimer {
  max-width: 62ch;
  line-height: 1.55;
  font-size: 13.5px;
  color: var(--grey);
  margin: 48px 0 0;
}

.rp-icon { width: 22px; height: 22px; flex: none; }
.rp-emoji { font-size: 22px; line-height: 1; }

.stars { color: var(--gold); font-size: 14px; letter-spacing: 2px; }

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

/* Cel skoku dla linków kotwiczących — kompensuje przyklejoną nawigację. */
:target { scroll-margin-top: 84px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  border-radius: 0 0 10px 0;
  font-size: 14px;
  font-weight: 600;
}

.skip-link:focus { left: 0; }

@media (max-width: 720px) {
  .section { padding: 48px 0; }
  .section-head h2 { font-size: 30px; }
}

/* Długie nagłówki i adresy nie mogą rozpychać dokumentu — makiety nie
   przewidywały wąskich ekranów i przy 390 px powodowały poziomy przewijak,
   co obniża ocenę Core Web Vitals i utrudnia czytanie na telefonie. */
h1, h2, h3, h4, p, li, td, th, a { overflow-wrap: break-word; }

@media (max-width: 560px) {
  .section-head h2,
  .rankings-group h2,
  .glossary h2,
  .featured-art h2,
  .why h2,
  .b2b-band h2,
  .content-section h2,
  .related h2,
  .faq h2,
  .error-heading,
  .calc-title { font-size: 24px; }

  .article-head h1 { font-size: 27px; }
  .cta-band h2 { font-size: 24px; }
}

/* --- NAWIGACJA ------------------------------------------------------------ */

header.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 246, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -.02em;
}

.logo .dot {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--ink);
  position: relative;
  flex: none;
}

.logo .dot::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
}

.logo img { display: block; height: 26px; width: auto; }

.nav-links { display: flex; gap: 28px; font-size: 14.5px; font-weight: 500; list-style: none; }
.nav-links a { color: var(--ink-soft); transition: color .15s; }
.nav-links a:hover,
.nav-links a.active,
.nav-links .current-menu-item > a,
.nav-links .current_page_parent > a { color: var(--ink); }
.nav-links .current-menu-item > a { font-weight: 600; }

.nav-cta {
  background: var(--ink);
  color: var(--paper);
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* Przełącznik menu mobilnego — makieta ukrywa nawigację poniżej 720px
   bez alternatywy; dokładamy dostępny panel, żeby serwis dało się
   obsłużyć na telefonie. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-open { display: none; }
.nav-toggle[aria-expanded="false"] .nav-toggle-close { display: none; }

.nav-mobile {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 12px 0 20px;
}

.nav-mobile.is-open { display: block; }
.nav-mobile ul { list-style: none; display: flex; flex-direction: column; }
.nav-mobile a {
  display: block;
  padding: 12px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.nav-mobile a:hover { color: var(--ink); }
.nav-mobile .nav-cta { display: inline-flex; margin-top: 18px; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-in > .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* --- PRZYCISKI ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 26px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15.5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

.btn-primary { background: var(--mint); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-on-dark { border-color: rgba(255, 255, 255, .25); color: var(--paper); }

/* --- BREADCRUMB I NAGŁÓWEK PODSTRONY -------------------------------------- */

.breadcrumb-bar {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  font-size: 13px;
  color: var(--grey);
}

.breadcrumb-bar .wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.breadcrumb-bar a { color: var(--grey); }
.breadcrumb-bar a:hover { color: var(--ink); }
.breadcrumb-bar [aria-current="page"] { color: var(--ink); }

.page-header { padding: 56px 0 48px; border-bottom: 1px solid var(--line); }
.page-header .breadcrumb {
  font-size: 13px;
  color: var(--grey);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.page-header .breadcrumb a { color: var(--grey); }
.page-header .breadcrumb a:hover { color: var(--ink); }
.page-header h1 { font-size: 50px; margin-bottom: 16px; }
.page-header h1 em { font-style: italic; color: var(--mint-d); }
.page-header .lead { font-size: 18px; color: var(--ink-soft); max-width: 64ch; line-height: 1.6; }

@media (max-width: 720px) {
  .page-header h1 { font-size: 34px; }
}

/* --- ZAKŁADKI FILTRÓW ----------------------------------------------------- */

.filter-tabs { display: flex; gap: 10px; padding: 28px 0; flex-wrap: wrap; }

.tab {
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 100px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.tab:hover { border-color: var(--ink); }
.tab.active,
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.is-hidden { display: none !important; }

/* Pułapka na boty. Musi zostać w drzewie dokumentu i być wypełnialna
   programowo, ale niewidoczna dla człowieka — dlatego przesunięcie poza
   ekran, a nie display:none. Reguła należy do warstwy wspólnej, bo formularze
   pojawiają się także poza stroną kontaktową. */
.rp-hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- PASEK CTA (ciemny) --------------------------------------------------- */

.cta-band {
  background: var(--ink);
  border-radius: 24px;
  padding: 56px;
  text-align: center;
  color: var(--paper);
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 168, 119, .4), transparent 70%);
  top: -120px;
  right: -60px;
}

.cta-band h2 { font-size: 36px; margin-bottom: 14px; position: relative; }
.cta-band p { color: #CDDAD3; max-width: 52ch; margin: 0 auto 28px; position: relative; font-size: 17px; }
.cta-band .cta-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

@media (max-width: 720px) {
  .cta-band { padding: 34px 24px; }
  .cta-band h2 { font-size: 27px; }
}

/* --- FAQ ------------------------------------------------------------------ */

.faq details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 22px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16.5px;
  padding: 16px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  font-family: 'Fraunces', serif;
  font-size: 24px;
  color: var(--mint-d);
  transition: transform .2s;
}

.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 18px; color: var(--ink-soft); font-size: 15px; }
.faq details p + p { padding-top: 0; margin-top: -8px; }

/* --- STOPKA --------------------------------------------------------------- */

footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0;
  margin-top: 0;
  font-size: 13.5px;
  color: var(--grey);
}

.rp-front footer.site-footer { margin-top: 80px; }
.rp-article footer.site-footer { margin-top: 64px; }

.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.foot-brand .logo { margin-bottom: 14px; font-size: 17px; }
.foot-brand p { font-size: 13px; line-height: 1.6; max-width: 34ch; }

.foot-col h4 {
  font-family: 'Fraunces', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
}

.foot-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.foot-col ul a { color: var(--grey); font-size: 13.5px; transition: color .15s; }
.foot-col ul a:hover { color: var(--ink); }

.foot-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 28px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}

.foot-bottom ul { list-style: none; display: flex; gap: 20px; flex-wrap: wrap; }
.foot-bottom a { color: var(--grey); }
.foot-bottom a:hover { color: var(--ink); }

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

/* --- ANIMACJE ------------------------------------------------------------- */

@keyframes rp-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(15, 168, 119, .5); }
  70%  { box-shadow: 0 0 0 9px rgba(15, 168, 119, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 168, 119, 0); }
}

.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(15, 168, 119, .5);
  animation: rp-pulse 2.2s infinite;
  flex: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* --- WIDOCZNY FOCUS (dostępność) ------------------------------------------ */

:focus-visible {
  outline: 2px solid var(--mint-d);
  outline-offset: 2px;
  border-radius: 4px;
}
