/* =====================================================
   POPUP "RECIBE EL BROCHURE POR CORREO"
   Compartido por todas las páginas de proyecto.
   Usa --primary-color / --primary-hover de cada página
   (con fallback al cian de marca CEINYS) para que el
   acento del popup combine con la identidad de cada proyecto.
   ===================================================== */
.brochure-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 0s linear 220ms;
}
.brochure-modal.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 220ms ease, visibility 0s linear 0s;
}
.brochure-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 18, 20, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.brochure-modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(17, 18, 20, 0.28), 0 4px 12px rgba(17, 18, 20, 0.08);
  padding: 40px 32px 28px;
  text-align: center;
  transform: translateY(18px) scale(0.97);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
}
.brochure-modal.open .brochure-modal-card {
  transform: translateY(0) scale(1);
}
.brochure-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: #F4F4F5;
  color: #55575D;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.brochure-modal-close:hover { background: #E9E9EC; color: #1B1D22; }
.brochure-modal-close svg { width: 16px; height: 16px; stroke-width: 2; }

.brochure-modal-icon {
  width: 56px; height: 56px;
  border-radius: 999px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  background: #EAF6FC;
  background: color-mix(in srgb, var(--primary-color, #17AEE6) 12%, white);
  color: var(--primary-color, #17AEE6);
}
.brochure-modal-icon svg { width: 26px; height: 26px; stroke-width: 1.8; }
.brochure-modal-icon.success {
  background: #E4F5EB;
  background: color-mix(in srgb, #1E9E5A 14%, white);
  color: #1E9E5A;
}
.brochure-modal-icon.whatsapp {
  background: #E7F9EE;
  background: color-mix(in srgb, #25D366 14%, white);
  color: #25D366;
}

.brochure-modal-card h3 {
  font-size: 21px; font-weight: 800; line-height: 1.25;
  color: #1B1D22; margin: 0 0 8px;
}
.brochure-modal-desc, .brochure-modal-success-msg {
  font-size: 14.5px; line-height: 1.55;
  color: #6B6D74; margin: 0 0 22px;
}
.brochure-modal-success-msg strong { color: #1B1D22; }

.brochure-modal-form { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.brochure-modal-field { display: flex; flex-direction: column; gap: 6px; }
.brochure-modal-field span {
  font-size: 12px; font-weight: 600; letter-spacing: 0.03em;
  text-transform: uppercase; color: #8A8C92;
}
.brochure-modal-field input {
  font: 500 16px/1.4 'Montserrat', sans-serif;
  padding: 13px 14px;
  border: 1px solid #E3E4E8;
  border-radius: 10px;
  background: #F8F8F9;
  color: #1B1D22;
  transition: border-color 140ms ease, background 140ms ease;
}
.brochure-modal-field input::placeholder { color: #ACAEB4; }
.brochure-modal-field input:focus {
  outline: none;
  border-color: var(--primary-color, #17AEE6);
  background: #fff;
}
.brochure-modal-form.invalid .brochure-modal-field input {
  border-color: #D64545;
}
.brochure-modal-error {
  font-size: 12.5px; color: #D64545; margin: 2px 0 0;
}

.brochure-modal-submit {
  margin-top: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border: none; border-radius: 10px;
  background: var(--primary-color, #17AEE6);
  color: #fff;
  font: 700 14.5px/1 'Montserrat', sans-serif;
  cursor: pointer;
  transition: background 160ms ease, opacity 160ms ease;
}
.brochure-modal-submit:hover { background: var(--primary-hover, #1290C1); }
.brochure-modal-submit:disabled { opacity: 0.7; cursor: default; }

.brochure-modal-spinner {
  width: 16px; height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  animation: brochureSpin 700ms linear infinite;
}
@keyframes brochureSpin { to { transform: rotate(360deg); } }

.brochure-modal-legal {
  font-size: 11.5px; color: #ACAEB4; margin: 14px 0 0;
}

.brochure-modal-fallback-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--primary-color, #17AEE6);
  font-weight: 700; font-size: 14px;
  text-decoration: none;
}
.brochure-modal-fallback-link:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .brochure-modal-card { padding: 32px 22px 24px; border-radius: 18px; }
}
