/* Wspólne style formularzy Fundacji (kontakt, dla firm, darowizna). Tokeny --fdt-* z motywu, z wartościami zastępczymi. */
.fdt-form {
  --f-ink: var(--fdt-ink, #0a1620);
  --f-mute: var(--fdt-mute, #4f6370);
  --f-brand: var(--fdt-brand-ink, #086a92);
  --f-warm: var(--fdt-warm, #ff9242);
  --f-edge: #5f7684;
  --f-line: #d3dde2;
  --f-radius: var(--fdt-radius, 6px);
  font-family: var(--fdt-font, inherit);
  color: var(--f-ink);
  line-height: 1.55;
}

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

.fdt-form [hidden] {
  display: none;
}

.fdt-form__head {
  margin: 0 0 18px;
}

.fdt-form__title {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
  line-height: 1.2;
  color: var(--f-ink);
}

.fdt-form__intro {
  margin: 0;
  max-width: 62ch;
  color: var(--f-mute);
}

.fdt-form__form {
  display: grid;
  gap: 18px;
}

.fdt-form__row {
  display: grid;
  gap: 18px;
}

@media (min-width: 720px) {
  .fdt-form__row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Pola */
.fdt-field {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fdt-field label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--f-ink);
}

.fdt-field label small,
.fdt-field__help {
  font-weight: 400;
  color: var(--f-mute);
}

.fdt-field__help {
  font-size: 0.85rem;
}

.fdt-field input[type="text"],
.fdt-field input[type="email"],
.fdt-field input[type="tel"],
.fdt-field select,
.fdt-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 2px solid var(--f-edge);
  border-radius: var(--f-radius);
  background: #fff;
  color: var(--f-ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
}

.fdt-field textarea {
  min-height: 160px;
  resize: vertical;
}

.fdt-field select {
  appearance: auto;
}

.fdt-field input:focus-visible,
.fdt-field select:focus-visible,
.fdt-field textarea:focus-visible {
  outline: 3px solid var(--f-brand);
  outline-offset: 2px;
  border-color: var(--f-brand);
}

.fdt-req {
  color: #a4262c;
}

/* Zgody */
.fdt-check {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
}

.fdt-check input[type="checkbox"] {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 10px 0 0;
  accent-color: var(--f-brand);
}

.fdt-check label {
  padding: 8px 0;
  font-size: 0.95rem;
  cursor: pointer;
}

.fdt-check a {
  color: var(--f-brand);
  text-decoration: underline;
}

.fdt-check input:focus-visible {
  outline: 3px solid var(--f-brand);
  outline-offset: 2px;
}

/* Pułapka dla automatów: poza ekranem, bez display:none */
.fdt-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Komunikaty */
.fdt-form__notice {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-left: 5px solid var(--f-edge);
  border-radius: var(--f-radius);
  background: #eef3f5;
  color: var(--f-ink);
  font-weight: 500;
}

.fdt-form__notice.is-ok {
  border-left-color: #1f7a3d;
  background: #e6f4ea;
  color: #0a3d1a;
}

.fdt-form__notice.is-error {
  border-left-color: #b3261e;
  background: #fdecea;
  color: #6b0f0a;
}

.fdt-form__notice.is-warn {
  border-left-color: #b86500;
  background: #fff4e0;
  color: #5a3100;
}

/* Przyciski wysyłki: własny wygląd formularzy */
.fdt-form__actions {
  margin: 4px 0 0;
}

.fdt-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 28px;
  border: 2px solid var(--f-brand);
  border-radius: var(--f-radius);
  background: var(--f-brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
}

.fdt-form__submit:hover {
  filter: brightness(1.1);
}

.fdt-form__submit:focus-visible {
  outline: 3px solid var(--f-ink);
  outline-offset: 3px;
}

.fdt-form__submit:disabled {
  opacity: 0.7;
  cursor: progress;
}

@media (max-width: 480px) {
  .fdt-form__submit {
    width: 100%;
  }
}

/* Zapasowy wygląd przycisków motywu (klasy fdt-btn), gdy motyw Fundacji nie jest aktywny.
   Warstwa przegrywa z każdym niezależnym stylem motywu, więc motyw zawsze ma pierwszeństwo. */
@layer fdt-fallback {
  .fdt-form .fdt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 11px 22px;
    border: 2px solid transparent;
    border-radius: var(--fdt-radius, 6px);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.2;
  }

  .fdt-form .fdt-btn--primary {
    background: var(--fdt-brand-ink, #086a92);
    border-color: var(--fdt-brand-ink, #086a92);
    color: #fff;
  }

  .fdt-form .fdt-btn--donate {
    background: var(--fdt-warm, #ff9242);
    border-color: var(--fdt-warm, #ff9242);
    color: var(--fdt-ink, #0a1620);
  }

  .fdt-form .fdt-btn--ghost {
    background: transparent;
    border-color: var(--fdt-brand-ink, #086a92);
    color: var(--fdt-brand-ink, #086a92);
  }
}

.fdt-form .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
