.wa-modal[hidden],
.wa-toast[hidden],
.wa-modal__error[hidden],
.wa-modal__fallback[hidden] {
  display: none !important;
}

.wa-modal {
  --wa-primary: var(--primary, #1D2D44);
  --wa-accent: var(--accent, #C8A96E);
  --wa-text: var(--text-light, #5A6A7E);
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  font-family: var(--font-sans, Inter, "Segoe UI", sans-serif);
}

body.wa-modal-open { overflow: hidden; }

.wa-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 26, 46, .72);
}

.wa-modal__dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: min(92vh, 820px);
  overflow: auto;
  background: #fff;
  color: var(--wa-primary);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(29, 45, 68, .18);
  padding: 1.75rem 1.5rem 1.5rem;
}

.wa-modal__close {
  position: absolute;
  top: .85rem;
  right: .85rem;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: #F0F2F5;
  color: var(--wa-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wa-modal__close:hover { background: #E2E6EA; }

.wa-modal__kicker {
  margin: 0 0 .35rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--wa-accent);
}

.wa-modal h2 {
  margin: 0 2rem .5rem 0;
  font-family: var(--font-serif, "Playfair Display", Georgia, serif);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--wa-primary);
}

.wa-modal__lead {
  margin: 0 0 1.15rem;
  color: var(--wa-text);
  font-size: .95rem;
  line-height: 1.55;
}

.wa-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.wa-modal__field { margin-bottom: .75rem; }

.wa-modal__field label,
.wa-modal__check {
  display: block;
  margin-bottom: .35rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--wa-primary);
}

.wa-modal__field label span {
  font-weight: 500;
  color: var(--wa-text);
}

.wa-modal input[type="text"],
.wa-modal input[type="tel"],
.wa-modal input[type="email"],
.wa-modal textarea {
  width: 100%;
  border: 1px solid #E2E6EA;
  background: #fff;
  color: var(--wa-primary);
  border-radius: 8px;
  padding: .7rem .8rem;
  font: inherit;
  font-size: .95rem;
}

.wa-modal textarea { resize: vertical; min-height: 96px; }

.wa-modal input:focus,
.wa-modal textarea:focus {
  outline: 2px solid var(--wa-accent);
  outline-offset: 1px;
  border-color: var(--wa-accent);
}

.wa-modal__hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.wa-modal__check {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin: .35rem 0 1rem;
  font-weight: 500;
  line-height: 1.45;
}

.wa-modal__check input { margin-top: .2rem; }

.wa-modal__check a {
  color: var(--wa-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wa-modal__error {
  margin: 0 0 .75rem;
  color: #8C3A32;
  font-size: .88rem;
}

.wa-modal__submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 0;
  border-radius: 8px;
  background: var(--wa-primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: .85rem 1rem;
  cursor: pointer;
}

.wa-modal__submit:hover { background: #2A4060; }
.wa-modal__submit:disabled { opacity: .7; cursor: wait; }

.wa-modal__fallback {
  margin: .85rem 0 0;
  text-align: center;
  color: var(--wa-text);
  font-size: .9rem;
}

.wa-modal__fallback a {
  color: var(--wa-primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wa-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 11001;
  width: min(440px, calc(100% - 32px));
  background: #1D2D44;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(29, 45, 68, .25);
  padding: .9rem 1rem;
  font-family: var(--font-sans, Inter, "Segoe UI", sans-serif);
}

.wa-toast p { margin: 0 0 .35rem; color: #fff; }
.wa-toast a { color: #C8A96E; font-weight: 700; }

.wa-modal .eblaw-recaptcha {
  margin: .55rem 0 .75rem;
  min-height: 78px;
  display: flex;
  justify-content: flex-start;
}
.wa-modal .eblaw-recaptcha .g-recaptcha {
  transform-origin: left center;
}

@media (max-width: 640px) {
  .wa-modal { padding: .75rem; }
  .wa-modal__dialog { padding: 1.35rem 1rem 1rem; }
  .wa-modal__row { grid-template-columns: 1fr; }
  .wa-modal h2 { font-size: 1.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  .wa-modal,
  .wa-modal__dialog { scroll-behavior: auto; }
}
