/* =========================================================
   Energia Dla Polaków — style strony
   ========================================================= */

:root{
  --navy:      #02004A;
  --navy-2:    #0A0A46;
  --black:     #0a0a0f;
  --red:       #E4002B;
  --red-dark:  #B5001F;
  --white:     #ffffff;
  --off-white: #F4F5F8;
  --gray-100:  #E7E9EF;
  --gray-400:  #8A90A3;
  --gray-700:  #454B5E;
  --text:      #171A2B;

  --font-head: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  --radius: 14px;
  --shadow: 0 10px 30px rgba(2, 0, 74, 0.08);
  --shadow-lg: 0 20px 50px rgba(2, 0, 74, 0.14);
  --container-w: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy); margin: 0 0 .5em; line-height: 1.2; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
fieldset { border: none; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }

.container{
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}
.container.narrow{ max-width: 820px; }

.skip-link{
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: var(--white); padding: 12px 20px; z-index: 1000;
}
.skip-link:focus{ left: 12px; top: 12px; }

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 15px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.97rem;
  border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn-primary{ background: var(--red); color: var(--white); }
.btn-primary:hover{ background: var(--red-dark); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost{ background: transparent; border-color: rgba(2,0,74,0.25); color: var(--navy); }
.btn-ghost:hover{ background: rgba(2,0,74,0.06); border-color: rgba(2,0,74,0.4); }
.btn-sm{ padding: 10px 20px; font-size: 0.88rem; }
.btn-block{ width: 100%; }

/* ---------- Header ---------- */
.site-header{
  position: sticky; top: 0; z-index: 500;
  border-bottom: 1px solid var(--gray-100);
  box-shadow: 0 2px 16px rgba(2,0,74,0.06);
  /* Note: backdrop-filter lives on ::before (not on this element) so it
     doesn't create a containing block for the fixed-position mobile nav. */
}
.site-header::before{
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(8px);
}
.header-inner{
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
  gap: 20px;
}
.brand-logo{ height: 40px; width: auto; border-radius: 4px; }
.main-nav ul{ display: flex; align-items: center; gap: 28px; }
.main-nav a{
  color: var(--navy); font-weight: 500; font-size: 0.95rem;
  opacity: 0.82; padding: 6px 0; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.main-nav a:hover{ opacity: 1; color: var(--red); border-color: var(--red); }
/* Only this item is allowed to wrap onto a second line; constraining its
   width forces the break after "Spółdzielnie" instead of leaving it to
   chance at odd viewport widths (which used to knock the whole bar out of
   line). align-items: center on the <ul> above keeps every item — one line
   or two — centred on the same row as the logo and the CTA button. */
.main-nav a.nav-link-wrap{
  display: inline-block;
  white-space: normal;
  max-width: 132px;
  line-height: 1.25;
}

.header-actions{ display: flex; align-items: center; gap: 16px; }
.header-phone{ color: var(--navy); font-weight: 600; font-size: 0.92rem; opacity: 0.85; }
.header-phone:hover{ color: var(--red); opacity: 1; }

.nav-toggle{
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; background: none; border: none; padding: 0;
}
.nav-toggle span{ height: 2px; width: 100%; background: var(--navy); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero{
  position: relative;
  color: var(--navy);
  background:
    radial-gradient(1100px 550px at 12% -10%, rgba(2,0,74,0.07) 0%, transparent 60%),
    linear-gradient(180deg, #FFFFFF 0%, #EEF0F8 100%);
  overflow: hidden;
}
.hero-bg{
  position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, transparent 0 120px, rgba(228,0,43,0.08) 120px 122px);
  pointer-events: none;
}
.hero-inner{
  position: relative;
  padding: 100px 24px 90px;
}
.hero-inner > *{ max-width: 820px; }
.eyebrow{
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--red-dark);
  margin-bottom: 18px;
}
.hero h1{
  color: var(--navy);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  margin-bottom: 22px;
}
.hero-lead{
  font-size: 1.1rem;
  color: var(--gray-700);
  max-width: 640px;
  margin-bottom: 34px;
}
.hero-cta{ display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 40px; }
.hero-tags{ display: flex; flex-wrap: wrap; gap: 10px; }
.hero-tags li{
  border: 1px solid rgba(2,0,74,0.18);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--gray-700);
}

/* ---------- Why us ---------- */
.why-us{ background: var(--navy); color: var(--white); padding: 56px 0; }
.why-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.why-item h3{ color: var(--white); font-size: 1.05rem; }
.why-item p{ color: rgba(255,255,255,0.7); font-size: 0.92rem; margin-bottom: 0; }
.why-icon{
  width: 46px; height: 46px; margin-bottom: 16px;
  background: rgba(228,0,43,0.16);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.why-icon svg{ width: 24px; height: 24px; fill: none; stroke: var(--red); stroke-width: 1.8; }

/* ---------- Sections (generic) ---------- */
.section{ padding: 96px 0; }
.section.alt{ background: var(--off-white); }
.section-eyebrow{
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 10px;
}
.section h2{ font-size: clamp(1.6rem, 3vw, 2.2rem); max-width: 720px; }
.section-lead{ color: var(--gray-700); max-width: 680px; font-size: 1.05rem; }
.section-cta{ margin-top: 40px; }

.badge-row{ display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.badge-row li{
  background: var(--off-white);
  border: 1px solid var(--gray-100);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}

/* ---------- Cards / grids ---------- */
.card-grid{
  display: grid;
  gap: 24px;
  margin-top: 44px;
}
.card-grid-6{ grid-template-columns: repeat(3, 1fr); }
.card-grid-4{ grid-template-columns: repeat(4, 1fr); }
.card-grid-3{ grid-template-columns: repeat(3, 1fr); }

.card{
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover{ transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card h3{ font-size: 1.08rem; }
.card p{ color: var(--gray-700); font-size: 0.94rem; margin-bottom: 0; }
.card-icon{
  width: 44px; height: 44px; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--navy), #24246e);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.card-icon svg{ width: 22px; height: 22px; fill: none; stroke: var(--white); stroke-width: 1.6; }

.card-plain{ background: var(--white); }
.card-logo{
  height: 34px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}
.card-logo img{ max-height: 100%; max-width: 140px; object-fit: contain; object-position: left center; }
.card-tag{
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--red);
  background: rgba(228,0,43,0.08);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.card-link{ display: inline-block; margin-top: 10px; font-weight: 600; color: var(--red); }
.card-link:hover{ text-decoration: underline; }

.fine-print{ margin-top: 28px; font-size: 0.85rem; color: var(--gray-400); max-width: 680px; }

/* ---------- Partners ---------- */
.partner-grid{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-top: 44px;
}
.partner-logo{
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 22px;
  display: flex; align-items: center; justify-content: center;
  height: 100px;
}
.partner-logo img{
  max-height: 52px; max-width: 100%;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.75;
  transition: filter .18s ease, opacity .18s ease;
}
.partner-logo:hover img{ filter: grayscale(0); opacity: 1; }
.partner-text{
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--gray-400);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.partner-text:hover{ color: var(--navy); }

/* ---------- Kontakt ---------- */
.kontakt{ background: var(--off-white); }
.kontakt-grid{
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  margin-top: 44px;
  align-items: start;
}
.kontakt-form{
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  padding: 36px;
}
.form-row{ margin-bottom: 22px; }
.form-row-split{ display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-row label, .form-row legend{
  display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 8px; color: var(--navy);
  padding: 0;
}
.kontakt-form input[type="text"],
.kontakt-form input[type="tel"],
.kontakt-form input[type="email"],
.kontakt-form textarea{
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--gray-100);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--off-white);
}
.kontakt-form input:focus,
.kontakt-form textarea:focus{
  outline: none;
  border-color: var(--red);
  background: var(--white);
}
.hp-field{ position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.checkbox-groups{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.checkbox-group-title{ font-weight: 700; font-size: 0.82rem; color: var(--gray-700); margin-bottom: 8px; }
.checkbox-group label{
  display: flex; align-items: center; gap: 8px;
  font-weight: 400; font-size: 0.88rem; color: var(--text);
  margin-bottom: 8px;
}
.checkbox-group input{ width: 16px; height: 16px; accent-color: var(--red); }

.consent-row{ font-size: 0.85rem; }
.consent-label{ display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--gray-700); }
.consent-label input{ margin-top: 3px; width: 16px; height: 16px; accent-color: var(--red); flex-shrink: 0; }

.form-status{ margin-top: 14px; font-weight: 600; font-size: 0.9rem; min-height: 1.4em; }
.form-status.ok{ color: #17803D; }
.form-status.err{ color: var(--red-dark); }

.kontakt-info{ display: flex; flex-direction: column; gap: 20px; }
.info-card{
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 28px;
}
.info-card h3{ font-size: 1rem; margin-bottom: 14px; }
.info-card p{ font-size: 0.95rem; color: var(--gray-700); }
.info-card a:hover{ color: var(--red); }
.info-card-legal{ display: flex; flex-direction: column; gap: 12px; }
.legal-logo{ height: 26px; width: auto; max-width: 150px; object-fit: contain; object-position: left center; align-self: flex-start; }
.legal-name{ font-size: 0.85rem; color: var(--navy); font-weight: 600; margin: 0; }
.legal-ids{ display: flex; flex-direction: column; gap: 4px; margin: 0; }
.legal-ids span{ font-size: 0.8rem; color: var(--gray-400); }

/* ---------- Footer ---------- */
.site-footer{ background: var(--black); color: rgba(255,255,255,0.75); padding: 64px 0 0; }
.footer-inner{
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-logo{ height: 130px; width: auto; margin-bottom: 18px; border-radius: 6px; }
.footer-brand p{ color: rgba(255,255,255,0.55); font-size: 0.9rem; max-width: 260px; }
.footer-nav{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-nav-title{ color: var(--white); font-weight: 700; font-size: 0.85rem; margin-bottom: 14px; }
.footer-nav a{ display: block; font-size: 0.9rem; color: rgba(255,255,255,0.6); margin-bottom: 10px; }
.footer-nav a:hover{ color: var(--white); }
.footer-legal{
  padding: 22px 24px 30px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  display: flex; flex-direction: column; gap: 6px;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px){
  .card-grid-6{ grid-template-columns: repeat(2, 1fr); }
  .card-grid-4{ grid-template-columns: repeat(2, 1fr); }
  .why-grid{ grid-template-columns: repeat(2, 1fr); gap: 36px; }
  .partner-grid{ grid-template-columns: repeat(3, 1fr); }
  .kontakt-grid{ grid-template-columns: 1fr; }
  .checkbox-groups{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1200px){
  .main-nav{
    position: fixed; inset: 76px 0 0 0;
    background: var(--white);
    padding: 24px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }
  .main-nav.open{ opacity: 1; transform: translateY(0); pointer-events: auto; }
  .main-nav ul{ flex-direction: column; align-items: stretch; gap: 4px; }
  .main-nav a{ display: block; padding: 14px 4px; border-bottom: 1px solid var(--gray-100); white-space: normal; }
  .main-nav a.nav-link-wrap{ display: block; max-width: none; line-height: inherit; }
  .nav-toggle{ display: flex; }
  .header-phone{ display: none; }
}

@media (max-width: 640px){
  .section{ padding: 64px 0; }
  .hero-inner{ padding: 70px 24px 60px; }
  .card-grid-6, .card-grid-4, .card-grid-3{ grid-template-columns: 1fr; }
  .why-grid{ grid-template-columns: 1fr; }
  .partner-grid{ grid-template-columns: repeat(2, 1fr); }
  .form-row-split{ grid-template-columns: 1fr; }
  .checkbox-groups{ grid-template-columns: 1fr; }
  .footer-inner{ grid-template-columns: 1fr; }
  .footer-nav{ grid-template-columns: repeat(2, 1fr); }
  .hero-cta .btn{ width: 100%; }
}
