/* ==========================================================================
   Własność Pana – zapisy. Spokojna, czytelna kolorystyka; duże litery.
   ========================================================================== */
:root {
  /* kolory zaczerpnięte z logo: zmierzchowy granat → fiolet → przygaszony róż */
  --bg: #f6f4f7;
  --paper: #ffffff;
  --ink: #23222f;
  --ink-soft: #4b4a5c;
  --muted: #6c6b7b;
  --line: #e5e1ea;
  --navy: #3d3b60;
  --navy-dark: #2b2a47;
  --gold: #9c7284;
  --gold-soft: #f3e9ee;
  --sel: #f7e8ef;
  --sel-line: #b47d95;
  --ok: #2f6b4f;
  --ok-soft: #e4f2ea;
  --err: #a32b2b;
  --err-soft: #fbe9e9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(35, 34, 47, .06), 0 4px 14px rgba(35, 34, 47, .07);
  --sky: linear-gradient(165deg, #393a5b 0%, #47435f 45%, #6e5f74 80%, #8a7380 100%);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 19px/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; padding-bottom: 48px; }
a { color: var(--navy); }
a:hover { color: var(--navy-dark); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; color: var(--navy-dark); }
h1 { font-size: clamp(30px, 5vw, 42px); margin: 0 0 12px; }
h2 { font-size: 26px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px 14px; z-index: 100; }

/* ---------------- nagłówek / stopka */
.site-header { background: var(--sky); color: #fff; }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand__mark {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25);
  font-size: 24px; color: #fff; overflow: hidden; flex: none;
}
.brand__logo { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.brand__name { display: block; font: 600 23px/1.1 var(--serif); }
.brand__tag { display: block; font-size: 15px; opacity: .8; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 16px; padding: 18px 0; }

/* ---------------- przyciski */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 24px;
  border-radius: 12px; border: 2px solid var(--navy);
  background: #fff; color: var(--navy);
  font: 600 18px/1.2 var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { background: #eef2f7; }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-dark); color: #fff; }
.btn--ghost { border-color: transparent; background: transparent; text-decoration: underline; }
.btn--big { min-height: 60px; font-size: 20px; width: 100%; }
.btn--danger { border-color: var(--err); color: var(--err); }
.btn--danger:hover { background: var(--err-soft); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.linklike { background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

.badge {
  display: inline-block; padding: 4px 12px; border-radius: 99px;
  background: #e9ecf1; color: var(--ink-soft); font-size: 15px; font-weight: 600;
}
.badge--live { background: var(--ok-soft); color: var(--ok); }
.badge--live::before { content: "● "; }

.notice { background: var(--paper); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin: 24px 0; }
.notice--info { background: var(--gold-soft); box-shadow: none; padding: 14px 18px; }
.notice--ok { background: var(--ok-soft); color: var(--ok); box-shadow: none; padding: 14px 18px; }
.notice--err { background: var(--err-soft); color: var(--err); box-shadow: none; padding: 14px 18px; }

/* ---------------- strona główna */
.hero { padding: 36px 0 8px; }
.hero h1 { color: var(--navy-dark); }
.hero p { font-size: 21px; color: var(--ink-soft); margin: 0; }
.list { margin-top: 28px; }
.list__title { font-size: 25px; margin: 0 0 14px; display: inline-block; }
.list--past summary { cursor: pointer; list-style: none; }
.list--past summary::-webkit-details-marker { display: none; }
.list--past summary h2::after { content: " ▾"; font-size: 18px; color: var(--muted); }
.list--past details[open] summary h2::after { content: " ▴"; }
.list--past .card { opacity: .8; }
.empty { color: var(--muted); font-size: 20px; background: var(--paper); padding: 22px; border-radius: var(--radius); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.card {
  display: block; position: relative;
  background: var(--paper); border-radius: var(--radius); padding: 22px 24px 20px;
  box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
  border: 2px solid transparent; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--gold); transform: translateY(-2px); color: var(--ink); }
.card--ongoing { border-left: 6px solid var(--ok); }
.card .badge { margin-bottom: 10px; }
.card__title { margin: 0 0 8px; font-size: 25px; }
.card__when { margin: 0 0 14px; color: var(--ink-soft); }
.card__stats { margin: 8px 0 0; font-size: 16px; color: var(--muted); }
.card__cta { display: inline-block; margin-top: 14px; font-weight: 600; color: var(--navy); }
.meter { height: 10px; background: #ebe7ef; border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, #5a5480, var(--gold)); border-radius: 99px; }

/* ---------------- strona wydarzenia */
.back { margin: 22px 0 0; font-size: 18px; }
.event-head { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px; margin: 14px 0 22px; }
.event-head .badge { margin-bottom: 10px; }
.event-head__when { font-size: 21px; color: var(--ink-soft); margin: 0 0 8px; }
.event-head__desc { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.howto { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 26px; padding: 16px 0 0; margin: 16px 0 0; border-top: 1px solid var(--line); }
.howto li { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.howto span {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); font-weight: 700;
}

.event-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.event-layout--single { grid-template-columns: minmax(0, 1fr); }

.day { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.day__title {
  margin: 0; padding: 14px 22px; font-size: 23px;
  background: #faf8fb; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2;
}
.slots { list-style: none; margin: 0; padding: 0; }
.gap {
  padding: 6px 22px; font-size: 15px; color: var(--muted); text-align: center;
  background: repeating-linear-gradient(45deg, #faf9fb, #faf9fb 8px, #f1eef4 8px, #f1eef4 16px);
  border-bottom: 1px solid var(--line);
}
.slot { border-bottom: 1px solid var(--line); position: relative; }
.slot:last-child { border-bottom: 0; }
.slot__main {
  width: 100%; display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 22px; min-height: 68px;
  background: transparent; border: 0; text-align: left; font: inherit; color: inherit;
}
button.slot__main { cursor: pointer; }
button.slot__main:hover { background: #f6f8fb; }
button.slot__main:hover .slot__plus { background: var(--navy); color: #fff; }
.slot__time { font-size: 22px; font-weight: 700; color: var(--navy-dark); font-variant-numeric: tabular-nums; white-space: nowrap; }
.slot__dash { color: var(--muted); font-weight: 400; margin: 0 3px; }
.slot__people { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.slot__hint { color: #9aa0aa; font-size: 16px; font-style: italic; }
.slot__state { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--muted); white-space: nowrap; }
.slot__plus {
  padding: 8px 14px; border-radius: 10px; border: 2px solid var(--navy);
  color: var(--navy); font-weight: 600; font-size: 16px; background: #fff;
}
.slot.is-full .slot__state strong { color: var(--ink-soft); background: #eceae5; padding: 4px 12px; border-radius: 99px; }
.slot.is-past { background: #fafafa; }
.slot.is-past .slot__time { color: #9aa0aa; }
.slot.is-past .bubble { opacity: .6; }
.slot.is-empty:not(.is-past) .slot__time::after {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); margin-left: 8px; vertical-align: middle;
}

/* zaznaczenie wybranych godzin (podgląd zapisu) */
.slot.is-selected { background: var(--sel); box-shadow: inset 6px 0 0 var(--sel-line); }
.slot.is-selected button.slot__main:hover { background: transparent; }
.slot.is-selected.is-sel-first { box-shadow: inset 6px 0 0 var(--sel-line), inset 0 2px 0 var(--sel-line); }
.slot.is-selected.is-sel-last { box-shadow: inset 6px 0 0 var(--sel-line), inset 0 -2px 0 var(--sel-line); }
.slot.is-selected.is-sel-first.is-sel-last { box-shadow: inset 6px 0 0 var(--sel-line), inset 0 2px 0 var(--sel-line), inset 0 -2px 0 var(--sel-line); }
.slot.is-selected .slot__hint { display: none; }

/* ---------------- dymki osób */
.bubble {
  display: inline-flex; align-items: center;
  padding: 5px 14px; border-radius: 99px;
  font-size: 17px; font-weight: 600; line-height: 1.3;
  border: 1px solid rgba(0, 0, 0, .06);
  white-space: nowrap;
}
.bubble.c0 { background: #dbe8f7; color: #1d3f66; }
.bubble.c1 { background: #dff0e3; color: #22553a; }
.bubble.c2 { background: #fbe3d6; color: #7a3a1c; }
.bubble.c3 { background: #ece2f6; color: #4d2d70; }
.bubble.c4 { background: #fdf0c8; color: #6b4f0a; }
.bubble.c5 { background: #d9f0f0; color: #1c5656; }
.bubble.c6 { background: #f7dde6; color: #7a2747; }
.bubble.c7 { background: #e6eccf; color: #46531a; }
.bubble.c8 { background: #e3e6f8; color: #2e3a7a; }
.bubble.c9 { background: #f1e5d8; color: #6a4523; }
.bubble--ghost {
  background: #fff; color: var(--gold); border: 2px dashed var(--sel-line);
  animation: pulse 1.6s ease-in-out infinite;
}
.bubble--new { animation: pop .5s ease-out; box-shadow: 0 0 0 3px var(--ok-soft); }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ---------------- panel zapisu */
.booking { position: sticky; top: 16px; }
.booking__box { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.booking__box h2 { margin: 0 0 12px; }
.booking__lead { color: var(--ink-soft); font-size: 19px; margin: 0; }
.booking__chosen { font-size: 19px; margin: 0 0 16px; padding: 12px 14px; background: var(--gold-soft); border-radius: 10px; }
.booking__actions { display: grid; gap: 6px; margin-top: 18px; }
.booking__box--ok { text-align: center; }
.ok-icon {
  width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center; font-size: 40px; background: var(--ok-soft); color: var(--ok);
}
#bo-text { font-size: 21px; font-weight: 600; }

.field { display: block; border: 0; padding: 0; margin: 0 0 16px; }
.field > span, .field legend { display: block; font-weight: 600; margin-bottom: 6px; font-size: 18px; padding: 0; }
.field em { font-weight: 400; font-style: normal; color: var(--muted); }
.field small { display: block; color: var(--muted); font-size: 15px; margin-top: 5px; line-height: 1.4; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], input[type=email], select, textarea {
  width: 100%; min-height: 54px; padding: 10px 14px;
  font: 400 19px var(--font); color: var(--ink);
  border: 2px solid #cbc6d3; border-radius: 10px; background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: 3px solid rgba(31, 58, 95, .18); outline-offset: 0; }
.is-invalid { border-color: var(--err) !important; background: var(--err-soft) !important; }

.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.choice {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 64px; padding: 8px; border-radius: 10px;
  border: 2px solid #cbc6d3; background: #fff; cursor: pointer; font: inherit; color: var(--ink);
}
.choice strong { font-size: 19px; }
.choice small { font-size: 14px; color: var(--muted); }
.choice:hover:not(:disabled) { border-color: var(--navy); }
.choice.is-on { border-color: var(--sel-line); background: var(--sel); box-shadow: 0 0 0 2px var(--sel-line); }
.choice:disabled { opacity: .5; cursor: not-allowed; background: #f3f3f3; }

.preview { margin: 0 0 18px; padding: 14px 16px; border-radius: 12px; background: var(--sel); border: 2px solid var(--sel-line); }
.preview:empty { display: none; }
.preview__title { margin: 0; font-size: 15px; color: var(--ink-soft); }
.preview__when { margin: 2px 0 10px; font-size: 20px; font-weight: 700; color: var(--navy-dark); }
.preview__bar { display: flex; flex-wrap: wrap; gap: 4px; }
.preview__bar span { flex: 1 1 auto; text-align: center; padding: 6px 8px; background: #fff; border-radius: 6px; font-size: 15px; font-weight: 600; color: #6e3f55; font-variant-numeric: tabular-nums; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; line-height: 1.45; cursor: pointer; }
.check input { width: 28px; height: 28px; flex: none; margin: 0; accent-color: var(--navy); }
.form-error { background: var(--err-soft); color: var(--err); padding: 12px 14px; border-radius: 10px; font-weight: 600; margin: 16px 0 0; }
.recaptcha-note { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.grecaptcha-badge { visibility: hidden; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------- strona tekstowa */
.prose { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px; margin-top: 24px; max-width: 860px; }
.prose h2 { font-size: 22px; margin-top: 26px; }

/* ---------------- telefon / tablet */
@media (max-width: 899px) {
  body { font-size: 18px; }
  .event-layout { grid-template-columns: 1fr; }
  .booking { position: static; }
  .booking #booking-empty { display: none; }
  .booking.is-open {
    position: fixed; inset: 0; z-index: 50; overflow-y: auto;
    background: rgba(21, 42, 70, .55); padding: 12px;
  }
  .booking.is-open .booking__box { max-width: 560px; margin: 0 auto; }
  body.booking-open { overflow: hidden; }
  .slot__main { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px 16px; }
  .slot__time { grid-column: 1; }
  .slot__state { grid-column: 2; grid-row: 1; }
  .slot__people { grid-column: 1 / -1; }
  .slot__people:empty { display: none; }
  .day__title { padding: 12px 16px; font-size: 21px; }
  .event-head { padding: 20px; }
  .slot__free { display: none; }
}
@media (max-width: 420px) {
  .slot__time { font-size: 20px; }
  .cards { grid-template-columns: 1fr; }
}

@media print {
  .site-header, .site-footer, .booking, .back, .howto, .admin-nav, .no-print { display: none !important; }
  body { background: #fff; font-size: 13px; }
  .day, .event-head, .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .bubble { border: 1px solid #999; }
}

/* okienko „Nie jestem robotem” */
.captcha { margin: 18px 0 0; padding: 14px; border-radius: 12px; background: #f4f2f7; border: 2px solid var(--line); }
.captcha.is-invalid { border-color: var(--err); background: var(--err-soft); }
.captcha__label { margin: 0 0 10px; font-weight: 600; font-size: 17px; }
#bf-captcha { min-height: 78px; }
@media (max-width: 360px) { #bf-captcha { transform: scale(.9); transform-origin: left top; } }

/* pasek „✕ Zamknij” – tylko w oknie formularza na telefonie */
.sheet-bar { display: none; }
.sheet-close {
  min-height: 52px; padding: 10px 22px; border-radius: 99px; border: 0;
  background: #fff; color: var(--navy-dark); font: 700 18px/1 var(--font); cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
@media (max-width: 899px) {
  .booking.is-open .sheet-bar {
    display: flex; justify-content: flex-end; position: sticky; top: 0; z-index: 5;
    max-width: 560px; margin: 0 auto 10px; pointer-events: none;
  }
  .booking.is-open .sheet-close { pointer-events: auto; }
  .booking__actions .btn { width: 100%; }
}
