:root {
  --popraw-pink: #e07db3;
  --popraw-pink-hover: #f29dca;
  --popraw-ink: #171719;
  --popraw-paper: #f2f0ec;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--popraw-ink);
  background: var(--popraw-paper);
}

a { color: inherit; }

.join-form__button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 180px;
  padding: 14px 17px 14px 20px;
  border: 1px solid transparent;
  color: #fff;
  font-size: .83rem;
  font-weight: 900;
  letter-spacing: .02em;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.join-form__button:hover { transform: translateY(-2px); }

/* Formularz zgłoszenia i regulaminy w zmiennych (issue #30): jasne w :root, ciemne pod
   [data-bs-theme="dark"] (ustawia go static/js/theme.js). Strona główna ma własny arkusz
   club-home.css. */
:root {
  --join-ink: #171719;
  --join-strong: #302d2c;
  --join-on-strong: #fff;
  --join-body: #4d4846;
  --join-muted: #6f6a68;
  --join-soft: #9a9490;
  --join-pink-rgb: 224, 125, 179;
  --join-pink-text: #a85b87;
  --join-pink-strong: #8f315f;
  --join-error: #b63d63;
  --join-paper: #f4f2ee;
  --join-surface: #fff;
  --join-input-bg: #fff;
  --join-select-bg: #fcfbfa;
  --join-subtle: #f1eeeb;
  --join-line: #ded9d3;
  --join-line-soft: #e3dfdc;
  --join-input-line: #d9d4d0;
  --join-check-line: #c8bfc0;
  --join-overlay-top: rgba(244, 242, 238, .87);
  --join-overlay-bottom: rgba(244, 242, 238, .93);
}
[data-bs-theme="dark"] {
  --join-ink: #f4f3f6;
  --join-strong: #e6e3e8;
  --join-on-strong: #171719;
  --join-body: #c9c5cd;
  --join-muted: #aaa5ae;
  --join-soft: #8d8892;
  /* Akcent fioletowy jak w panelu (club.css). */
  --popraw-pink: #c07de8;
  --popraw-pink-hover: #cf98ef;
  --join-pink-rgb: 192, 125, 232;
  --join-pink-text: #d6a8f2;
  --join-pink-strong: #e8cbf8;
  --join-error: #ff8f9e;
  --join-paper: #131215;
  --join-surface: #1c1b1f;
  --join-input-bg: #161518;
  --join-select-bg: #161518;
  --join-subtle: #2a282e;
  --join-line: #36333b;
  --join-line-soft: #2c2a30;
  --join-input-line: #4a4650;
  --join-check-line: #5f5a66;
  --join-overlay-top: rgba(19, 18, 21, .88);
  --join-overlay-bottom: rgba(19, 18, 21, .94);
}
/* Akcent z Ustawień klubu, zakładka „Wygląd” (opis w club.css). */
:root[data-accent-light="purple"]:not([data-bs-theme="dark"]) {
  --popraw-pink: #c07de8;
  --popraw-pink-hover: #cf98ef;
  --join-pink-rgb: 192, 125, 232;
  --join-pink-text: #8450ad;
  --join-pink-strong: #6b2f96;
}
:root[data-bs-theme="dark"][data-accent-dark="pink"] {
  --popraw-pink: #e07db3;
  --popraw-pink-hover: #f29dca;
  --join-pink-rgb: 224, 125, 179;
  --join-pink-text: #f0a3cb;
  --join-pink-strong: #f7c6df;
}
[data-bs-theme="dark"] .join-page__brand img { filter: none; }

.join-page {
  color: var(--join-ink);
  min-height: 100svh;
  padding: 22px clamp(18px, 4vw, 60px) 52px;
  background:
    linear-gradient(var(--join-overlay-top), var(--join-overlay-bottom)),
    url("../img/home/popraw-run-club.png") center / cover fixed;
}

.join-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1240px;
  margin: 0 auto;
}

.join-page__brand {
  display: block;
  width: clamp(138px, 15vw, 184px);
  line-height: 0;
  text-decoration: none;
}

.join-page__brand img {
  display: block;
  width: 100%;
  height: auto;
  filter: invert(1);
}

.join-page__layout {
  display: grid;
  grid-template-columns: minmax(340px, .86fr) minmax(0, 1.14fr);
  align-items: start;
  gap: clamp(34px, 6vw, 92px);
  max-width: 1240px;
  margin: clamp(55px, 10vh, 125px) auto 0;
}

.join-page__intro { position: sticky; top: 28px; min-width: 0; }
.join-page__eyebrow {
  margin: 0 0 17px;
  color: var(--join-pink-text);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.join-page__intro h1 {
  max-width: 100%;
  margin: 0;
  font-size: clamp(2.6rem, 3.6vw, 4.6rem);
  font-weight: 900;
  letter-spacing: -.07em;
  line-height: .92;
  overflow-wrap: break-word;
}

.join-page__intro h1 span {
  position: relative;
  z-index: 0;
  color: var(--popraw-pink);
  white-space: nowrap;
}

.join-page__intro p:not(.join-page__eyebrow) {
  max-width: 390px;
  margin: 30px 0 0;
  color: var(--join-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.join-page__line {
  width: 66px;
  height: 7px;
  margin: 32px 0 18px;
  background: var(--popraw-pink);
}

.join-page__intro small { color: var(--join-soft); font-size: .76rem; line-height: 1.45; }

.join-form-card {
  min-width: 0;
  padding: clamp(24px, 4vw, 46px);
  background: var(--join-surface);
  border: 1px solid var(--join-line);
}

.join-form-card__heading { max-width: 570px; margin-bottom: 33px; }
.join-form-card h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  font-weight: 900;
  letter-spacing: -.055em;
  line-height: 1;
}

.join-form-card__heading > p:last-child,
.join-success > p:not(.join-page__eyebrow) {
  margin: 0;
  color: var(--join-muted);
  font-size: .92rem;
  line-height: 1.55;
}

.join-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 23px 18px;
}
.join-form__field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.join-form__field--wide,
.join-form__field--consent { grid-column: 1 / -1; }
.join-form__field > label:not(.join-form__consent) {
  display: flex;
  align-items: flex-start;
  min-height: 2.5em;
  margin-bottom: 7px;
  color: var(--join-strong);
  font-size: .74rem;
  font-weight: 900;
  line-height: 1.3;
}

.join-form__field > label:not(.join-form__consent) > span {
  margin-left: 3px;
  color: var(--popraw-pink);
}
.join-form__required-mark {
  margin-left: 4px;
  color: var(--popraw-pink);
  font-weight: 900;
}
.join-form__input,
.join-form__select {
  display: block;
  width: 100%;
  min-height: 45px;
  padding: 11px 13px;
  border: 1px solid var(--join-input-line);
  border-radius: 3px;
  outline: 0;
  color: var(--join-strong);
  background: var(--join-select-bg);
  font: inherit;
  font-size: .86rem;
  line-height: 1.4;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

textarea.join-form__input { min-height: 104px; resize: vertical; }
.join-form__input:focus,
.join-form__select:focus {
  border-color: var(--popraw-pink);
  background: var(--join-input-bg);
  box-shadow: 0 0 0 3px rgba(var(--join-pink-rgb), .14);
}
.join-form__select {
  appearance: auto;
  cursor: pointer;
}
.join-form__consent { display: flex; align-items: flex-start; gap: 9px; color: var(--join-muted); font-size: .75rem; line-height: 1.45; }
.join-form__checkbox,
.join-form__field ul input[type="checkbox"],
.join-form__field > .join-form__choices input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: 1px solid var(--join-check-line);
  border-radius: 3px;
  background: var(--join-input-bg);
  place-content: center;
  cursor: pointer;
}
.join-form__checkbox::before,
.join-form__field ul input[type="checkbox"]::before,
.join-form__field > .join-form__choices input[type="checkbox"]::before {
  width: 8px;
  height: 8px;
  content: "";
  background: var(--popraw-pink);
  transform: scale(0);
  transition: transform .12s ease;
}
.join-form__checkbox:checked::before,
.join-form__field ul input[type="checkbox"]:checked::before,
.join-form__field > .join-form__choices input[type="checkbox"]:checked::before {
  transform: scale(1);
}
.join-form__checkbox:checked,
.join-form__field ul input[type="checkbox"]:checked,
.join-form__field > .join-form__choices input[type="checkbox"]:checked {
  border-color: var(--popraw-pink);
  background: var(--popraw-pink);
}
.join-form__checkbox:focus-visible,
.join-form__field ul input[type="checkbox"]:focus-visible,
.join-form__field > .join-form__choices input[type="checkbox"]:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(var(--join-pink-rgb), .2);
}
.join-form__required { margin: 19px 0 14px; color: var(--join-soft); font-size: .7rem; }
.join-form__button { min-width: 210px; border: 0; color: #181717; background: var(--popraw-pink); cursor: pointer; }
.join-form__button:hover { background: var(--popraw-pink-hover); }
.join-form__button span { font-size: 1.1rem; }
.join-form__field-errors,
.join-form__errors { margin-top: 6px; color: var(--join-error); font-size: .72rem; }
.join-form__field-errors ul,
.join-form__errors ul { margin: 0; padding-left: 16px; }
.join-form__field-errors--choices {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--join-pink-rgb), .45);
  border-left: 4px solid var(--popraw-pink);
  border-radius: 3px;
  color: var(--join-pink-strong);
  background: rgba(var(--join-pink-rgb), .12);
  font-size: .8rem;
  font-weight: 800;
}
.join-form__field-errors--choices ul {
  padding-left: 17px;
}
/* Komunikat dla całego kroku (nad polami, na całą szerokość formularza). */
.join-form__errors--notice {
  margin: 0 0 22px;
  padding: 12px 16px;
  border: 1px solid rgba(var(--join-pink-rgb), .45);
  border-left: 4px solid var(--popraw-pink);
  border-radius: 3px;
  color: var(--join-pink-strong);
  background: rgba(var(--join-pink-rgb), .12);
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.55;
}
.join-form__errors--notice ul { padding-left: 0; list-style: none; }

/* Pole-pułapka dla botów (accounts/join_protection.py): poza ekranem, ludzie go nie widzą. */
.join-form__hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.join-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 26px;
  color: #181717;
  background: var(--popraw-pink);
  font-size: 1.5rem;
  font-weight: 900;
}

.join-success h2 { max-width: 410px; }
.join-form__text-link { color: var(--join-muted); font-size: .8rem; font-weight: 800; text-decoration: none; }
.join-success__debug {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 4px solid var(--join-error);
  color: var(--join-pink-strong);
  background: rgba(182, 61, 99, .08);
  font-size: .76rem !important;
  line-height: 1.5 !important;
  overflow-wrap: anywhere;
}
.join-success__debug strong { display: block; margin-bottom: 4px; }
.join-success__debug code { font: inherit; }
.join-success__contact { margin-top: 24px !important; }

.join-page__meta {
  color: var(--join-muted);
  font-size: .76rem !important;
  line-height: 1.45 !important;
  margin-top: 13px !important;
}

.join-page__meta strong { color: var(--join-strong); }
.join-page__meta a { color: var(--join-strong); font-weight: 800; }
.join-page__social-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0 6px;
}
.join-page__contact-emails {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}
.join-page__social-links a {
  text-decoration: underline;
  text-decoration-color: rgba(var(--join-pink-rgb), .7);
  text-underline-offset: 3px;
}

.join-form-card--wizard { max-width: 760px; }

.join-wizard__progress {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 28px;
}

.join-wizard__progress-item {
  align-items: center;
  color: var(--join-soft);
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  text-align: center;
}

.join-wizard__progress-item--link {
  text-decoration: none;
  cursor: pointer;
}

.join-wizard__progress-item--link:hover { color: var(--join-strong); }

.join-wizard__progress-item > span {
  align-items: center;
  border: 1px solid var(--join-input-line);
  border-radius: 999px;
  display: inline-flex;
  font-size: .68rem;
  font-weight: 900;
  height: 25px;
  justify-content: center;
  width: 25px;
}

.join-wizard__progress-item small {
  font-size: .59rem;
  font-weight: 800;
  line-height: 1.2;
  max-width: 82px;
}

.join-wizard__progress-item.is-active,
.join-wizard__progress-item.is-complete { color: var(--join-strong); }

.join-wizard__progress-item.is-active > span {
  background: var(--popraw-pink);
  border-color: var(--popraw-pink);
  color: #181717;
}

.join-wizard__progress-item.is-complete > span {
  background: var(--join-strong);
  border-color: var(--join-strong);
  color: var(--join-on-strong);
}

.join-wizard__fields { margin-top: 24px; }
.join-wizard__fields .join-form__field > label:not(.join-form__consent) { font-size: .78rem; line-height: 1.35; }
.join-wizard__paired-field > label:not(.join-form__consent) { min-height: 4.1em; }
.join-form__multi-choice-field > label:not(.join-form__consent) { min-height: 2.5em; margin-bottom: 7px; }
.join-form__help { color: var(--join-soft); display: block; font-size: .7rem; line-height: 1.4; margin-top: 6px; }
.join-form__help--prominent { font-size: .82rem; margin-top: 8px; }

.join-form__field input[type="file"] {
  padding: 8px 10px;
  background: var(--join-input-bg);
  cursor: pointer;
}

.join-form__field input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 7px 10px;
  border: 1px solid var(--join-input-line);
  border-radius: 2px;
  color: var(--join-strong);
  background: var(--join-subtle);
  font: inherit;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}

.join-form__field ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.join-form__field > .join-form__choices {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.join-form__field > .join-form__choices > div {
  display: flex;
  min-width: 0;
}

.join-form__field > .join-form__choices > div > label {
  display: flex;
  align-items: flex-start;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--join-input-line);
  color: var(--join-muted);
  background: var(--join-input-bg);
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.join-form__field > .join-form__choices > div:has(input:checked) > label {
  border-color: var(--popraw-pink);
  color: var(--join-strong);
  background: rgba(var(--join-pink-rgb), .1);
}

.join-form__field ul li {
  align-items: flex-start;
  background: var(--join-input-bg);
  border: 1px solid var(--join-input-line);
  color: var(--join-muted);
  display: flex;
  font-size: .78rem;
  gap: 8px;
  line-height: 1.35;
  min-height: 44px;
  padding: 10px 12px;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.join-form__field ul li:has(input:checked) {
  background: rgba(var(--join-pink-rgb), .1);
  border-color: var(--popraw-pink);
  color: var(--join-strong);
}

.join-form__field ul input {
  flex: 0 0 auto;
  margin-top: 2px;
}

.join-form__field > .join-form__choices input[type="checkbox"] {
  margin-right: 8px;
}

.join-form__field ul li label {
  display: flex;
  align-items: flex-start;
  min-height: 0;
  margin: 0;
  color: inherit;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
}

.join-wizard__conditional-field[hidden] { display: none; }

.join-wizard__notice {
  background: rgba(var(--join-pink-rgb), .1);
  border-left: 3px solid var(--popraw-pink);
  color: var(--join-muted);
  display: flex;
  flex-direction: column;
  font-size: .76rem;
  gap: 3px;
  line-height: 1.45;
  margin-top: 22px;
  padding: 12px 14px;
}

.join-wizard__notice strong { color: var(--join-strong); }

.join-wizard__actions {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: flex-end;
  margin-top: 25px;
}

.join-wizard__actions .join-form__text-link {
  border: 1px solid var(--join-input-line);
  padding: 13px 18px;
}

.join-benefits-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.join-benefit-item {
  align-items: flex-start;
  border-top: 1px solid var(--join-line-soft);
  display: flex;
  gap: 14px;
  padding: 15px 0 5px;
}

.join-benefit-item__number {
  color: var(--popraw-pink);
  flex: 0 0 auto;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.join-benefit-item p {
  color: var(--join-body);
  font-size: .84rem;
  line-height: 1.45;
  margin: 0;
}

.legal-page {
  background: var(--join-paper);
  color: var(--join-strong);
  font-family: Inter, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.legal-page__container {
  background: var(--join-surface);
  margin: 0 auto;
  max-width: 860px;
  min-height: 100vh;
  padding: 56px clamp(22px, 6vw, 76px) 80px;
}

.legal-page__header {
  border-bottom: 1px solid var(--join-line-soft);
  margin-bottom: 34px;
  padding-bottom: 24px;
}

.legal-page h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  letter-spacing: -.055em;
  line-height: 1;
  margin: 0;
}

.legal-page h2 {
  font-size: 1.15rem;
  margin: 34px 0 10px;
}

.legal-page p,
.legal-page li {
  color: var(--join-body);
  font-size: .94rem;
}

.legal-page__list,
.legal-page__bullets {
  padding-left: 1.25rem;
}

.legal-page__list li { margin-bottom: 16px; }
.legal-page a { color: var(--join-strong); font-weight: 800; }

@media (max-width: 900px) {
  .join-page__layout { grid-template-columns: 1fr; margin-top: 60px; }
  .join-page__intro { position: static; }
  .join-page__intro h1 { max-width: 600px; }
  .join-page__intro p:not(.join-page__eyebrow) { max-width: 600px; }
}

@media (max-width: 560px) {
  .join-page { padding: 18px 16px 32px; }
  .join-page__header { align-items: flex-start; }
  .join-page__layout { margin-top: 48px; }
  .join-page__intro h1 { font-size: clamp(2.4rem, 11.5vw, 3.7rem); }
  .join-form-card { padding: 23px 18px; }
  .join-form__grid { grid-template-columns: 1fr; }
  .join-form__field--wide,
  .join-form__field--consent { grid-column: auto; }
  .join-form__field > label:not(.join-form__consent) { min-height: 0; }
  .join-wizard__paired-field > label:not(.join-form__consent) { min-height: 0; }
  .join-form__field > .join-form__choices { grid-template-columns: 1fr; }
  .join-form__button { width: 100%; }
  .join-wizard__progress { gap: 3px; }
  .join-wizard__progress-item small { display: none; }
  .join-wizard__progress-item > span { width: 27px; height: 27px; }
  .join-wizard__actions { align-items: stretch; flex-direction: column-reverse; }
  .join-wizard__actions .join-form__button,
  .join-wizard__actions .join-form__text-link { text-align: center; width: 100%; }
}
