/* eKomunikator – część www. © 2026 Roman Bojara */
:root {
  --primary: #1d4ed8; --primary-d: #1e40af; --primary-l: #dbeafe;
  --text: #0f172a; --muted: #64748b; --bg: #f1f5f9; --card: #fff; --border: #e2e8f0;
  --ok: #15803d; --ok-l: #dcfce7; --err: #b91c1c; --err-l: #fee2e2; --warn: #b45309; --warn-l: #fef3c7;
  --radius: 10px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.04);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--primary); }
a:hover { color: var(--primary-d); }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; margin: 1.2rem 0 .6rem; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; }

/* Nagłówek i stopka */
header.site { background: #0f172a; color: #fff; }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand strong { display: block; font-size: 1.1rem; }
.brand small { display: block; color: #cbd5e1; font-size: .8rem; }
.logo { width: 34px; height: 34px; border-radius: 8px; background: var(--primary) url("favicon.png") center/contain no-repeat; flex: none; }
.topnav { display: flex; align-items: center; gap: 16px; }
.topnav a, .topnav .who { color: #e2e8f0; text-decoration: none; font-size: .95rem; }
.topnav .who { color: #94a3b8; }
footer.site { color: var(--muted); font-size: .85rem; padding: 28px 0 40px; }
footer.site .wrap { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
footer.site .wrap > span:empty { display: none; }
main.wrap { padding-top: 28px; padding-bottom: 12px; }

/* Karty */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 28px; margin-bottom: 18px; }
.card.narrow { max-width: 560px; margin: 40px auto; }
.card.empty { text-align: center; color: var(--muted); }

/* Przyciski i formularze */
.btn { display: inline-block; font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; color: var(--text); cursor: pointer; text-decoration: none; }
.btn:hover { background: #f8fafc; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.big { padding: 14px 26px; font-size: 1.05rem; margin: 10px 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #93c5fd; outline-offset: 1px; }
button.link { background: none; border: 0; color: #e2e8f0; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
form.inline { display: inline; }
.stack { display: grid; gap: 14px; margin-top: 14px; }
.stack label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=url], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: var(--text);
}
textarea { resize: vertical; min-height: 110px; }
.alert { padding: 12px 16px; border-radius: 8px; margin: 0 0 16px; font-weight: 500; }
.alert-error { background: var(--err-l); color: var(--err); border: 1px solid #fecaca; }
.alert-ok { background: var(--ok-l); color: var(--ok); }

/* Lista komunikatów */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar h1 { margin: 0; }
.search { display: flex; gap: 8px; flex-wrap: wrap; }
.search input { width: 260px; } .search select { width: auto; }
.post h2 { margin: .3rem 0 .4rem; font-size: 1.3rem; }
.post h2 a { color: var(--text); text-decoration: none; }
.post h2 a:hover { color: var(--primary); }
.post.important { border-left: 4px solid var(--err); }
.post .more { font-weight: 600; text-decoration: none; }
.post.full h1 { margin-top: .4rem; }
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: .875rem; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--primary-l); color: var(--primary-d); font-size: .78rem; font-weight: 600; }
.badge.imp { background: var(--err-l); color: var(--err); } .badge.pin { background: var(--warn-l); color: var(--warn); } .badge.file { background: #ede9fe; color: #6d28d9; }
.content ul { padding-left: 1.3rem; } .content p { margin: 0 0 .9rem; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 20px 0; }
.pager a, .pager .cur { padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border); background: #fff; text-decoration: none; }
.pager .cur { background: var(--primary); color: #fff; border-color: var(--primary); }
.back a { text-decoration: none; font-weight: 600; }
.files ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.file-link { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); background: #f8fafc; }
.file-link:hover { border-color: var(--primary); background: #eff6ff; }
.file-link .ext { flex: none; min-width: 46px; text-align: center; font-size: .72rem; font-weight: 700; color: #fff; background: var(--primary); border-radius: 4px; padding: 3px 6px; }
.file-link .fname { flex: 1; word-break: break-word; } .file-link .fsize { color: var(--muted); font-size: .85rem; }

/* Ankiety */
.survey-head .org { margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; font-weight: 600; }
.survey-head .deadline { color: var(--warn); }
.secure-note { margin: 14px 0 0; padding: 10px 14px; background: var(--ok-l); color: var(--ok); border-radius: 8px; font-size: .9rem; }
.survey .field { padding: 16px 0; border-bottom: 1px solid #f1f5f9; }
.survey .field:last-of-type { border-bottom: 0; }
.survey .q { display: block; font-weight: 600; margin-bottom: 8px; }
.survey .num { color: var(--primary); margin-right: 2px; }
.survey .req { color: var(--err); }
.survey .help { color: var(--muted); font-size: .88rem; margin: -4px 0 8px; }
.survey .has-error input, .survey .has-error select, .survey .has-error textarea { border-color: var(--err); background: #fffafa; }
.survey .err { color: var(--err); font-size: .9rem; font-weight: 600; margin-top: 6px; }
.survey h2.section { margin-top: 1.6rem; padding-bottom: 6px; border-bottom: 2px solid var(--primary-l); }
.survey .note { background: #f8fafc; border-left: 3px solid var(--primary); padding: 10px 14px; border-radius: 4px; margin: 10px 0; }
.choices { display: grid; gap: 6px; }
.choices.inline { display: flex; gap: 20px; }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.choice:hover { border-color: #93c5fd; background: #f8fbff; }
.choice input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.other-text { margin-top: 4px; }
.other-text[hidden] { display: none; }
.scale { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.scale .end { color: var(--muted); font-size: .85rem; padding: 0 6px; }
.scale .pt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale .pt span { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid #cbd5e1; border-radius: 8px; cursor: pointer; font-weight: 600; background: #fff; }
.scale .pt input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); }
.scale .pt input:focus-visible + span { outline: 3px solid #93c5fd; }
.addr { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.addr .sub { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.addr .sub.w2 { grid-column: span 2; }
.gdpr { margin-top: 22px; padding: 18px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; }
.gdpr h2 { margin-top: 0; font-size: 1.05rem; }
.gdpr .clause { max-height: 220px; overflow: auto; font-size: .86rem; color: #334155; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; }
.gdpr.has-error { border-color: var(--err); }
.consent { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; font-weight: 600; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--primary); }
.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.counter { text-align: right; font-size: .8rem; color: var(--muted); }
.icon-ok { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: var(--ok-l); position: relative; }
.icon-ok::after { content: ""; position: absolute; left: 22px; top: 14px; width: 16px; height: 28px; border: solid var(--ok); border-width: 0 5px 5px 0; transform: rotate(45deg); }

@media (max-width: 640px) {
  .card { padding: 18px; }
  .addr { grid-template-columns: 1fr 1fr; }
  .search input { width: 100%; }
  h1 { font-size: 1.4rem; }
}
@media print {
  header.site, footer.site, .toolbar, .pager, .back { display: none; }
  body { background: #fff; } .card { box-shadow: none; border: 0; }
}

/* ===== Wersja 2.0 ===== */
.skip { position: absolute; left: -9999px; } .skip:focus { left: 10px; top: 10px; z-index: 10; background: #fff; padding: 8px 12px; border-radius: 6px; }
nav.tabs { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
nav.tabs .wrap { display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
nav.tabs a { padding: 13px 16px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; }
nav.tabs a:hover { color: var(--text); }
nav.tabs a.cur { color: var(--primary); border-bottom-color: var(--primary); }
nav.tabs .lock { font-size: .8em; }
.banner { margin: 0 0 18px; border-radius: var(--radius, 10px); overflow: hidden; box-shadow: var(--shadow); }
.banner img { display: block; width: 100%; object-fit: cover; }
.theme-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.theme-head .logo-img { max-height: 80px; max-width: 220px; }
.theme-foot { margin: 10px 0 0; padding: 18px 22px; background: var(--card, #fff); border-radius: var(--radius, 10px); border: 1px solid var(--border); }
.card { background: var(--card, #fff); border-radius: var(--radius, 10px); }
.content img { max-width: 100%; height: auto; border-radius: 6px; }
.content table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.content td, .content th { border: 1px solid var(--border); padding: 6px 10px; }
.content blockquote { border-left: 4px solid var(--primary); margin: 0 0 1rem; padding: 4px 16px; color: #334155; background: #f8fafc; }
.post-list .post h2 { font-size: 1.35rem; }
.post .files h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.count { margin: -6px 0 12px; }
.tab-desc { color: var(--muted); }
.alert-warn { background: var(--warn-l); color: var(--warn); border: 1px solid #fde68a; }

/* Ankiety wielostronicowe */
.progress { position: relative; height: 26px; background: #eef2f7; border-radius: 13px; margin: 0 0 18px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--primary); transition: width .25s ease; }
.progress .ptext { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 600; color: #0f172a; }
.js .survey .page { display: none; }
.js .survey .page.active { display: block; }
.survey .field.skipped, .survey .field-block.skipped { display: none; }
.survey .q .qt p { display: inline; margin: 0; }
.survey .q .qt img { max-width: 100%; height: auto; display: block; margin: 8px 0; }
.stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 2.1rem; line-height: 1; color: #cbd5e1; cursor: pointer; transition: color .1s; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #f59e0b; }
.stars input:focus-visible + label { outline: 3px solid #93c5fd; border-radius: 4px; }
@media (max-width: 640px) {
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn { width: 100%; text-align: center; }
  .stars label { font-size: 2.5rem; }
  .choice { padding: 12px; }
}

/* ===== wersja 2.1 ===== */
/* Pionowy pasek przewijania zawsze dostępny (długie ankiety, wiele komunikatów) – także gdy własny CSS motywu próbuje go ukryć. */
html { overflow-y: scroll !important; scroll-behavior: smooth; }
body { overflow-y: visible !important; height: auto !important; }
.hright { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hlink { color: #e2e8f0; text-decoration: none; font-weight: 600; font-size: .95rem; padding: 6px 12px; border-radius: 8px; }
.hlink:hover, .hlink.cur { background: rgba(255,255,255,.12); color: #fff; }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 12px; color: var(--muted); font-size: .92rem; }
.meta-line strong { color: var(--text); font-weight: 600; }
.survey-list { display: grid; gap: 16px; }
.survey-item h2 { margin: 2px 0 6px; font-size: 1.3rem; }
.survey-item h2 a { color: var(--text); text-decoration: none; }
.survey-item h2 a:hover { color: var(--primary); text-decoration: underline; }
.survey-item .org { margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; font-weight: 600; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge.warn { background: var(--warn-l); color: var(--warn); } .badge.ok { background: var(--ok-l); color: var(--ok); }
/* Pasek postępu przyklejony u góry przy przewijaniu długiej strony ankiety. */
.survey .progress { position: sticky; top: 8px; z-index: 4; box-shadow: 0 2px 8px rgba(15,23,42,.08); }
.to-top { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 1.3rem; font-weight: 700;
  box-shadow: 0 4px 14px rgba(15,23,42,.25); opacity: .85; z-index: 20; }
.to-top:hover { opacity: 1; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print { .to-top, .hlink { display: none !important; } }

/* ===== 2.1: widok administratora ankiet ===== */
.section-title { margin: 26px 0 12px; font-size: 1.15rem; }
.table-wrap { overflow-x: auto; padding: 0; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin-table th, .admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.admin-table th { background: #f8fafc; font-weight: 600; color: var(--muted); white-space: nowrap; }
.admin-table tr:last-child td { border-bottom: 0; }
@media (max-width: 760px) {
  .admin-table thead { display: none; }
  .admin-table tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  .admin-table td { display: flex; gap: 10px; border: 0; padding: 4px 14px; }
  .admin-table td::before { content: attr(data-l); min-width: 110px; color: var(--muted); font-size: .82rem; }
}

/* ===== 3.0: wyśrodkowany nagłówek zakładki, potwierdzenia przeczytania ===== */
.tab-head { text-align: center; margin: 4px auto 20px; max-width: 760px; }
.tab-head h1 { margin: 0 0 4px; }
.tab-head .tab-desc { margin: 0 auto 12px; }
.tab-head .search { justify-content: center; margin: 12px auto 6px; }
.tab-head .count { margin: 6px 0 0; }
.ack { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; padding-top: 14px; border-top: 1px dashed var(--border); }
.ack.done { color: var(--ok); font-weight: 600; }
input.otp { font-size: 1.6rem; letter-spacing: .3em; text-align: center; font-family: ui-monospace, Consolas, monospace; }
