/* =====================================================================
   Centrum Medyczne DERMEX – arkusz stylów strony.
   Spokojne błękity: jasne tła jak jasne, czyste wnętrza przychodni.
   ===================================================================== */
@font-face { font-family: "Public Sans"; src: url("../fonts/publicsans.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --navy: #0E3A5B;
  --blue: #155E8F;        /* przyciski, linki */
  --blue-500: #1F8ACB;
  --logo: #1A9FDB;        /* błękit z logo */
  --sky-50: #F3F9FD;
  --sky-100: #E3F1FA;
  --sky-200: #CDE6F6;
  --aqua: #2BA6B9;
  --ink: #13283B;
  --muted: #557086;
  --line: #D7E5EF;
  --white: #fff;
  --r: 14px;
  --wrap: 1240px;
  --font: "Public Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; color: var(--ink); background: var(--white); }
img { max-width: 100%; height: auto; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }
.muted { color: var(--muted); }
h1, h2, h3 { line-height: 1.2; color: var(--navy); }

/* ---------- przyciski ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .75rem 1.3rem; border-radius: 999px; border: 2px solid transparent; font: 650 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--navy); color: #fff; }
.btn-light { background: var(--sky-100); color: var(--navy); }
.btn-light:hover { background: var(--sky-200); }
.btn-white { background: #fff; color: var(--navy); }
.btn-white:hover { background: var(--sky-100); color: var(--navy); }
.btn-outline-white { border-color: rgba(255,255,255,.7); color: #fff; }
.btn-outline-white:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ---------- pasek administratora ---------- */
.edit-bar { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; align-items: center; padding: .5rem 1.25rem; background: #FFF4D6; color: #5A4300; font-size: .92rem; border-bottom: 1px solid #F0D98A; }
.edit-bar a { color: #5A4300; font-weight: 650; }

/* ---------- górny pasek ---------- */
.topbar { background: var(--navy); color: #D5E6F2; font-size: .92rem; }
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.5rem; padding-block: .45rem; }
.topbar a { color: #fff; }
.topbar-phone { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; }
.topbar-phone svg { width: 16px; height: 16px; fill: #7FD0F0; }
.topbar-ereg { margin-left: auto; }
.topbar-ereg a { margin-left: .6rem; }

/* ---------- nagłówek ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.header-inner { display: flex; align-items: center; gap: 1.25rem; padding-block: .75rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--navy); min-width: 0; }
.brand img { flex: none; }
.brand-name { display: block; font-size: 1.3rem; font-weight: 750; line-height: 1.15; }
.brand-sub { display: block; font-size: .85rem; color: var(--muted); }
.header-search { margin-left: auto; display: flex; align-items: center; background: var(--sky-50); border: 1px solid var(--line); border-radius: 999px; padding: .15rem .25rem .15rem 1rem; width: min(340px, 100%); }
.header-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: .95rem; padding: .45rem 0; color: var(--ink); }
.header-search input:focus { outline: none; }
.header-search:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(31,138,203,.18); }
.header-search button { border: 0; background: var(--blue); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.header-search svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.header-links { display: flex; gap: .25rem; }
.header-links a { padding: .5rem .8rem; border-radius: 999px; text-decoration: none; font-weight: 650; color: var(--navy); }
.header-links a:hover { background: var(--sky-100); }
.menu-toggle { display: none; align-items: center; gap: .5rem; padding: .55rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: 650 1rem var(--font); color: var(--navy); cursor: pointer; }
.bars, .bars::before, .bars::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; content: ""; }
.bars::before { position: absolute; top: -6px; } .bars::after { position: absolute; top: 6px; }

.alert-bar { background: var(--sky-100); color: var(--navy); border-bottom: 1px solid var(--sky-200); padding: .7rem 0; font-weight: 600; }

/* ---------- układ podstron: menu boczne + treść ---------- */
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 2.5rem; padding-block: 2rem 4rem; align-items: start; }
.sidenav { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow: auto; background: var(--sky-50); border: 1px solid var(--line); border-radius: var(--r); padding: .6rem; font-size: .96rem; overscroll-behavior: contain; }
.sidenav-head { display: none; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav a, .sidenav summary { display: block; padding: .5rem .7rem; border-radius: 10px; text-decoration: none; color: var(--ink); line-height: 1.35; }
.sidenav a:hover, .sidenav summary:hover { background: var(--sky-100); }
.sidenav a[aria-current="page"] { background: var(--blue); color: #fff; font-weight: 650; }
.sidenav summary { cursor: pointer; font-weight: 650; color: var(--navy); list-style: none; position: relative; padding-right: 2rem; }
.sidenav summary::-webkit-details-marker { display: none; }
.sidenav summary::after { content: ""; position: absolute; right: .8rem; top: .9rem; width: 7px; height: 7px; border-right: 2px solid var(--blue-500); border-bottom: 2px solid var(--blue-500); transform: rotate(45deg); transition: transform .2s; }
.sidenav details[open] > summary::after { transform: rotate(-135deg); top: 1.05rem; }
.sidenav .nav-l1, .sidenav .nav-l2 { margin-left: .75rem; padding-left: .5rem; border-left: 2px solid var(--sky-200); }
.sidenav .nav-group-link { font-size: .9rem; color: var(--muted); }
.sidenav--drawer { display: none; }

.main { min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: .35rem; font-size: .9rem; color: var(--muted); margin-bottom: .75rem; }
.crumbs a { color: var(--muted); }
.main h1 { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.5rem); margin: 0 0 1.25rem; }
.notice { background: #FFF4D6; border-radius: 10px; padding: .6rem 1rem; }
.cta-box { margin-top: 2.5rem; padding: 1.4rem 1.5rem; border-radius: var(--r); background: linear-gradient(135deg, var(--sky-100), var(--sky-50)); border: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.cta-box p { margin: 0 auto 0 0; flex: 1 1 280px; }
.lead { font-size: 1.15rem; }

/* wyszukiwarka */
.search-big { display: flex; gap: .5rem; margin-bottom: 1.5rem; }
.search-big input { flex: 1; font: inherit; padding: .7rem 1rem; border-radius: 999px; border: 1px solid var(--line); }
.results { padding-left: 1.2rem; }
.results li { margin-bottom: 1.1rem; }
.results a { font-weight: 650; font-size: 1.1rem; }
.results p { margin: .2rem 0 0; color: var(--muted); }

/* ---------- strona główna ---------- */
.hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(1200px 500px at 85% 20%, rgba(127,208,240,.45), transparent 60%), linear-gradient(120deg, #0E3A5B 0%, #155E8F 55%, #1F8ACB 100%); }
.hero--img { background: linear-gradient(100deg, rgba(14,58,91,.92) 0%, rgba(21,94,143,.78) 50%, rgba(31,138,203,.35) 100%), var(--hero) center / cover no-repeat; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 2rem; padding-block: clamp(3rem, 7vw, 5.5rem) clamp(5rem, 9vw, 7rem); }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 1.5rem + 3vw, 3.6rem); margin: 0 0 1rem; max-width: 18ch; }
.hero-lead { font-size: 1.15rem; color: #E1F0FA; max-width: 56ch; margin: 0 0 1.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.hero-mark { justify-self: end; width: min(320px, 80%); opacity: .16; }
.hero-mark svg { width: 100%; fill: #fff; }

.places { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: -3.5rem; position: relative; z-index: 2; }
.place { background: #fff; border-radius: var(--r); padding: 1.2rem 1.3rem; box-shadow: 0 12px 30px rgba(14,58,91,.12); border-top: 4px solid var(--logo); }
.place h2 { font-size: 1.08rem; margin: 0 0 .3rem; }
.place-addr, .place-hours { margin: 0; color: var(--muted); font-size: .94rem; }
.place-tel { display: inline-block; margin: .4rem 0 .2rem; font-size: 1.3rem; font-weight: 750; text-decoration: none; color: var(--blue); }

.band { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.band--sky { background: var(--sky-50); margin-top: 3rem; border-block: 1px solid var(--line); }
.section-title { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem); margin: 0 0 1.5rem; }
.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; align-items: start; }
.service { background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.service summary { list-style: none; cursor: pointer; padding: 1.1rem 3rem 1.1rem 1.25rem; position: relative; display: grid; gap: .15rem; }
.service summary::-webkit-details-marker { display: none; }
.service summary::after { content: "+"; position: absolute; right: 1rem; top: 50%; translate: 0 -50%; width: 30px; height: 30px; border-radius: 50%; background: var(--sky-100); color: var(--blue); display: grid; place-items: center; font-size: 1.3rem; font-weight: 600; }
.service[open] summary::after { content: "–"; }
.service[open] { box-shadow: 0 10px 26px rgba(14,58,91,.1); }
.service-name { font-weight: 700; color: var(--navy); font-size: 1.08rem; line-height: 1.3; }
.service-count { font-size: .88rem; color: var(--muted); }
.service ul { list-style: none; margin: 0; padding: 0 1rem 1rem; }
.service a, .service ul summary { display: block; padding: .4rem .6rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .97rem; }
.service a:hover { background: var(--sky-100); color: var(--navy); }
.service ul details summary { font-weight: 650; color: var(--navy); cursor: pointer; }
.service ul ul { padding: 0 0 .25rem .75rem; border-left: 2px solid var(--sky-200); margin-left: .6rem; }
.service .nav-group-link { color: var(--muted); font-size: .9rem; }
.quick { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.quick a { padding: .5rem .95rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--navy); font-weight: 600; font-size: .95rem; }
.quick a:hover { border-color: var(--blue-500); background: var(--sky-100); }

.boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding-block: 3rem 1rem; }
.box { border-radius: var(--r); padding: 1.4rem 1.5rem; background: var(--sky-100); display: flex; flex-direction: column; }
.box--2 { background: #E3F4F6; }
.box--3 { background: #EAF0FA; }
.box h2 { margin: 0 0 .5rem; font-size: 1.25rem; }
.box div { flex: 1; color: #2D4458; }
.box-more { margin-top: .8rem; font-weight: 700; }
.home-content { padding-block: 2rem 4rem; max-width: 1000px; }

/* ---------- stopka ---------- */
.site-footer { background: var(--navy); color: #CFE2F0; padding: 2.5rem 0 1rem; font-size: .96rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.1fr 1.2fr .8fr; gap: 2rem; }
.footer-brand img { margin-bottom: .5rem; }
.footer-text { color: #CFE2F0; }
.footer-links { display: flex; flex-direction: column; gap: .4rem; }
.copyright { border-top: 1px solid rgba(255,255,255,.14); margin-top: 2rem; padding-top: 1rem; font-size: .85rem; color: #9FBCD2; }
.call-bar { display: none; }

/* formularz kontaktowy (w treści) */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field label { display: block; font-weight: 650; font-size: .95rem; margin-bottom: .25rem; }
.field input, .field textarea { width: 100%; font: inherit; padding: .65rem .8rem; border: 1px solid #B9CFDE; border-radius: 10px; background: #fff; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(31,138,203,.18); }
[aria-invalid="true"] { border-color: #C0392B !important; }
.consent { display: flex; gap: .55rem; font-size: .92rem; color: var(--muted); align-items: flex-start; }
.consent input { margin-top: .25rem; accent-color: var(--blue); }
.form-note { font-size: .9rem; color: var(--muted); margin: 0; }
.hp { position: absolute !important; left: -9999px; }
.form-msg { padding: .75rem 1rem; border-radius: 10px; font-weight: 600; margin: 0; }
.form-msg.is-ok { background: #E3F4E8; color: #1D5E33; }
.form-msg.is-error { background: #FBE5E3; color: #8A1F14; }
.contact-form .btn { justify-self: start; }

/* ---------- tablet ---------- */
@media (max-width: 1080px) {
  .header-links { display: none; }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: inline-flex; }
  .header-search { display: none; }
  .sidenav, .sidenav--drawer { display: block; position: fixed; inset: 0 auto 0 0; width: min(88vw, 380px); max-height: none; z-index: 60; border-radius: 0; border: 0; background: #fff; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); padding: 0 .75rem 2rem; top: 0; }
  .sidenav.is-open { transform: none; }
  .sidenav-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: #fff; padding: 1rem .5rem .75rem; border-bottom: 1px solid var(--line); margin-bottom: .5rem; z-index: 1; }
  .menu-close { border: 0; background: var(--sky-100); width: 40px; height: 40px; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--navy); }
  body.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(14,58,91,.45); z-index: 50; }
  .boxes { grid-template-columns: minmax(0, 1fr); }
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-mark { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .topbar-ereg { margin-left: 0; }
}

/* ---------- telefon ---------- */
@media (max-width: 640px) {
  body { font-size: 1rem; padding-bottom: 4.6rem; }
  .wrap { width: min(100% - 1.5rem, var(--wrap)); }
  .topbar-note { display: none; }
  .brand img { width: 44px; height: 44px; }
  .brand-name { font-size: 1.08rem; }
  .brand-sub { display: none; }
  .hero-actions .btn { width: 100%; }
  .places { grid-template-columns: minmax(0, 1fr); margin-top: -2.5rem; }
  .services { grid-template-columns: minmax(0, 1fr); }
  .grid-2, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .cta-box .btn { width: 100%; }
  .call-bar { display: flex; gap: .5rem; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(14,58,91,.08); }
  .call-bar .btn-primary { flex: 1; }
}

@media print {
  .topbar, .site-header, .sidenav, .call-bar, .cta-box, .edit-bar { display: none !important; }
  .layout { display: block; }
}

/* ---------- slider zdjęć w nagłówku strony głównej ---------- */
.hero--slider { background: var(--navy); }
.hero-slides { position: absolute; inset: 0; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.hero-slide.is-active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-slide.is-active img { animation: hero-zoom 9s ease-out both; }
@keyframes hero-zoom { from { transform: scale(1.06); } to { transform: scale(1); } }
.hero--slider::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(95deg, rgba(14,58,91,.93) 0%, rgba(14,58,91,.78) 38%, rgba(21,94,143,.35) 68%, rgba(21,94,143,.08) 100%); }
.hero--slider .hero-inner { position: relative; z-index: 2; min-height: clamp(440px, 46vw, 600px); }
.hero--slider .hero-lead { text-shadow: 0 1px 12px rgba(14,58,91,.5); }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 4.6rem; z-index: 3; display: flex; gap: .5rem; align-items: center; }
.hero-dots button { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: transparent; padding: 0; cursor: pointer; }
.hero-dots button[aria-current="true"] { background: #fff; }
.hero-dots .hero-pause { width: 26px; height: 26px; border-radius: 50%; margin-left: .4rem; position: relative; border-color: rgba(255,255,255,.7); }
.hero-dots .hero-pause::before, .hero-dots .hero-pause::after { content: ""; position: absolute; top: 7px; width: 3px; height: 8px; background: #fff; }
.hero-dots .hero-pause::before { left: 8px; } .hero-dots .hero-pause::after { right: 8px; }
.hero-dots .hero-pause[aria-pressed="true"]::before { left: 9px; top: 6px; width: 0; height: 0; background: none; border-left: 8px solid #fff; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.hero-dots .hero-pause[aria-pressed="true"]::after { display: none; }
@media (prefers-reduced-motion: reduce) { .hero-slide.is-active img { animation: none; } }
@media (max-width: 640px) {
  .hero--slider::after { background: linear-gradient(180deg, rgba(14,58,91,.25) 0%, rgba(14,58,91,.7) 38%, rgba(14,58,91,.93) 100%); }
  .hero--slider .hero-inner { min-height: 0; padding-top: 9rem; padding-bottom: 6.75rem; }
  .hero-dots { bottom: 3.9rem; }
}
