/* =========================================================
   Aqua-Serwis Sławomir Mordzon — wizytówka
   Design system + layout. Vanilla CSS, no build step.
   ========================================================= */

:root {
  /* Palette */
  --navy:        #0F2C4C;
  --navy-700:    #123963;
  --navy-900:    #0A2038;
  --green:       #078A7E;   /* Vaillant-green homage — decorative fills only */
  --green-text:  #0A6E64;   /* darker green for text/links (WCAG AA on white & alt) */
  --green-600:   #0FA595;
  --green-050:   #E9F5F3;
  --cta:         #B85C10;   /* warm copper — heating; AA contrast (white-on-fill 4.6:1) */
  --cta-600:     #9E4E0D;
  --ink:         #14202B;
  --muted:       #56636F;
  --white:       #FFFFFF;
  --surface:     #FFFFFF;
  --surface-alt: #F3F6F8;
  --surface-tint:#EAF3F1;
  --border:      #E2E8ED;
  --border-str:  #CBD6DE;

  --shadow-sm: 0 1px 2px rgba(15,44,76,.06), 0 1px 3px rgba(15,44,76,.05);
  --shadow-md: 0 6px 18px rgba(15,44,76,.08), 0 2px 6px rgba(15,44,76,.06);
  --shadow-lg: 0 18px 48px rgba(15,44,76,.14), 0 6px 16px rgba(15,44,76,.08);

  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --maxw: 1160px;
  --gutter: clamp(16px, 4vw, 40px);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--green-text); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.15; color: var(--navy); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.05rem, 4.6vw, 3.35rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1rem; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 820px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--green-text);
  margin: 0 0 .7rem;
}

.hl { color: var(--green-text); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

.ico { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  --pad-y: .72rem; --pad-x: 1.25rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font: inherit; font-weight: 700; line-height: 1.1;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--cta); color: #fff; box-shadow: 0 8px 20px rgba(184,92,16,.28); }
.btn-primary:hover { background: var(--cta-600); box-shadow: 0 10px 26px rgba(184,92,16,.34); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--border-str); }
.btn-outline:hover { border-color: var(--navy); background: var(--white); }
.btn-lg { --pad-y: .95rem; --pad-x: 1.6rem; font-size: 1.02rem; }
.btn-sm { --pad-y: .5rem; --pad-x: 1rem; font-size: .92rem; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.2rem; height: 72px; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--navy); }
.brand:hover { text-decoration: none; }
.brand-mark svg { width: 40px; height: 40px; border-radius: 11px; box-shadow: var(--shadow-sm); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; color: var(--navy); }
.brand-sub { font-size: .72rem; color: var(--green-text); font-weight: 600; letter-spacing: .01em; }

.main-nav { display: flex; gap: 1.4rem; margin-left: auto; }
.main-nav a { color: var(--navy); font-weight: 600; font-size: .98rem; padding: .3rem 0; position: relative; }
.main-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px; background: var(--green); transition: right .2s ease; }
.main-nav a:hover { text-decoration: none; }
.main-nav a:hover::after { right: 0; }

.header-actions { display: flex; align-items: center; gap: .8rem; margin-left: 1.2rem; }
.phone-link { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; color: var(--navy); }
.phone-link:hover { color: var(--green-text); text-decoration: none; }
.phone-link .ico { color: var(--green); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px; border: 1px solid var(--border); background: #fff; border-radius: 10px; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle span { width: 22px; height: 2px; background: var(--navy); border-radius: 2px; transition: .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(760px 420px at 6% 8%, rgba(15,44,76,.06), transparent 55%),
    linear-gradient(180deg, #FBFDFE 0%, var(--surface) 70%);
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
}
/* Centered max-width stage keeps the photo aligned to the content edge —
   on wide screens it stops tracking the viewport's right edge. */
.hero-stage {
  position: absolute; inset: 0;
  width: 100%; max-width: var(--maxw);
  margin-inline: auto;
  z-index: 0;
  pointer-events: none;
}
/* Product photo, right side, vertical full-bleed, feathered into the page on its left edge */
.hero-media {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(60%, 700px);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24%);
          mask-image: linear-gradient(to right, transparent 0, #000 24%);
}
.hero-media picture { display: block; width: 100%; height: 100%; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 82% 50%; }

.hero-grid { position: relative; z-index: 1; }
.hero-copy { max-width: min(520px, 100%); }
.hero h1 { margin-bottom: .6rem; }
.lead { font-size: clamp(1.05rem, 1.7vw, 1.22rem); color: var(--muted); max-width: 42ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 1.3rem; }
.hero-chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; padding: 0; margin: 0; }
.hero-chips li { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .93rem; color: var(--navy); }
.hero-chips .ico { color: var(--green); }

/* ---------- Trust bar ---------- */
.trust-bar { background: var(--navy); color: #fff; }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 1.7rem 0; }
.trust-item {
  display: flex; align-items: center; justify-content: center; gap: .85rem;
  padding: .3rem 1rem; border-left: 1px solid rgba(255,255,255,.12);
}
.trust-item:first-child { border-left: none; }
.trust-ico { flex: none; width: 46px; height: 46px; display: grid; place-items: center; color: var(--green-600); }
.trust-ico svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.trust-text { display: flex; flex-direction: column; line-height: 1.15; }
.trust-num { display: block; font-size: 1.5rem; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.trust-lbl { display: block; font-size: .86rem; color: rgba(255,255,255,.75); margin-top: .15rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-alt { background: var(--surface-alt); }
.section-head { max-width: 720px; margin: 0 auto clamp(1.8rem, 4vw, 2.8rem); text-align: center; }
.section-lead { color: var(--muted); font-size: 1.08rem; margin: 0; }
.section-foot { text-align: center; color: var(--muted); margin-top: 2rem; }
.section-foot a { font-weight: 700; }

/* ---------- Service cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.35rem; box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-str); }
.card-ico {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--green-050); color: var(--green); margin-bottom: 1rem;
}
.card-ico svg { width: 28px; height: 28px; }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--muted); font-size: .96rem; margin-bottom: 1rem; flex: 1; }
.card-accent { background: linear-gradient(165deg, #fff, var(--green-050)); border-color: #CDE7E3; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0; }
.chips li {
  font-size: .78rem; font-weight: 600; color: var(--navy);
  background: var(--surface-alt); border: 1px solid var(--border);
  padding: .28rem .6rem; border-radius: 999px;
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: clamp(1.6rem, 4vw, 3.4rem); align-items: center; }
.feature-list { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: 1rem; }
.feature-list li { display: flex; gap: .85rem; align-items: flex-start; }
.feat-ico { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--green-050); color: var(--green); display: grid; place-items: center; }
.feat-ico svg { width: 18px; height: 18px; fill: currentColor; }
.feature-list strong { display: block; color: var(--navy); font-size: 1rem; }
.feature-list span { color: var(--muted); font-size: .93rem; }

.about-side { display: grid; gap: 1rem; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--green);
}
.stat-num { display: block; font-size: 1.7rem; font-weight: 800; color: var(--navy); line-height: 1.1; letter-spacing: -.02em; }
.stat-lbl { display: block; color: var(--muted); font-size: .92rem; margin-top: .25rem; }

/* ---------- Badges (certyfikaty) ---------- */
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.badge {
  text-align: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.6rem 1.2rem; box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .2s ease;
}
.badge:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.badge-ico { width: 56px; height: 56px; margin: 0 auto .9rem; border-radius: 50%; background: var(--surface-tint); color: var(--navy); display: grid; place-items: center; }
.badge-ico svg { width: 30px; height: 30px; }
.badge strong { display: block; color: var(--navy); font-size: 1.02rem; margin-bottom: .35rem; }
.badge span { color: var(--muted); font-size: .9rem; }

/* ---------- Area ---------- */
.area-grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: clamp(1.6rem, 4vw, 3rem); align-items: center; }
.area-list { list-style: none; padding: 0; margin: 1.2rem 0 0; display: flex; flex-wrap: wrap; gap: .55rem; }
.area-list li {
  font-weight: 600; font-size: .92rem; color: var(--navy);
  background: var(--surface); border: 1px solid var(--border);
  padding: .4rem .8rem; border-radius: 999px;
}
.area-card {
  background: var(--navy); color: #fff; border-radius: var(--radius-lg);
  padding: 1.8rem; box-shadow: var(--shadow-lg);
}
.area-card h3 { color: #fff; margin-bottom: .8rem; }
.area-card address { font-style: normal; line-height: 1.7; margin-bottom: 1.3rem; color: rgba(255,255,255,.9); }
.area-card address strong { color: #fff; }
.area-card .btn-outline { color: #fff; border-color: rgba(255,255,255,.35); }
.area-card .btn-outline:hover { background: rgba(255,255,255,.1); border-color: #fff; }

/* ---------- Process steps ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; counter-reset: step; }
.step { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem 1.35rem; box-shadow: var(--shadow-sm); }
.step-num {
  width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; margin-bottom: .9rem;
}
.step h3 { margin-bottom: .35rem; }
.step p { color: var(--muted); font-size: .94rem; margin: 0; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: .7rem; }
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 1.2rem; box-shadow: var(--shadow-sm); overflow: hidden;
}
.faq summary {
  list-style: none; cursor: pointer; font-weight: 700; color: var(--navy);
  padding: 1.05rem 2rem 1.05rem 0; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 400; color: var(--green-text); transition: transform .2s ease;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 0 0 1.1rem; }

/* ---------- Contact ---------- */
.section-contact { background: linear-gradient(180deg, var(--surface-alt), #fff); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(1.6rem, 4vw, 3.2rem); align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 1.1rem; }
.contact-list li { display: flex; align-items: center; gap: .9rem; }
.ci-ico { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--green-050); color: var(--green); display: grid; place-items: center; }
.ci-ico svg { width: 24px; height: 24px; fill: currentColor; }
.ci-lbl { display: block; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.ci-val { display: block; font-size: 1.12rem; font-weight: 700; color: var(--navy); }
a.ci-val:hover { color: var(--green-text); }

.contact-form-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: clamp(1.4rem, 3vw, 2rem); }
.contact-form h3 { margin-bottom: .4rem; }
.form-hint { font-size: .84rem; color: var(--muted); margin: 0 0 1.1rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .92rem; color: var(--navy); margin-bottom: .35rem; }
.field .opt { color: var(--muted); font-weight: 400; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: .75rem .9rem; border: 1.5px solid var(--border-str); border-radius: 10px;
  background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(7,138,126,.15); }
.field textarea { resize: vertical; }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .86rem; color: var(--muted); margin: .3rem 0 1.1rem; }
.consent input { margin-top: .25rem; flex: none; width: 18px; height: 18px; accent-color: var(--green); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-note { font-size: .92rem; margin: .8rem 0 0; min-height: 1.2em; }
.form-note.ok { color: var(--green-text); font-weight: 600; }
.form-note.err { color: #C0392B; font-weight: 600; }

/* Inline per-field validation (populated by JS on invalid submit) */
.req { color: #C0392B; }
.field-err { display: block; color: #C0392B; font-size: .84rem; font-weight: 600; margin-top: .3rem; min-height: 0; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #C0392B; }
.field input[aria-invalid="true"]:focus, .field textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(192,57,43,.15); }
.consent.invalid { color: #C0392B; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: rgba(255,255,255,.8); padding: clamp(2.5rem, 5vw, 3.5rem) 0 1.6rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.footer-brand .brand-name { color: #fff; font-size: 1.4rem; font-weight: 800; }
.footer-brand p { margin-top: .7rem; font-size: .94rem; max-width: 34ch; }
.footer-col h4 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .8rem; }
.footer-col p, .footer-legal { font-size: .94rem; line-height: 1.8; margin: 0; }
.footer-col a { color: rgba(255,255,255,.85); }
.footer-col a:hover { color: #fff; }
.footer-nav { display: flex; flex-direction: column; gap: .5rem; }
.footer-bottom { margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-direction: column; gap: .5rem; }
.footer-bottom p { margin: 0; font-size: .84rem; color: rgba(255,255,255,.6); }
.disclaimer { max-width: 78ch; }

/* ---------- Floating mobile call bar ---------- */
.call-bar {
  display: none;
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 90;
  background: var(--cta); color: #fff; font-weight: 800;
  align-items: center; justify-content: center; gap: .5rem;
  padding: .95rem; border-radius: 14px; box-shadow: 0 10px 30px rgba(184,92,16,.4);
}
.call-bar:hover { text-decoration: none; }
.call-bar .ico { fill: #fff; }

/* =========================================================
   Reveal-on-scroll (progressive enhancement; JS adds .in-view)
   ========================================================= */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.js .reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px) {
  .hero { padding-top: 0; }
  .hero-stage { position: static; max-width: none; margin: 0; }
  .hero-media {
    position: static;
    width: 100%;
    height: clamp(220px, 48vw, 340px);
    margin-bottom: clamp(1.3rem, 4vw, 2rem);
    -webkit-mask-image: linear-gradient(to bottom, #000 66%, transparent 100%);
            mask-image: linear-gradient(to bottom, #000 66%, transparent 100%);
  }
  .hero-media img { object-position: 60% 40%; }
  .hero-copy { max-width: none; }
  .cards, .badges, .steps { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .area-grid, .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
  .trust-item:nth-child(3) { border-left: none; }
  .trust-item { border-left: 1px solid rgba(255,255,255,.12); }
  .trust-item:nth-child(odd) { border-left: none; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .main-nav {
    position: fixed; inset: 72px 0 auto 0;
    background: #fff; border-bottom: 1px solid var(--border);
    flex-direction: column; gap: 0; padding: .5rem var(--gutter) 1rem;
    box-shadow: var(--shadow-md);
    transform: translateY(-120%); transition: transform .25s ease; visibility: hidden;
  }
  .main-nav.open { transform: translateY(0); visibility: visible; }
  .main-nav a { padding: .85rem 0; border-bottom: 1px solid var(--border); width: 100%; }
  .main-nav a::after { display: none; }
  .nav-toggle { display: flex; }
  .phone-link { display: none; }
  .header-actions { margin-left: auto; gap: .5rem; }

  .cards, .badges, .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .hero-cta .btn { width: 100%; }
  .call-bar { display: flex; }
  body { padding-bottom: 76px; }  /* room for call bar */
}

@media (max-width: 420px) {
  .trust-grid { grid-template-columns: 1fr 1fr; }
}
