/* KILR overrides for the restored Duda build.
 *
 * Loaded LAST, after every Duda stylesheet. Two jobs:
 *   1. Undo the scroll-animation visibility trap (see below).
 *   2. Style the KILR quote form that replaces Duda's dead form widget.
 *
 * Nothing here restyles Duda's own layout — the point is that the site still
 * looks exactly like the site the client asked for. */

/* ---------------------------------------------------------------------------
 * 1. Scroll-animation visibility trap
 *
 * Duda ships `visibility: hidden` on every element carrying a `data-anim-*`
 * attribute, and relies on a runtime script to add a reveal class when the
 * element scrolls into view. That script lives in a lazily-loaded webpack
 * chunk under /editor/apps/modules/runtime/ which returns 403 from every Duda
 * CDN and 404 from Duda's own origin — it is simply not retrievable, so the
 * reveal never fires.
 *
 * Only 1–2 elements per page carry the attribute, but `visibility` inherits,
 * so each one took its entire subtree down with it: 65 hidden elements on the
 * homepage, 79 on /contact (the whole contact form among them), 41 on
 * /pool-fencing.
 *
 * Forcing them visible drops the entry animations — content appears instead of
 * fading in — and removes the dependency on Duda's runtime entirely, which is
 * the point of a self-hosted restore.
 * ------------------------------------------------------------------------ */
[data-anim-desktop],
[data-anim-mobile],
[data-anim-tablet],
[data-anim-extended] {
  visibility: visible !important;
}

/* ---------------------------------------------------------------------------
 * 2. KILR quote form
 *
 * Duda's form POSTed to /_dm/s/rt/widgets/dmform.submit.jsp with an encrypted
 * recipient blob only Duda could decrypt, so it cannot work off-platform. This
 * form posts to kilr-forms instead and fires the `kilr_form_submit` dataLayer
 * event that GTM trigger 27 listens for.
 *
 * Styled against the values the Duda build actually computes — Inter,
 * #2D2929 body text, 50px pill buttons, #28C3FB brand blue.
 * ------------------------------------------------------------------------ */
.kilr-form {
  --kilr-blue: #28c3fb;
  --kilr-dark: #2d2929;
  font-family: Inter, "Source Sans Pro", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: #fff;
  border-radius: 14px;
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.09);
  width: 100%;
  max-width: 34rem;
  box-sizing: border-box;
}

.kilr-form--onblue { box-shadow: 0 14px 46px rgba(0, 0, 0, 0.18); }

/* On /contact the form drops into Duda's existing white "Request a quote"
 * card, which already carries the logo and heading. Without this the result is
 * a white card inside a white card with two competing headings. */
.kilr-form--bare {
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  max-width: none;
}

.kilr-form_title {
  font-family: Inter, sans-serif;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--kilr-dark);
  margin: 0;
}

.kilr-form_sub {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #5a6165;
  margin: 0;
}

.kilr-form_field { display: flex; flex-direction: column; gap: 0.3rem; }

.kilr-form_label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--kilr-dark);
}

.kilr-form_input {
  font-family: inherit;
  font-size: 1rem;
  color: var(--kilr-dark);
  background: #f7f8f9;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  width: 100%;
  box-sizing: border-box;
  /* 16px min prevents iOS Safari zooming the viewport on focus. */
  min-height: 48px;
}

.kilr-form_input:focus {
  outline: none;
  border-color: var(--kilr-blue);
  box-shadow: 0 0 0 3px rgba(40, 195, 251, 0.18);
}

textarea.kilr-form_input { min-height: 96px; resize: vertical; }

.kilr-form_submit {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--kilr-blue);
  border: 0;
  border-radius: 50px; /* matches Duda's own pill buttons */
  padding: 0.95rem 1.75rem;
  min-height: 48px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.kilr-form_submit:hover { background: #12b2ec; }
.kilr-form_submit:disabled { opacity: 0.65; cursor: default; transform: none; }

.kilr-form_micro { font-size: 0.85rem; color: #5a6165; margin: 0; text-align: center; }
.kilr-form_micro a { color: var(--kilr-blue); text-decoration: none; font-weight: 600; }
.kilr-form_micro a:hover { text-decoration: underline; }

.kilr-form_error {
  font-size: 0.9rem;
  color: #b3261e;
  background: #fdecea;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin: 0;
}

/* Honeypot: hidden from people, still fillable by naive bots. `display:none`
 * is skipped by some bots, so move it out of view instead. */
.kilr-form_hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Inline hero variant on the service pages. */
.kilr-quote-band {
  background: linear-gradient(180deg, #f4f6f7 0%, #e9edef 100%);
  padding: clamp(2rem, 5vw, 3.5rem) 1.25rem;
  display: flex;
  justify-content: center;
}

.kilr-quote-band__inner {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
}

.kilr-quote-band__copy { flex: 1 1 20rem; max-width: 34rem; }

.kilr-quote-band__copy h2 {
  font-family: Inter, sans-serif;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  line-height: 1.15;
  color: var(--kilr-dark, #2d2929);
  margin: 0 0 0.75rem;
}

.kilr-quote-band__copy p {
  font-size: 1rem;
  line-height: 1.6;
  color: #5a6165;
  margin: 0 0 0.5rem;
}

.kilr-quote-band__copy a { color: #28c3fb; font-weight: 600; text-decoration: none; }
.kilr-quote-band__copy a:hover { text-decoration: underline; }
