/*
 * Komponent: formularz na ciemnej (zielonej) karcie.
 *
 * Jedno źródło wyglądu. Wcześniej ten sam zestaw reguł istniał w czterech
 * miejscach pod różnymi selektorami:
 *   - assets/offer-design.css  (hero ofertowy),
 *   - assets/offer-pages.css   (treść stron ofertowych, lista 18 page-id),
 *   - assets/funding.css       (hero hubu finansowania + podstrona programu).
 * Teraz jest tutaj. Pliki kontekstowe ustawiają wyłącznie układ (kolumny,
 * szerokość, odstępy sekcji).
 *
 * Plik ładowany jest po warstwie ofertowej (patrz functions.php), więc nie
 * potrzebuje `!important` do wygrywania z nią.
 */

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form {
  gap: 14px 18px;
  padding: clamp(22px, 2.4vw, 30px);
  border: 1px solid var(--asta-border-on-dark);
  border-radius: var(--asta-radius-md);
  background: var(--asta-gradient-green);
  color: var(--asta-color-white);
  box-shadow: var(--asta-shadow-float);
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form :is(.asta-form__heading, .asta-form__intro, .asta-form__note, .asta-form__success, .asta-form__error, .asta-form > button) {
  grid-column: 1 / -1;
  margin: 0;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form .asta-form__heading {
  margin: 0 !important;
  color: var(--asta-color-white);
  font-size: clamp(1.65rem, 2.2vw, 2rem);
  line-height: 1.2;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form .asta-form__intro {
  margin: 0 0 3px;
  color: rgb(255 255 255 / 94%);
  font-size: .94rem;
  line-height: 1.5;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form .asta-form__field {
  min-width: 0;
  margin: 0;
  gap: 7px;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form .asta-form__field:has(input[type="email"], .asta-form__choice) {
  grid-column: 1 / -1;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form :is(label, .asta-form__intro, .asta-form__note) {
  color: var(--asta-color-white);
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form .asta-form__field label {
  font-size: .9rem;
  line-height: 1.35;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form :is(input:not([type="checkbox"]), textarea, select) {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--asta-input-border-on-dark);
  border-radius: var(--asta-radius-sm);
  background-color: var(--asta-color-white);
  color: #243021;
  font: inherit;
  font-size: 1rem;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form .asta-form__choice {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0;
  color: rgb(255 255 255 / 92%);
  font-weight: 400 !important;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form .asta-form__choice span {
  min-width: 0;
  color: rgb(255 255 255 / 92%);
  font-size: inherit;
  line-height: inherit;
  overflow-wrap: anywhere;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form .asta-form__choice input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--asta-color-white);
}

/* Wysyłka: bezpośrednie dziecko formularza (bloki) albo opakowana w <p> (wpautop). */
:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form > button {
  min-height: 50px;
  margin: 0;
  border-radius: var(--asta-radius-sm);
  background: var(--asta-color-white);
  color: #2f6e1d;
  font-size: 1rem;
  font-weight: 700;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form > button:hover {
  background: var(--asta-color-green-soft);
  color: #275d18;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form > p:has(> input[type="hidden"]) {
  display: none;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form > p:has(> button[type="submit"]) {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form > p > button[type="submit"] {
  width: 100%;
  min-height: 50px;
  margin: 0;
  border-radius: var(--asta-radius-sm);
  background: var(--asta-color-white);
  color: #2f6e1d;
  font-size: 1rem;
  font-weight: 700;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form > p > button[type="submit"]:hover {
  background: var(--asta-color-green-soft);
  color: #275d18;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form .asta-form__error {
  border-radius: var(--asta-radius-sm);
  background: #fff0ed;
  color: #8e2b1b;
}

:is(body.asta-offer-standard .wp-block-post-content, .asta-funding-single__form, .asta-funding-hero__form) .asta-form .asta-form__success {
  border: 1px solid rgb(255 255 255 / 38%);
  border-radius: var(--asta-radius-sm);
  background: rgb(255 255 255 / 14%);
  color: var(--asta-color-white);
}

/* Zgoda: mniejszy tekst w hero ofertowym i na podstronie programu (jak przed konsolidacją). */
:is(body.asta-offer-standard .asta-hero-video__content, .asta-funding-single__form) .asta-form .asta-form__choice {
  font-size: .6875rem;
  line-height: 1.35;
}

@media (max-width: 680px) {
  body.asta-offer-standard .wp-block-post-content .asta-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
    padding: 22px;
  }

  body.asta-offer-standard .wp-block-post-content .asta-form .asta-form__field,
  body.asta-offer-standard .wp-block-post-content .asta-form > button {
    grid-column: 1;
  }
}

@media (max-width: 640px) {
  .asta-funding-single__form .asta-form {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Zachowaj wcześniejszy, ciaśniejszy rytm formularza hubu na mobile. */
  body.page-id-3606 .asta-funding-hero__form .asta-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 18px;
  }
}
