:root {
  --green: #2d6a4f;
  --green-light: #40916c;
  --blue: #1e6f8c;
  --blue-light: #48cae4;
  --orange: #e85d04;
  --orange-light: #f48c06;
  --text: #1a2a22;
  --text-muted: #3d5a4a;
  --bg-light: #f8faf9;
  --bg-white: #ffffff;
}

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-light);
}

.header {
  background: linear-gradient(135deg, var(--green) 0%, var(--blue) 100%);
  color: #fff;
  padding: 1rem 2rem;
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
}

.nav-links a:hover {
  text-decoration: underline;
}

.nav-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  background: #fff;
  color: var(--green);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.btn:hover {
  opacity: 0.9;
}

.hero {
  background: linear-gradient(135deg, var(--green) 0%, var(--blue) 100%);
  color: #fff;
  padding: 4rem 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto 1rem;
}

.hero .btn {
  margin-top: 0.5rem;
}

/* Stats block */
.stats-block {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  background: var(--bg-white);
}

.stat-card {
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.stat-card:nth-child(1) {
  background: #e8f5e9;
  border-top: 4px solid var(--green);
}

.stat-card:nth-child(2) {
  background: #e3f2fd;
  border-top: 4px solid var(--blue);
}

.stat-card:nth-child(3) {
  background: #fff3e0;
  border-top: 4px solid var(--orange);
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-card:nth-child(1) .stat-value { color: var(--green); }
.stat-card:nth-child(2) .stat-value { color: var(--blue); }
.stat-card:nth-child(3) .stat-value { color: var(--orange); }

.stat-card .stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Section alternating backgrounds */
.section-alt {
  display: flex;
  align-items: center;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.section-alt:nth-of-type(odd) {
  background: var(--bg-white);
}

.section-alt:nth-of-type(even) {
  background: #e8f4f8;
}

.section-alt.img-left .section-img {
  order: 1;
}

.section-alt.img-left .section-content {
  order: 2;
}

.section-alt.img-right .section-img {
  order: 2;
}

.section-alt.img-right .section-content {
  order: 1;
}

.section-img {
  flex: 0 0 45%;
  min-width: 280px;
}

.section-img img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.section-content {
  flex: 1;
  min-width: 0;
}

.section-content h2 {
  color: var(--green);
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

.section-content p {
  margin-bottom: 1rem;
}

.section-content p:last-child {
  margin-bottom: 0;
}

.section-content a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}

.section-content a:hover {
  text-decoration: underline;
}

.highlight-box {
  background: #e8f5e9;
  border-left: 4px solid var(--green);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  border-radius: 0 8px 8px 0;
}

.highlight-box p {
  margin: 0;
  color: var(--text);
}

/* Checklist */
.checklist-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  background: var(--bg-white);
}

.checklist-section h2 {
  color: var(--green);
  margin-bottom: 1.5rem;
  text-align: center;
}

.checklist-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.checklist-list li {
  padding-left: 2rem;
  position: relative;
}

.checklist-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

.checklist-list li {
  color: var(--text);
}

/* FAQ */
.faq-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
  background: #e3f2fd;
}

.faq-section h2 {
  color: var(--blue);
  margin-bottom: 1.5rem;
  text-align: center;
}

.faq-list details {
  background: var(--bg-white);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-left: 4px solid var(--blue);
}

.faq-list summary {
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.faq-list summary:hover {
  color: var(--blue);
}

.faq-list p {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e3f2fd;
  color: var(--text-muted);
}

/* Oddziały */
.oddzialy-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  background: #fff3e0;
}

.oddzialy-section h2 {
  color: var(--orange);
  margin-bottom: 1.5rem;
  text-align: center;
}

.oddzialy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.oddzial-card {
  background: var(--bg-white);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  border: 2px solid var(--orange);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.oddzial-card h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.oddzial-card a {
  color: var(--orange);
  font-weight: 600;
  text-decoration: none;
  font-size: 1.1rem;
}

.oddzial-card a:hover {
  text-decoration: underline;
}

/* Popup – oddzielne okienko na środku ekranu, po 10 sekundach */
.exit-popup {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s, visibility 0.3s;
}

.exit-popup-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.exit-popup-open {
  overflow: hidden;
}

.exit-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  cursor: pointer;
}

.exit-popup-content {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.2);
  transform: scale(0.95);
  transition: transform 0.25s ease-out;
}

.exit-popup-active .exit-popup-content {
  transform: scale(1);
}

/* Formularz widgetu tylko wewnątrz popupu – izolacja */
.exit-popup-content #widget-container,
.exit-popup-content .mtw-widget-container {
  min-height: 200px;
  isolation: isolate;
  position: relative;
  z-index: 1;
}

.exit-popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.06);
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0;
}

.exit-popup-close:hover {
  color: var(--text);
  background: rgba(0,0,0,0.1);
}

/* Summary */
.section-summary {
  text-align: center;
  background: linear-gradient(180deg, #e8f5e9 0%, #e3f2fd 100%);
  padding: 3rem 2rem;
}

.section-summary h2 {
  color: var(--green);
}

.section-summary p {
  color: var(--text);
}

.section-summary .btn {
  display: inline-block;
  margin-top: 1.5rem;
}

.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.section h2 {
  color: var(--green);
  margin-bottom: 1.5rem;
}

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.service-card {
  border: 2px solid #e8f5e9;
  border-radius: 8px;
  padding: 1.5rem;
}

.service-card h3 {
  color: var(--green);
  margin-bottom: 0.5rem;
}

.service-card a {
  color: var(--blue);
  font-weight: 600;
}

.links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.links-grid a {
  color: var(--blue);
  text-decoration: none;
}

.links-grid a:hover {
  text-decoration: underline;
}

/* Sticky CTA */
.cta-sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, #8bc4a8 0%, #7eb8d4 100%);
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
}

.cta-sticky-text {
  font-weight: 600;
}

.cta-sticky-phones {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.cta-sticky-phones a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.cta-sticky-phones a:hover {
  text-decoration: underline;
}

.cta-sticky .btn {
  background: var(--orange);
  color: #fff;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
}

body {
  padding-bottom: 60px;
}

.footer {
  background: var(--text);
  color: #fff;
  padding: 2rem;
  text-align: center;
}

.footer a {
  color: var(--blue-light);
}

.footer-phones {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.footer-phones a {
  color: var(--blue-light);
}

@media (max-width: 768px) {
  .nav {
    flex-direction: column;
  }
  .nav-cta {
    flex-direction: row;
    justify-content: center;
  }
  .stats-block {
    grid-template-columns: 1fr;
  }
  .section-alt {
    flex-direction: column;
    padding: 2rem 1.5rem;
  }
  .section-alt.img-left .section-img,
  .section-alt.img-right .section-img {
    order: 2;
  }
  .section-alt.img-left .section-content,
  .section-alt.img-right .section-content {
    order: 1;
  }
  .section-img {
    flex: none;
    width: 100%;
    min-width: 0;
  }
  .oddzialy-grid {
    grid-template-columns: 1fr;
  }
  .cta-sticky {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
  }
  .cta-sticky-phones {
    justify-content: center;
  }
}
