:root {
  --kosc: #fbf7f0;        /* kość słoniowa */
  --kosc-2: #f5eee2;
  --roz: #f2dcd9;         /* delikatny róż */
  --roz-2: #e9c6c1;
  --zloto: #b8913a;
  --zloto-jasne: #d9bd7a;
  --tekst: #2c2621;
  --tekst-2: #6f655b;
  --cien: 0 18px 50px rgba(92, 70, 40, .14);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse at 15% 0%, var(--roz) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 100%, var(--kosc-2) 0%, transparent 60%),
    var(--kosc);
  color: var(--tekst);
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}

.karta {
  width: 100%;
  max-width: 720px;
  text-align: center;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(184, 145, 58, .35);
  border-radius: 18px;
  padding: 28px 28px 22px;
  box-shadow: var(--cien);
}

.marka {
  margin: 0 0 18px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  letter-spacing: .32em;
  font-weight: 600;
  color: var(--zloto);
}
.marka::before, .marka::after {
  content: "";
  display: inline-block;
  width: 36px;
  height: 1px;
  margin: 0 12px;
  vertical-align: middle;
  background: linear-gradient(90deg, transparent, var(--zloto));
}
.marka::after { background: linear-gradient(90deg, var(--zloto), transparent); }

.plakat { margin: 0 0 22px; }
.plakat img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(184, 145, 58, .25);
  box-shadow: 0 10px 30px rgba(92, 70, 40, .12);
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1.15;
}

.termin {
  margin: 0 0 6px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--tekst-2);
}

.komunikat {
  margin: 14px auto 18px;
  max-width: 520px;
  font-size: clamp(18px, 3.4vw, 21px);
  line-height: 1.45;
  font-style: italic;
  color: var(--tekst);
}

.pasek {
  width: 180px;
  height: 3px;
  margin: 0 auto 22px;
  border-radius: 3px;
  background: var(--roz);
  overflow: hidden;
}
.pasek span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--zloto-jasne), var(--zloto));
}
.pasek span.start { animation: postep 1.5s linear forwards; }
@keyframes postep { to { width: 100%; } }

.przycisk {
  display: inline-block;
  min-width: 260px;
  padding: 16px 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, #c9a24b 0%, #b8913a 45%, #9c7a2e 100%);
  color: #fffdf8;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .14em;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(156, 122, 46, .35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.przycisk:hover, .przycisk:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(156, 122, 46, .45);
  outline: none;
}
.przycisk:focus-visible { outline: 2px solid var(--zloto); outline-offset: 4px; }

.drobne {
  margin: 16px 0 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  color: var(--tekst-2);
}

.stopka {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid rgba(184, 145, 58, .2);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--tekst-2);
}

.stan-brak .plakat img { filter: saturate(.7); opacity: .9; }

@media (max-width: 520px) {
  .karta { padding: 20px 16px 16px; border-radius: 14px; }
  .przycisk { min-width: 0; width: 100%; padding: 16px 20px; }
  .marka::before, .marka::after { width: 18px; margin: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .pasek span.start { animation: none; width: 100%; }
  .przycisk { transition: none; }
}

/* ── Motyw „ciemny” (grafit / czerń / złoto) — pole "motyw": "ciemny" w events.json ── */
.motyw-ciemny {
  --kosc: #0f0e0c;
  --kosc-2: #1d1a15;
  --roz: #2b2416;
  --roz-2: #3a2f1b;
  --zloto: #d4a24a;
  --zloto-jasne: #f0c873;
  --tekst: #f1ebe0;
  --tekst-2: #a89f90;
  --cien: 0 18px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
.motyw-ciemny .karta {
  background: linear-gradient(180deg, rgba(30, 27, 22, .92), rgba(16, 15, 13, .94));
  border-color: rgba(212, 162, 74, .45);
}
.motyw-ciemny .plakat img { border-color: rgba(212, 162, 74, .35); box-shadow: 0 12px 34px rgba(0, 0, 0, .55); }
.motyw-ciemny h1 { letter-spacing: .05em; }
.motyw-ciemny .przycisk {
  background: linear-gradient(135deg, #f0c873 0%, #d4a24a 45%, #a8781f 100%);
  color: #14120e;
  box-shadow: 0 8px 26px rgba(212, 162, 74, .3);
}
.motyw-ciemny .stopka { border-top-color: rgba(212, 162, 74, .2); }

/* ── Panel /panel ─────────────────────────────────────────── */
.panel { align-items: flex-start; }
.karta-panel { max-width: 820px; text-align: left; }
.karta-panel .marka, .karta-panel > h1 { text-align: center; }
.karta-panel > h1 { margin-bottom: 18px; }
.alert {
  margin: 0 0 16px; padding: 12px 16px; border-radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14px;
}
.alert-blad { background: #fbe9e7; border: 1px solid #e3a59c; color: #8a2b1f; }
.alert-ok { background: #f3f0e2; border: 1px solid var(--zloto-jasne); color: #5b4818; }
.logowanie, .edycja { display: grid; gap: 12px; }
.logowanie { max-width: 340px; margin: 0 auto; }
.panel label {
  display: grid; gap: 6px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 13px; font-weight: 600; color: var(--tekst-2);
}
.panel input {
  width: 100%; padding: 11px 12px; border-radius: 9px;
  border: 1px solid rgba(184, 145, 58, .45); background: #fffdf9;
  font: 15px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--tekst);
}
.panel input:focus { outline: 2px solid var(--zloto-jasne); outline-offset: 1px; border-color: var(--zloto); }
.panel .przycisk { min-width: 0; border: 0; cursor: pointer; padding: 13px 22px; font-size: 13px; }
.przycisk-2 {
  background: #fff; color: var(--zloto); box-shadow: none;
  border: 1px solid var(--zloto) !important;
}
.wyloguj {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 13px; color: var(--tekst-2);
}
.link { background: none; border: 0; color: var(--zloto); cursor: pointer; font: inherit; text-decoration: underline; }
.szkolenie {
  display: grid; grid-template-columns: 240px 1fr; gap: 14px 18px;
  padding: 16px; margin-bottom: 16px; border-radius: 14px;
  border: 1px solid rgba(184, 145, 58, .3); background: rgba(255, 255, 255, .8);
}
.szkolenie.wlaczone { border-color: var(--zloto); box-shadow: 0 0 0 2px rgba(217, 189, 122, .35); }
.szkolenie img { width: 100%; height: auto; border-radius: 9px; }
.szkolenie h2 { margin: 0 0 6px; font-size: 22px; }
.opis-szk p { margin: 0 0 6px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 13px; color: var(--tekst-2); }
.szkolenie.wlaczone .status { color: #2f7a3a; font-weight: 600; }
.adres a { color: var(--zloto); word-break: break-all; }
.edycja { grid-column: 1 / -1; }
.przyciski { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .szkolenie { grid-template-columns: 1fr; }
  .przyciski .przycisk { flex: 1 1 100%; }
}
