/* ------------------------------------------------------------------
   Section: campaign contact form
   Block: vibo/campaign-form

   Self-contained on purpose: the popup form in custom.css is a narrow
   four-field form and its rules (14px labels, 11px consent text, 45px
   textarea) do not fit a page-width form. Everything here is scoped to
   .campaign-form so the popup keeps its own look.

   Mobile-first: the base rules are the phone layout, the media queries
   only widen it.
   ------------------------------------------------------------------ */

:is(.vibo-main, .acf-block-preview) .campaign-section {
  padding: 48px 0;
}

:is(.vibo-main, .acf-block-preview) .campaign-card {
  overflow: hidden;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(20, 78, 87, 0.12);
}

/* ---------- left column: who you are writing to ---------- */

:is(.vibo-main, .acf-block-preview) .campaign-card__intro {
  --intro-px: 24px;
  --intro-py: 32px;

  display: flex;
  flex-direction: column;
  padding: var(--intro-py) var(--intro-px);
  background: #d9ecea;
  color: #144e57;
}

/* The render sits at the foot of the column and bleeds back out of its
   padding, so it meets the card's own edges. On a phone the column is just a
   header above the form and the picture would only push the first field off
   the screen, so it starts at tablet width. */
:is(.vibo-main, .acf-block-preview) .campaign-card__image {
  display: none;
  margin: 32px calc(-1 * var(--intro-px)) calc(-1 * var(--intro-py));
}

:is(.vibo-main, .acf-block-preview) .campaign-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

:is(.vibo-main, .acf-block-preview) .campaign-card__title {
  margin: 0 0 16px;
  color: #000;
  font-family: "Actay Wide", sans-serif;
  font-size: 28px;
  line-height: 120%;
}

:is(.vibo-main, .acf-block-preview) .campaign-card__text {
  margin: 0 0 28px;
  color: #000;
  font-family: Pais, sans-serif;
  font-size: 18px;
  line-height: 140%;
}

:is(.vibo-main, .acf-block-preview) .campaign-card__intro .contact-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

:is(.vibo-main, .acf-block-preview) .campaign-card__intro .contact-item p,
:is(.vibo-main, .acf-block-preview) .campaign-card__intro .contact-item a {
  margin: 0;
  color: #144e57;
  font-family: Pais, sans-serif;
  font-size: 16px;
  line-height: 130%;
  text-decoration: none;
}

:is(.vibo-main, .acf-block-preview) .campaign-card__intro .contact-item a:hover {
  text-decoration: underline;
}

/* ---------- right column: the form ---------- */

:is(.vibo-main, .acf-block-preview) .campaign-card__body {
  padding: 32px 24px;
}

:is(.vibo-main, .acf-block-preview) .campaign-card__note {
  margin: 20px 0 0;
  color: #6b7b7e;
  font-family: Pais, sans-serif;
  font-size: 16px;
  line-height: 140%;
}

/* minmax(0, 1fr), not plain 1fr: a plain fraction never shrinks below its
   content, and a dropdown summary with every option ticked is one long
   unbreakable line — it would widen its column and push the neighbouring
   one out of the card. */
:is(.vibo-main, .acf-block-preview) .campaign-form .cform {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__field {
  min-width: 0;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__field > label,
:is(.vibo-main, .acf-block-preview) .campaign-form .cform__label {
  display: block;
  margin-bottom: 8px;
  color: #144e57;
  font-family: Pais, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 130%;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__req {
  color: #bb5131;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__hint {
  display: block;
  margin-top: 6px;
  color: #6b7b7e;
  font-family: Pais, sans-serif;
  font-size: 16px;
  line-height: 130%;
}

:is(.vibo-main, .acf-block-preview) .campaign-form input[type="text"],
:is(.vibo-main, .acf-block-preview) .campaign-form input[type="email"],
:is(.vibo-main, .acf-block-preview) .campaign-form input[type="tel"],
:is(.vibo-main, .acf-block-preview) .campaign-form textarea {
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #d7e2e1;
  border-radius: 12px;
  background: #f6faf9;
  color: #000;
  font-family: Pais, sans-serif;
  font-size: 18px;
  line-height: 130%;
}

/* Most people leave the message empty, so it opens at three rows and the rest
   of the form stays in sight; whoever has something to write scrolls inside it
   or drags it taller. */
:is(.vibo-main, .acf-block-preview) .campaign-form textarea {
  height: auto;
  min-height: 0;
  resize: vertical;
}

:is(.vibo-main, .acf-block-preview) .campaign-form input:focus,
:is(.vibo-main, .acf-block-preview) .campaign-form textarea:focus,
:is(.vibo-main, .acf-block-preview) .campaign-form .cselect__toggle:focus-visible {
  outline: 2px solid #144e57;
  outline-offset: 1px;
}

/* ---------- the three choice fields ---------- */

/* Without JavaScript the checkboxes stay a plain list, so the form still
   works; the script folds them into the dropdown below. */
:is(.vibo-main, .acf-block-preview) .campaign-form .cform__choices .wpcf7-list-item {
  display: block;
  margin: 0;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__choices .wpcf7-list-item label {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 12px 16px;
  color: #000;
  font-family: Pais, sans-serif;
  font-size: 18px;
  line-height: 130%;
  cursor: pointer;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__choices .wpcf7-list-item label:hover {
  background: #f1f7f6;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__choices input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  accent-color: #144e57;
}

/* A one-answer group (Contact Form 7's «exclusive» checkboxes) gets round
   marks: square boxes that untick each other read as a bug, a round mark reads
   as «pick one» before the visitor even tries. No field uses it since «Tipo de
   vivienda» became a multiple field in Unlatch (2026-10-26); add `exclusive`
   to a checkbox tag in the form and it looks and behaves like this again. */
:is(.vibo-main, .acf-block-preview) .campaign-form .cform__choices.wpcf7-exclusive-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  margin: 0;
  border: 2px solid #9fb3b5;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__choices.wpcf7-exclusive-checkbox input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #144e57;
  transform: scale(0);
  transition: transform 0.15s ease;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__choices.wpcf7-exclusive-checkbox input[type="checkbox"]:checked {
  border-color: #144e57;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__choices.wpcf7-exclusive-checkbox input[type="checkbox"]:checked::before {
  transform: scale(1);
}

/* custom.css ticks every checked checkbox with a ::after check mark; a round
   mark takes the dot alone */
:is(.vibo-main, .acf-block-preview) .campaign-form .cform__choices.wpcf7-exclusive-checkbox input[type="checkbox"]::after {
  content: none;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__choices.wpcf7-exclusive-checkbox input[type="checkbox"]:focus-visible {
  outline: 2px solid #144e57;
  outline-offset: 2px;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__choices .wpcf7-list-item-label {
  font-family: Pais, sans-serif;
  font-size: 18px;
  line-height: 130%;
}

/* a choice the chosen promotions do not offer */
:is(.vibo-main, .acf-block-preview) .campaign-form .wpcf7-list-item.is-hidden {
  display: none;
}

/* ---------- dropdown built by campaign-form.js ---------- */

:is(.vibo-main, .acf-block-preview) .campaign-form .cselect {
  position: relative;
}

/* The arrow and the clear button are pinned to the right edge rather than laid
   out in the flow, so the summary of what is ticked can use the whole width
   and simply fade out under them. */
:is(.vibo-main, .acf-block-preview) .campaign-form .cselect__toggle {
  position: relative;
  display: block;
  width: 100%;
  padding: 14px 76px 14px 16px;
  border: 1px solid #d7e2e1;
  border-radius: 12px;
  background: #f6faf9;
  color: #000;
  font-family: Pais, sans-serif;
  font-size: 18px;
  line-height: 130%;
  text-align: left;
  cursor: pointer;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cselect__toggle[aria-expanded="true"] {
  border-color: #144e57;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cselect__value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cselect__value--empty {
  color: #7d8d90;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cselect__arrow {
  position: absolute;
  top: 50%;
  right: 16px;
  margin-top: -4px;
  transition: transform 0.2s ease;
}

/* Undo a long list of ticks in one go. It appears only once something is
   chosen, so an empty field never offers to empty itself. */
:is(.vibo-main, .acf-block-preview) .campaign-form .cselect__clear {
  position: absolute;
  top: 14px;
  right: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6b7b7e;
  cursor: pointer;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cselect__clear:hover,
:is(.vibo-main, .acf-block-preview) .campaign-form .cselect__clear:focus-visible {
  background: #e4efed;
  color: #144e57;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cselect__clear[hidden] {
  display: none;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cselect__toggle[aria-expanded="true"] .cselect__arrow {
  transform: rotate(180deg);
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cselect__value {
  display: block;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cselect__panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: none;
  overflow-y: auto;
  max-height: 280px;
  padding: 6px 0;
  border: 1px solid #d7e2e1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(20, 78, 87, 0.16);
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cselect--open .cselect__panel {
  display: block;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cselect__empty {
  margin: 0;
  padding: 12px 16px;
  color: #7d8d90;
  font-family: Pais, sans-serif;
  font-size: 16px;
  line-height: 130%;
}

/* ---------- consent and submit ---------- */

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__consent .wpcf7-list-item {
  display: block;
  margin: 0;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__consent .wpcf7-list-item label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0;
  cursor: pointer;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__consent input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: #144e57;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__consent .wpcf7-list-item-label {
  color: #3f4f52;
  font-family: Pais, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 135%;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .cform__consent a {
  color: #144e57;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .wpcf7-submit {
  width: 100%;
  margin: 0;
  padding: 16px 32px;
  font-family: Pais, sans-serif;
  font-size: 18px;
}

/* the honeypot: never shown, never read out, never tabbed into */
:is(.vibo-main, .acf-block-preview) .campaign-form .cform__trap {
  position: absolute !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  width: 1px;
  height: 1px;
  white-space: nowrap;
}

:is(.vibo-main, .acf-block-preview) .campaign-form .wpcf7-not-valid-tip {
  margin-top: 6px;
  color: #bb5131;
  font-family: Pais, sans-serif;
  font-size: 16px;
  line-height: 130%;
}

/* ---------- wider screens ---------- */

@media (min-width: 768px) {
  :is(.vibo-main, .acf-block-preview) .campaign-card__intro {
    --intro-px: 32px;
    --intro-py: 40px;
  }

  :is(.vibo-main, .acf-block-preview) .campaign-card__body {
    padding: 40px 32px;
  }

  :is(.vibo-main, .acf-block-preview) .campaign-card__image {
    display: block;
    height: 240px;
  }

  :is(.vibo-main, .acf-block-preview) .campaign-form .cform {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :is(.vibo-main, .acf-block-preview) .campaign-form .cform__field--full {
    grid-column: 1 / -1;
  }

  :is(.vibo-main, .acf-block-preview) .campaign-form .wpcf7-submit {
    width: auto;
    min-width: 220px;
  }
}

@media (min-width: 992px) {
  :is(.vibo-main, .acf-block-preview) .campaign-card__image {
    flex: 1 1 auto;
    height: auto;
    min-height: 220px;
  }
}

@media (min-width: 1024px) {
  :is(.vibo-main, .acf-block-preview) .campaign-section {
    padding: 64px 0;
  }

  :is(.vibo-main, .acf-block-preview) .campaign-card__intro {
    --intro-px: 40px;
    --intro-py: 56px;
  }

  :is(.vibo-main, .acf-block-preview) .campaign-card__body {
    padding: 56px 48px;
  }

  :is(.vibo-main, .acf-block-preview) .campaign-card__title {
    font-size: 33px;
  }
}

@media (min-width: 1440px) {
  :is(.vibo-main, .acf-block-preview) .campaign-section {
    padding: 100px 0;
  }
}
