/* ==========================================================================
   Full-screen form overlays
   ========================================================================== */
.forms-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: stretch;
  justify-content: stretch;
  background: rgba(12, 10, 8, 0.6);
  backdrop-filter: blur(6px);
}

.forms-overlay.is-open {
  display: flex;
}

.forms-overlay__modal {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  border: 0;
  border-radius: 0;
  display: flex; /* centres the content; scrolls from top when taller */
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 234, 217, 0.98)),
    url("../../../img/hero-texture.svg");
  background-size: auto, 300px 300px;
  padding: clamp(1.5rem, 4vw, 3rem);
}

/* hidden modals must stay hidden (author display:flex would otherwise win) */
.forms-overlay__modal[hidden] {
  display: none;
}

/* Perfectly centred content block (auto margins centre it when it fits) */
.forms-overlay__content {
  margin: auto;
  width: min(560px, 100%);
}

.forms-overlay__head {
  text-align: center;
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

.forms-overlay__title {
  font-size: clamp(1.6rem, 3.2vw, 2.15rem);
  line-height: 1.1;
  color: var(--colour-text);
}

.forms-overlay__subtext {
  margin: 0.5rem auto 0;
  max-width: 44ch;
  color: var(--colour-muted);
  font-size: 1rem;
}

.forms-overlay__close {
  position: fixed;
  top: clamp(1rem, 3vw, 1.5rem);
  right: clamp(1rem, 3vw, 1.5rem);
  z-index: 1;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #2d2d2d;
  cursor: pointer;
  box-shadow: 0 8px 20px -14px rgba(0, 0, 0, 0.45);
}

.forms-overlay__close::before {
  content: "";
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.forms-overlay__form {
  display: grid;
  gap: 0.75rem;
  width: 100%;
}

.forms-overlay__form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--colour-text);
}

.forms-overlay__form input:not([type="checkbox"]),
.forms-overlay__form textarea {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  padding: 0.72rem 0.8rem;
  font: inherit;
  color: var(--colour-text);
  background: #fff;
}

/* GDPR consent checkbox */
.forms-overlay__form .forms-overlay__consent {
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: start;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--colour-muted);
  line-height: 1.5;
}

.forms-overlay__consent-check {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  accent-color: var(--colour-accent);
  cursor: pointer;
}

.forms-overlay__consent a {
  color: var(--colour-accent);
  font-weight: 600;
}

.forms-overlay__form textarea {
  resize: vertical;
}

.forms-overlay__form .btn {
  width: 100%;
  margin-top: 0.35rem;
}

.forms-overlay__submit--pricing {
  color: #fff;
  border-color: rgba(0, 0, 0, 0.4);
  background-image: linear-gradient(180deg, #3f83c9 0%, #23578f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 3px 0 rgba(0, 0, 0, 0.32);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.forms-overlay__submit--advisory {
  color: #fff;
  border-color: rgba(0, 0, 0, 0.4);
  background-image: linear-gradient(180deg, #d98324 0%, #a85e12 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 3px 0 rgba(0, 0, 0, 0.32);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
}

/* Confirmation shown only after Static.app confirms a stored submission. */
.form-success-notice {
  position: fixed;
  z-index: 400;
  right: 1rem;
  bottom: 1rem;
  width: min(28rem, calc(100% - 2rem));
  padding: 1rem 1.2rem;
  color: #fff;
  background: #185b43;
  border-radius: 10px;
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.8);
  opacity: 0;
  translate: 0 0.75rem;
  transition: opacity 0.2s ease, translate 0.2s ease;
}

.form-success-notice.is-visible {
  opacity: 1;
  translate: 0;
}

@media (prefers-reduced-motion: reduce) {
  .form-success-notice {
    transition: none;
  }
}
