/* IMS Medica — style portalu (2026) */
:root {
  --teal-50: #ecfafb;
  --teal-100: #d3f3f5;
  --teal-300: #7fd6de;
  --teal-500: #1fb2c1;
  --teal-600: #1596a5;
  --teal-700: #127985;
  --navy-900: #0b2530;
  --navy-800: #12323f;
  --ink: #16303a;
  --muted: #5b6f77;
  --line: #e2eaec;
  --bg: #ffffff;
  --bg-soft: #f5f9fa;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(11, 37, 48, .06), 0 8px 24px rgba(11, 37, 48, .06);
  --max: 1160px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--teal-700); text-underline-offset: 3px; }
a:hover { color: var(--teal-600); }
h1, h2, h3, h4 { color: var(--navy-900); line-height: 1.2; margin: 0 0 .6em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.1rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.2vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--teal-300); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy-900); flex-shrink: 0; }
.brand-mark { width: 42px; height: 42px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.brand-tag { font-size: .74rem; color: var(--muted); letter-spacing: .02em; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav > ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.nav a, .nav .nav-btn {
  display: block; padding: 8px 12px; border-radius: 8px; font-size: .95rem;
  color: var(--ink); text-decoration: none; font-weight: 500; background: none; border: 0; font-family: inherit; cursor: pointer;
}
.nav a:hover, .nav .nav-btn:hover { background: var(--teal-50); color: var(--teal-700); }
.nav a[aria-current="page"], .nav .is-active > .nav-btn { color: var(--teal-700); background: var(--teal-50); }
.has-sub { position: relative; }
.nav-btn::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); opacity: .6; }
.sub {
  list-style: none; margin: 0; padding: 8px; position: absolute; top: calc(100% + 6px); left: 0; min-width: 300px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: .15s ease;
}
.has-sub:hover .sub, .has-sub:focus-within .sub, .has-sub.open .sub { opacity: 1; visibility: visible; transform: none; }
.sub a { padding: 10px 12px; }
.sub a span { display: block; font-size: .82rem; color: var(--muted); font-weight: 400; }
.lang { display: flex; gap: 2px; margin-left: 10px; padding-left: 12px; border-left: 1px solid var(--line); }
.lang a { font-size: .82rem; padding: 6px 8px; color: var(--muted); font-weight: 600; }
.lang a[aria-current="true"] { color: var(--teal-700); }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; }
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after { display: block; width: 20px; height: 2px; background: var(--navy-900); margin: 0 auto; position: relative; content: ""; transition: .2s; }
.menu-toggle span::before { position: absolute; top: -6px; }
.menu-toggle span::after { position: absolute; top: 6px; }

@media (max-width: 980px) {
  .menu-toggle { display: block; }
  .nav {
    position: fixed; inset: 72px 0 auto 0; background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 12px 24px 20px; gap: 8px;
    max-height: calc(100vh - 72px); overflow: auto; display: none; box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav > ul { flex-direction: column; align-items: stretch; }
  .nav a, .nav .nav-btn { padding: 12px; width: 100%; text-align: left; }
  .sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 12px; min-width: 0; }
  .nav-btn::after { display: none; }
  .lang { margin: 8px 0 0; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 10px;
  font-weight: 600; font-size: 1rem; text-decoration: none; border: 1px solid transparent; transition: .15s;
}
.btn-primary { background: var(--teal-600); color: #fff; }
.btn-primary:hover { background: var(--teal-700); color: #fff; }
.btn-light { background: #fff; color: var(--navy-900); }
.btn-light:hover { background: var(--teal-50); color: var(--navy-900); }
.btn-ghost { border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.btn-outline { border-color: var(--line); color: var(--navy-900); background: #fff; }
.btn-outline:hover { border-color: var(--teal-300); color: var(--teal-700); }
.btn svg { width: 18px; height: 18px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #d9eef1;
  background: radial-gradient(1200px 500px at 85% -10%, rgba(31, 178, 193, .45), transparent 60%),
              linear-gradient(160deg, var(--navy-900) 0%, #0f3a47 60%, #11505c 100%);
}
.hero .container { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; padding-top: 88px; padding-bottom: 96px; }
.hero h1 { color: #fff; }
.hero .lead { font-size: 1.2rem; color: #b8dde2; max-width: 34em; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-300); margin-bottom: 16px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-ecg { position: absolute; left: 0; right: 0; bottom: 18px; height: 60px; opacity: .22; pointer-events: none; }

/* Stylizowany podgląd przeglądarki DICOM */
.viewer {
  background: #071a22; border: 1px solid rgba(127, 214, 222, .25); border-radius: 16px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .35); overflow: hidden;
}
.viewer-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid rgba(127, 214, 222, .15); font-size: .75rem; color: #7fa9b0; }
.viewer-bar i { width: 9px; height: 9px; border-radius: 50%; background: #25444e; display: inline-block; }
.viewer-bar b { margin-left: 10px; font-weight: 500; }
.viewer-body { display: grid; grid-template-columns: 1fr 150px; }
.viewer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; }
.scan { aspect-ratio: 1; border-radius: 4px; position: relative; background: #000; overflow: hidden; }
.scan svg { width: 100%; height: 100%; }
.scan em { position: absolute; left: 6px; top: 4px; font-style: normal; font-size: .62rem; color: #9fc6cc; font-family: ui-monospace, Consolas, monospace; }
.viewer-side { border-left: 1px solid rgba(127, 214, 222, .15); padding: 12px; font-size: .72rem; color: #8fb4ba; }
.viewer-side .row { padding: 8px; border-radius: 6px; margin-bottom: 6px; background: rgba(127, 214, 222, .06); }
.viewer-side .row.on { background: rgba(31, 178, 193, .25); color: #e2f6f8; }
.viewer-side strong { display: block; color: #d6eff2; font-weight: 600; font-size: .75rem; }

/* ---------- Page header (podstrony) ---------- */
.page-head {
  background: linear-gradient(160deg, var(--navy-900) 0%, #10404c 100%); color: #b8dde2;
  padding: 64px 0 56px; position: relative; overflow: hidden;
}
.page-head h1 { color: #fff; margin-bottom: .3em; }
.page-head .lead { font-size: 1.15rem; max-width: 46em; margin: 0; }
.crumbs { font-size: .85rem; margin-bottom: 18px; color: #7fb3bb; }
.crumbs a { color: #a9d6dc; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; color: #fff; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section.soft { background: var(--bg-soft); }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }
.section-head .eyebrow { color: var(--teal-600); }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  transition: .2s; display: flex; flex-direction: column;
}
a.card { text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--teal-300); box-shadow: var(--shadow); transform: translateY(-2px); }
.card p { color: var(--muted); margin-bottom: 0; }
.card .more { margin-top: auto; padding-top: 18px; font-weight: 600; color: var(--teal-700); font-size: .95rem; }
.card .tag { display: inline-block; align-self: flex-start; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--teal-700); background: var(--teal-50); padding: 4px 8px; border-radius: 6px; margin-bottom: 14px; }
.icon { width: 48px; height: 48px; border-radius: 12px; background: var(--teal-50); color: var(--teal-700); display: grid; place-items: center; margin-bottom: 18px; flex-shrink: 0; }
.icon svg { width: 24px; height: 24px; }

.feature { display: flex; gap: 18px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.feature .icon { margin: 0; }
.feature h3 { font-size: 1.08rem; margin-bottom: .35em; }
.feature p { color: var(--muted); margin: 0; font-size: .98rem; }

.checklist { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 40px; }
.checklist li { break-inside: avoid; padding: 8px 0 8px 32px; position: relative; border-bottom: 1px solid var(--line); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 13px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--teal-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23127985' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 10.5l3.2 3L15 7'/%3E%3C/svg%3E") center/14px no-repeat;
}

.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 56px; align-items: start; }
.prose { max-width: 720px; }
.prose p { color: #33474f; }
.prose ul { margin: 0 0 1.2em; }
.prose li { margin-bottom: .4em; }

.aside {
  position: sticky; top: 96px; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
}
.aside h3 { margin-bottom: .5em; }
.aside p { color: var(--muted); font-size: .98rem; }
.aside .btn { width: 100%; justify-content: center; margin-top: 8px; }
.aside ul { list-style: none; padding: 0; margin: 18px 0 0; border-top: 1px solid var(--line); }
.aside li a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 500; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 48px; }
.stat { border-left: 3px solid var(--teal-500); padding: 4px 0 4px 18px; }
.stat strong { display: block; font-size: 1.9rem; color: var(--navy-900); line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .95rem; }

.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { position: relative; padding: 28px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.step::before { counter-increment: step; content: counter(step, decimal-leading-zero); display: block; font-weight: 700; color: var(--teal-600); font-size: .9rem; letter-spacing: .08em; margin-bottom: 12px; }
.step h3 { font-size: 1.08rem; }
.step p { color: var(--muted); margin: 0; }

/* ---------- CTA band ---------- */
.cta {
  background: linear-gradient(120deg, var(--teal-700), var(--teal-500)); color: #e8fbfd; border-radius: 20px;
  padding: 48px; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.cta h2 { color: #fff; margin-bottom: .3em; }
.cta p { margin: 0; max-width: 40em; }
.cta .actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.contact-card { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.contact-card h3 { font-size: 1rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
.contact-card p { font-size: 1.1rem; margin: 0; }
.contact-card a { text-decoration: none; font-weight: 600; }
.contact-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.contact-card dt { color: var(--muted); }
.contact-card dd { margin: 0; font-weight: 600; }

.empty { text-align: center; padding: 56px 24px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--bg-soft); }
.empty .icon { margin: 0 auto 18px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #93b3ba; padding: 64px 0 28px; font-size: .95rem; margin-top: 0; }
.site-footer a { color: #cfe6ea; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
.site-footer h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 16px; font-weight: 700; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer .brand { color: #fff; margin-bottom: 16px; }
.site-footer .brand-tag { color: #7fa9b0; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 48px; padding-top: 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero .container, .split { grid-template-columns: 1fr; }
  .hero .container { padding-top: 56px; padding-bottom: 72px; gap: 40px; }
  .grid-3, .grid-4, .steps, .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .aside { position: static; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .section { padding: 60px 0; }
  .grid-2, .grid-3, .grid-4, .steps, .contact-grid, .footer-grid { grid-template-columns: 1fr; }
  .checklist { columns: 1; }
  .viewer-body { grid-template-columns: 1fr; }
  .viewer-side { display: none; }
  .cta { padding: 32px 24px; }
  .brand-tag { display: none; }
  .feature { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Kafelki funkcji w układzie z panelem bocznym: ikona nad tekstem */
.split .feature { flex-direction: column; gap: 14px; }
