/* ═══════════════════════════════════════════════════
   My Heart Care — Lead Magnet Popup
   Scoped under .mhc-popup-* to avoid host conflicts
   ═══════════════════════════════════════════════════ */

/* — Overlay — */
.mhc-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 27, 56, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mhc-popup-overlay.is-visible {
  display: flex;
  opacity: 1;
}
.mhc-popup-overlay.is-closing {
  opacity: 0;
}

/* Hide sticky CTA while popup is open */
body.popup-open .sticky-cta { display: none !important; }

/* — Dialog — */
.mhc-popup-dialog {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(940px, calc(100vw - 40px));
  max-height: min(88vh, 700px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 43, 92, 0.22);
  overflow: hidden;
  animation: mhc-popup-enter 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes mhc-popup-enter {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.mhc-popup-overlay.is-closing .mhc-popup-dialog {
  animation: mhc-popup-exit 0.25s ease forwards;
}
@keyframes mhc-popup-exit {
  to { opacity: 0; transform: scale(0.97) translateY(8px); }
}

/* — Close button — */
.mhc-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 43, 92, 0.08);
  color: #002B5C;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.15s;
  line-height: 1;
}
.mhc-popup-close:hover { background: rgba(0, 43, 92, 0.15); transform: scale(1.08); }
.mhc-popup-close:focus-visible { outline: 3px solid #0057B8; outline-offset: 2px; }

/* — Image column — */
.mhc-popup-image-col {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #002B5C 0%, #004C97 100%);
}
.mhc-popup-image-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mhc-popup-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  background: #009739;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 151, 57, 0.3);
  text-transform: uppercase;
  z-index: 1;
}
.mhc-popup-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 43, 92, 0.4) 100%);
  pointer-events: none;
}

/* — Content column — */
.mhc-popup-content {
  display: flex;
  flex-direction: column;
  padding: 28px 28px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Drag handle (mobile) */
.mhc-popup-drag-handle {
  display: none;
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: rgba(0, 43, 92, 0.18);
  margin: 0 auto 16px;
  flex-shrink: 0;
}

/* — Header — */
.mhc-popup-kicker {
  display: inline-block;
  background: #E3F0FA;
  color: #004C97;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 14px;
  margin-bottom: 10px;
}
.mhc-popup-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #002B5C;
  line-height: 1.25;
  margin-bottom: 8px;
}
.mhc-popup-subtitle {
  font-size: 0.88rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 14px;
}

/* — Bullets — */
.mhc-popup-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}
.mhc-popup-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.84rem;
  color: #333;
  line-height: 1.5;
  padding: 3px 0;
}
.mhc-popup-bullets li svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  stroke: #009739;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* — Form — */
.mhc-popup-form { display: flex; flex-direction: column; gap: 10px; }

.mhc-popup-field { display: flex; flex-direction: column; gap: 3px; }

.mhc-popup-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #333;
}
.mhc-popup-field label .mhc-popup-req { color: #c0392b; margin-left: 2px; }

.mhc-popup-field input[type="text"],
.mhc-popup-field input[type="tel"],
.mhc-popup-field input[type="email"],
.mhc-popup-field select,
.mhc-popup-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #E0E5EB;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  color: #333;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.mhc-popup-field input:focus,
.mhc-popup-field select:focus,
.mhc-popup-field textarea:focus {
  outline: none;
  border-color: #004C97;
  box-shadow: 0 0 0 3px rgba(0, 76, 151, 0.1);
}
.mhc-popup-field.has-error input,
.mhc-popup-field.has-error select,
.mhc-popup-field.has-error textarea {
  border-color: #c0392b;
}
.mhc-popup-field .mhc-popup-error-msg {
  font-size: 0.74rem;
  color: #c0392b;
  display: none;
}
.mhc-popup-field.has-error .mhc-popup-error-msg { display: block; }

.mhc-popup-field textarea { resize: vertical; min-height: 52px; }

/* Honeypot — visually hidden */
.mhc-popup-hp {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Radio group */
.mhc-popup-radio-group { display: flex; flex-direction: column; gap: 6px; }
.mhc-popup-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #333;
  cursor: pointer;
}
.mhc-popup-radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: #004C97;
  cursor: pointer;
  flex-shrink: 0;
}

/* — CTA row — */
.mhc-popup-cta-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.mhc-popup-btn-primary,
.mhc-popup-btn-secondary {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  border: none;
  white-space: normal;
  line-height: 1.3;
}
.mhc-popup-btn-primary {
  background: #004C97;
  color: #fff;
}
.mhc-popup-btn-primary:hover { background: #003A73; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 76, 151, 0.25); }
.mhc-popup-btn-secondary {
  background: transparent;
  color: #004C97;
  border: 2px solid #004C97;
}
.mhc-popup-btn-secondary:hover { background: #E3F0FA; }

.mhc-popup-btn-primary:disabled,
.mhc-popup-btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* — Privacy text — */
.mhc-popup-privacy {
  font-size: 0.72rem;
  color: #999;
  line-height: 1.5;
  margin-top: 8px;
  text-align: center;
}

/* — Emotional bridge — */
.mhc-popup-bridge {
  font-size: 0.84rem;
  color: #555;
  font-style: italic;
  text-align: center;
  margin-top: 6px;
  margin-bottom: 2px;
  line-height: 1.5;
}

/* — Action phrase — */
.mhc-popup-action-phrase {
  font-size: 0.88rem;
  font-weight: 700;
  color: #002B5C;
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.4;
}

/* — Success state — */
.mhc-popup-success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0;
  gap: 12px;
}
.mhc-popup-success.is-visible { display: flex; }
.mhc-popup-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #E3F0FA;
  display: grid;
  place-items: center;
}
.mhc-popup-success-icon svg { width: 28px; height: 28px; stroke: #004C97; fill: none; stroke-width: 2; }
.mhc-popup-success h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: #002B5C;
  margin: 0;
}
.mhc-popup-success p {
  font-size: 0.88rem;
  color: #666;
  line-height: 1.6;
  max-width: 320px;
}
.mhc-popup-success-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #004C97;
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  margin-top: 4px;
}
.mhc-popup-success-phone:hover { background: #003A73; }
.mhc-popup-success-phone svg { width: 16px; height: 16px; fill: #fff; }

/* — Success: website link — */
.mhc-popup-success-website {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #004C97;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  margin-top: 2px;
}
.mhc-popup-success-website:hover { text-decoration: underline; }
.mhc-popup-success-website svg { width: 16px; height: 16px; stroke: #004C97; fill: none; }

/* — Success: schedule button — */
.mhc-popup-success-schedule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #009739;
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  margin-top: 4px;
  transition: background 0.2s;
}
.mhc-popup-success-schedule:hover { background: #007a2e; }
.mhc-popup-success-schedule svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; }

/* — Error state — */
.mhc-popup-form-error {
  display: none;
  background: #FFF5F5;
  border: 1px solid #FED7D7;
  color: #C53030;
  font-size: 0.84rem;
  padding: 10px 14px;
  border-radius: 8px;
  line-height: 1.5;
}
.mhc-popup-form-error.is-visible { display: block; }

/* ═══════════ RESPONSIVE ═══════════ */

@media (max-width: 768px) {
  .mhc-popup-overlay.is-visible {
    align-items: flex-end;
  }

  .mhc-popup-dialog {
    grid-template-columns: 1fr;
    width: 100%;
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
    animation: mhc-popup-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  @keyframes mhc-popup-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .mhc-popup-overlay.is-closing .mhc-popup-dialog {
    animation: mhc-popup-slide-down 0.25s ease forwards;
  }
  @keyframes mhc-popup-slide-down {
    to { transform: translateY(100%); }
  }

  .mhc-popup-image-col { display: none; }

  .mhc-popup-drag-handle { display: block; }

  .mhc-popup-content {
    padding: 16px 20px 24px;
  }

  .mhc-popup-content h2 { font-size: 1.2rem; }

  .mhc-popup-cta-row {
    flex-direction: column;
  }

  .mhc-popup-close {
    top: 10px;
    right: 10px;
    background: rgba(0, 43, 92, 0.12);
  }

  .mhc-popup-success-website,
  .mhc-popup-success-schedule {
    font-size: 0.84rem;
    padding: 8px 16px;
  }
}

@media (max-width: 480px) {
  .mhc-popup-content {
    padding: 12px 16px 20px;
  }
  .mhc-popup-content h2 { font-size: 1.1rem; }
  .mhc-popup-subtitle { font-size: 0.82rem; }
  .mhc-popup-bullets li { font-size: 0.8rem; }
  .mhc-popup-btn-primary,
  .mhc-popup-btn-secondary {
    padding: 12px 16px;
    font-size: 0.92rem;
  }
}
