/* Strona wydarzeń FSSystem – paleta jak w panelu i na stronie zgłoszeń (zglos/zglos.css). */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --navy: #1e2035;
  --bg: #f8f9fc;
  --tint: #eef2ff;
  --border: #e8ebf3;
  --text: #1b1b1b;
  --muted: #6b7280;
  --success: #22c55e;
  --warn: #b45309;
  --error: #dc2626;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Geist Sans", "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
a { color: var(--primary); }

/* Nagłówek */
.top { background: #fff; border-bottom: 1px solid var(--border); }
.top__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 700; font-size: 20px; text-decoration: none; }
.brand small { font-weight: 500; color: var(--muted); font-size: 15px; margin-left: 4px; }
.top__link { color: var(--primary); font-weight: 500; text-decoration: none; font-size: 15px; }
.top__link:hover { text-decoration: underline; }

main { flex: 1; padding-bottom: 56px; }
.loading { color: var(--muted); padding: 48px 0; }

.hero { padding: 36px 0 22px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(26px, 5vw, 36px); color: var(--navy); letter-spacing: -0.02em; line-height: 1.2; }
.hero p { margin: 0; color: var(--muted); max-width: 680px; }
.hero--event { padding-top: 8px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 2px rgba(30, 32, 53, 0.04), 0 8px 24px rgba(30, 32, 53, 0.05);
}
.card h2 { margin: 0 0 12px; color: var(--navy); font-size: 20px; }
.empty { text-align: center; padding: 48px 24px; }
.empty .btn { margin-top: 12px; }
.muted { color: var(--muted); font-size: 14px; }

/* Lista */
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.event-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  color: inherit; text-decoration: none;
  box-shadow: 0 1px 2px rgba(30, 32, 53, 0.04);
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.event-card:hover { border-color: #c7d2fe; box-shadow: 0 10px 28px rgba(30, 32, 53, 0.1); transform: translateY(-2px); }
.event-card__img { aspect-ratio: 16 / 5; background: var(--tint); }
.event-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-card__img--empty { background: linear-gradient(135deg, #dbeafe, #eef2ff 60%, #e0e7ff); }
.event-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.event-card__body h2 { margin: 0; font-size: 19px; color: var(--navy); line-height: 1.3; }
.event-card__body .muted { margin: 0; }
.event-card__date { margin: 0; color: var(--primary-dark); font-weight: 600; font-size: 14px; }

.badge {
  display: inline-block; align-self: flex-start; margin: 6px 0 0;
  padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--tint); color: var(--primary-dark);
}
.badge--muted { background: #f1f5f9; color: #475569; }
.badge--warn { background: #fef3c7; color: var(--warn); }
.badge--error { background: #fee2e2; color: #991b1b; }
.hero .badge { margin: 0 0 10px; }

/* Wydarzenie */
.banner { background: var(--navy); }
.banner img { display: block; width: 100%; height: auto; max-width: 1920px; margin: 0 auto; aspect-ratio: 16 / 5; object-fit: cover; }
.crumbs { padding-top: 18px; font-size: 14px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; align-items: start; }
.layout__side { position: sticky; top: 16px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px 24px; }
.fact { display: flex; flex-direction: column; gap: 2px; }
.fact__label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.fact strong { color: var(--navy); font-size: 17px; }
.fact span:not(.fact__label) { color: var(--text); }
.fact a { font-size: 14px; font-weight: 500; text-decoration: none; margin-top: 2px; }
.fact a:hover { text-decoration: underline; }
.fact__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--border); padding-top: 16px; }

.description { margin-top: 24px; font-size: 17px; }
.description p { margin: 0 0 14px; max-width: 70ch; }

/* Formularz */
.fields { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-weight: 500; font-size: 14px; color: var(--navy); }
.field b, .consent b, .muted b { color: var(--error); font-weight: 600; }
.field small, .consent small { color: var(--muted); font-size: 13px; }

input, select, textarea {
  font: inherit; color: inherit; width: 100%;
  padding: 10px 12px; border: 1px solid #d5dae6; border-radius: 10px; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.invalid { border-color: var(--error) !important; }

.consents { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.consent { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: flex-start; font-size: 14px; color: var(--text); }
.consent > span { flex: 1; min-width: 0; }
.consent small { flex-basis: 100%; padding-left: 28px; }
.consent input { width: 18px; height: 18px; margin-top: 2px; padding: 0; flex-shrink: 0; accent-color: var(--primary); }
.consent input.invalid { outline: 2px solid var(--error); outline-offset: 1px; }
.field--check { font-weight: 500; color: var(--navy); }

.clause { margin-left: 28px; font-size: 13px; color: var(--muted); }
.clause summary { cursor: pointer; color: var(--primary-dark); font-weight: 500; }
.clause dl { margin: 8px 0 0; }
.clause dt { font-weight: 600; color: var(--navy); margin-top: 6px; }
.clause dd { margin: 0; white-space: pre-line; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.alert { margin: 18px 0 0; padding: 12px 14px; border-radius: 10px; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; font-size: 14px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 20px; }

.btn {
  font: inherit; font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px;
  border: 1px solid var(--primary); border-radius: 10px;
  background: var(--primary); color: #fff; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn--ghost { background: #fff; color: var(--primary); }
.btn--ghost:hover { background: var(--tint); }
.btn--sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.layout__side .actions .btn { flex: 1; }

.closed p { margin: 0; color: var(--muted); }

.success { text-align: center; padding: 36px 24px; }
.success:focus { outline: none; }
.success__icon {
  width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px; font-weight: 700; color: #fff; background: var(--success);
}
.success p { color: var(--muted); }
.success .btn { margin-top: 8px; }

.foot { border-top: 1px solid var(--border); background: #fff; color: var(--muted); font-size: 13px; }
.foot .wrap { display: flex; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; }
.foot a { color: var(--muted); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .layout__side { position: static; }
}

@media (max-width: 640px) {
  .card { padding: 20px 16px; }
  .hero { padding-top: 24px; }
  .events { grid-template-columns: 1fr; }
  .brand small { display: none; }
  .actions .btn { width: 100%; }
}
