body.modal-open { overflow: hidden; }

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(34,27,22,.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
  will-change: opacity;
}

.lead-modal[hidden] { display: none; }
.lead-modal.is-open { opacity: 1; visibility: visible; }

.modal-card {
  position: relative;
  contain: layout paint;
  width: min(700px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(34,27,22,.24);
}

.modal-card::before,
.modal-card::after {
  content: "";
  position: fixed;
  width: 46px;
  height: 46px;
  border: 3px solid var(--brand);
  transform: rotate(30deg);
  pointer-events: none;
}
.modal-card::before { right: calc(50% - 500px); top: 11%; }
.modal-card::after { left: calc(50% - 560px); bottom: 13%; }

.modal-close {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}
.modal-close::before,
.modal-close::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 18px;
  width: 16px;
  height: 2px;
  background: var(--graphite-deep);
}
.modal-close::before { transform: rotate(45deg); }
.modal-close::after { transform: rotate(-45deg); }

.modal-hero {
  padding: 24px 42px 20px;
  background:
    radial-gradient(circle at 86% 12%, rgba(243,122,36,.2), transparent 16rem),
    linear-gradient(135deg, var(--graphite), var(--graphite-deep));
  color: #fff;
}

.modal-logo {
  width: fit-content;
  margin-bottom: 16px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  color: #fff;
  font-weight: 900;
  line-height: 1.05;
}

.modal-logo .brand-mark { width: 48px; height: 48px; border-radius: 15px; }
.modal-hero h2 { margin-bottom: 6px; font-size: clamp(28px, 4vw, 38px); color: #fff; }
.modal-hero p { margin-bottom: 12px; color: rgba(255,255,255,.74); font-size: 16px; }

.modal-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.modal-badges span {
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-dark);
  font-weight: 900;
}

.modal-body { padding: 24px 42px 24px; }
.modal-body h3 { margin-bottom: 4px; font-size: 24px; }
.modal-body > p { margin-bottom: 12px; color: var(--muted); font-size: 15px; }
.modal-body label span { margin-bottom: 5px; font-size: 12px; }
.modal-body .form-status { min-height: 0; margin: 8px 0 0; }
.modal-body .legal { margin-top: 15px; font-size: 13px; }
.modal-body .legal + .legal { margin-top: 3px; }
.modal-body.is-success {
  min-height: 220px;
  display: grid;
  place-items: center;
}

.form-success {
  max-width: 430px;
  color: var(--brand-dark);
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 900;
  line-height: 1.08;
  text-align: center;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
}

.modal-body .input {
  min-height: 48px;
  border-radius: 14px;
  background: #fffaf2;
  font-weight: 800;
}

.modal-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  border-radius: 999px;
  font-size: 19px;
}

.agreement-card { width: min(680px, 100%); }
.agreement-hero { padding-bottom: 22px; }
.agreement-body {
  font-size: 16px;
  color: var(--muted);
}
.agreement-body p { margin-bottom: 14px; }
.agreement-body ul {
  margin: 0 0 14px;
  padding-left: 20px;
}
.agreement-body li { margin-bottom: 8px; }

@media (max-width: 760px) {
  .lead-modal { padding: 8px; }
  .modal-card { max-height: calc(100dvh - 16px); border-radius: 22px; }
  .modal-hero, .modal-body { padding: 14px 18px; }
  .modal-logo { margin-bottom: 10px; padding: 0; }
  .modal-logo .brand-mark { width: 38px; height: 38px; }
  .modal-hero h2 { font-size: 26px; }
  .modal-hero p { margin-bottom: 10px; font-size: 14px; }
  .modal-badges span { padding: 6px 12px; font-size: 13px; }
  .modal-body h3 { font-size: 22px; }
  .modal-body > p { margin-bottom: 10px; font-size: 14px; }
  .modal-body label span { margin-bottom: 4px; font-size: 11px; }
  .modal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 8px; }
  .modal-close { right: 14px; top: 14px; }
  .modal-body .input { min-height: 40px; padding: 0 12px; font-size: 13px; }
  .modal-submit { min-height: 46px; margin-top: 10px; font-size: 16px; }
  .modal-body .legal { font-size: 11px; }
}

@media (max-width: 340px) {
  .lead-modal { padding: 6px; }
  .modal-card {
    max-height: calc(100dvh - 12px);
    border-radius: 20px;
  }
  .modal-card::before,
  .modal-card::after {
    display: none;
  }
  .modal-hero,
  .modal-body {
    padding: 12px 14px;
  }
  .modal-logo {
    padding: 0;
    gap: 8px;
    font-size: 13px;
  }
  .modal-logo .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }
  .modal-hero h2 { font-size: 23px; }
  .modal-hero p { font-size: 13px; }
  .modal-badges { gap: 6px; }
  .modal-badges span {
    padding: 5px 9px;
    font-size: 12px;
  }
  .modal-body h3 { font-size: 20px; }
  .modal-body > p { font-size: 13px; }
  .modal-grid { gap: 6px; }
  .modal-body .input {
    min-height: 38px;
    padding: 0 10px;
    font-size: 12px;
  }
  .modal-submit {
    min-height: 44px;
    font-size: 14px;
  }
}
