/**
 * MailzMazivo - Estilos del Formulario de Suscripción Frontend
 * Autor: Julian Duarte
 */

.mailzmazivo-form-container {
  width: 100%;
  max-width: 580px;
  margin: 30px auto;
  border-radius: 16px;
  overflow: hidden;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: all 0.3s ease;
}

/* Tema Moderno */
.mailzmazivo-form-container.theme-modern {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
  padding: 36px 32px;
}

.mailzmazivo-form-container.theme-modern .mz-pub-title {
  color: #2b2840;
}
.mailzmazivo-form-container.theme-modern .mz-pub-subtitle {
  color: #64748b;
}

/* Tema Dark */
.mailzmazivo-form-container.theme-dark {
  background: linear-gradient(135deg, #2b2840 0%, #1e293b 100%);
  border: 1px solid #334155;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
  padding: 36px 32px;
  color: #f8fafc;
}

.mailzmazivo-form-container.theme-dark .mz-pub-title {
  color: #ffffff;
}
.mailzmazivo-form-container.theme-dark .mz-pub-subtitle {
  color: #94a3b8;
}
.mailzmazivo-form-container.theme-dark .mz-pub-input {
  background: #1e293b;
  border-color: #475569;
  color: #ffffff;
}

/* Tema Minimal */
.mailzmazivo-form-container.theme-minimal {
  background: transparent;
  border: 1px dashed #cbd5e1;
  padding: 24px;
}

/* Encabezados del Formulario */
.mz-pub-header {
  text-align: center;
  margin-bottom: 24px;
}

.mz-pub-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.mz-pub-subtitle {
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}

/* Campos */
.mz-pub-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mz-pub-row {
  display: flex;
  gap: 12px;
}

@media (max-width: 600px) {
  .mz-pub-row {
    flex-direction: column;
  }
}

.mz-pub-input {
  flex: 1;
  padding: 13px 18px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 15px;
  box-sizing: border-box;
  transition: all 0.2s ease;
  outline: none;
}

.mz-pub-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.mz-pub-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #ffffff;
  padding: 14px 28px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.mz-pub-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4);
}

.mz-pub-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Mensajes de Respuesta */
.mz-pub-message {
  display: none;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  margin-top: 14px;
  animation: mzFadeIn 0.3s ease;
}

@keyframes mzFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mz-pub-message.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.mz-pub-message.error {
  background: #fee2e2;
  color: #9c4560;
  border: 1px solid #fecaca;
}

/* Honeypot oculto */
.mz-hp-field {
  display: none !important;
  visibility: hidden !important;
}

/* ==========================================
   POPUP MODAL EMERGENTE (100% MOBILE FIRST)
   ========================================== */
.mz-pub-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: mzOverlayFade 0.3s ease-out;
}

@keyframes mzOverlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mz-pub-modal-box {
  background: #ffffff;
  width: 100%;
  max-width: 440px;
  border-radius: 20px;
  padding: 32px 28px 24px 28px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25);
  position: relative;
  box-sizing: border-box;
  animation: mzPopupSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-align: center;
}

@keyframes mzPopupSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.mz-pub-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mz-pub-modal-close:hover {
  background: #e2e8f0;
  color: #2b2840;
}

@media (max-width: 480px) {
  .mz-pub-modal-box {
    padding: 26px 18px 20px 18px;
    border-radius: 16px;
  }
}

/* ==========================================
   FORMULARIO DE LANDING [mailzmazivo_landing]
   ========================================== */
.mz-landing {
  --mz-l-purple: #6a12d4;
  --mz-l-text: #3a3a3a;
  --mz-l-border: #b3b3b3;
  --mz-l-font: "Roboto Condensed", "Arial Narrow", sans-serif;
  width: 100%;
  max-width: 980px;
  margin: 30px auto;
  box-sizing: border-box;
  font-family: var(--mz-l-font);
  color: var(--mz-l-text);
}

.mz-landing *,
.mz-landing *::before,
.mz-landing *::after {
  box-sizing: border-box;
}

/* Encabezado "CONTACTANOS" con banda morada y línea punteada */
.mz-landing-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.mz-landing-heading::after {
  content: "";
  flex: 1;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--mz-l-purple) 0 9px, transparent 9px 18px);
}

.mz-landing-title {
  margin: 0;
  padding: 4px 22px 2px;
  background: var(--mz-l-purple);
  clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
  color: #ffffff;
  font-family: "Anton", "Oswald", Impact, sans-serif;
  font-size: 38px;
  font-weight: 400;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mz-landing-subtitle {
  margin: 4px 0 10px;
  font-size: 16px;
}

.mailzmazivo-landing-form {
  display: flex;
  flex-direction: column;
  gap: 10px !important; /* 10px parejos entre campos, en escritorio y celular */
  margin-top: 12px;
}

/* Campos */
.mz-landing-field {
  display: flex;
  flex-direction: column;
  gap: 6px !important;
  min-width: 0;
}

/* Blindaje contra los estilos del tema: márgenes, alturas y flechas propias */
.mz-landing .mailzmazivo-landing-form,
.mz-landing .mailzmazivo-landing-form .mz-landing-field,
.mz-landing .mailzmazivo-landing-form .mz-landing-field > label,
.mz-landing .mailzmazivo-landing-form .mz-landing-input,
.mz-landing .mailzmazivo-landing-form .mz-landing-optin,
.mz-landing .mailzmazivo-landing-form .mz-recaptcha,
.mz-landing .mailzmazivo-landing-form .mz-landing-btn {
  margin: 0 !important;
}

.mz-landing .mailzmazivo-landing-form .mz-landing-field > label {
  display: block;
  padding: 0;
  line-height: 1.2;
}

.mz-landing .mailzmazivo-landing-form .mz-landing-field > label small {
  font-size: 13px;
  line-height: 1;
}

.mz-landing .mailzmazivo-landing-form .mz-landing-input {
  height: auto;
  max-width: 100%;
  line-height: 1.3;
  box-shadow: none;
}

.mz-landing .mailzmazivo-landing-form select.mz-landing-input {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-color: transparent !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a12d4' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 20px center !important;
  background-size: 16px !important;
}

.mz-landing br,
.mz-landing p:empty {
  display: none;
}

.mz-landing-field > label {
  font-family: var(--mz-l-font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--mz-l-text);
}

.mz-landing-field > label small {
  font-weight: 400;
  text-transform: none;
  color: #8a8a8a;
}

.mz-landing-input {
  width: 100%;
  min-height: 56px;
  padding: 12px 22px;
  border: 2px solid var(--mz-l-border);
  border-radius: 4px;
  background: transparent;
  color: var(--mz-l-text);
  font-family: var(--mz-l-font);
  font-size: 19px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mz-landing-input::placeholder {
  color: #9a9a9a;
}

.mz-landing-input:focus {
  border-color: var(--mz-l-purple);
  box-shadow: 0 0 0 3px rgba(106, 18, 212, 0.12);
}

.mz-landing-input.mz-invalid {
  border-color: #d0637e;
}

.mz-landing select.mz-landing-input {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a12d4' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
  padding-right: 52px;
}

.mz-landing-textarea {
  min-height: 140px;
  resize: vertical;
}

/* Tilde de ofertas */
.mz-landing-optin input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mz-landing-optin {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 2px dashed #d6c4f5;
  border-radius: 6px;
  background: rgba(106, 18, 212, 0.04);
  position: relative;
  cursor: pointer;
  font-size: 18px;
  color: var(--mz-l-text);
}

.mz-landing-optin-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mz-landing-optin-text strong {
  font-weight: 700;
  line-height: 1.25;
}

.mz-landing-optin-text small {
  font-size: 15px;
  line-height: 1.45;
  color: #666;
}

.mz-landing-optin-text small b {
  color: var(--mz-l-purple);
}

.mz-landing-check {
  margin-top: 1px;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 2px solid #555;
  border-radius: 3px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mz-landing-optin input:checked + .mz-landing-check {
  background: var(--mz-l-purple);
  border-color: var(--mz-l-purple);
}

.mz-landing-optin input:checked + .mz-landing-check::after {
  content: "";
  width: 7px;
  height: 13px;
  border: solid #ffffff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.mz-landing-optin input:focus-visible + .mz-landing-check,
.mz-landing-btn:focus-visible,
.mz-landing-again:focus-visible {
  outline: 2px solid var(--mz-l-purple);
  outline-offset: 3px;
}

/* reCAPTCHA */
.mz-recaptcha {
  min-height: 78px;
}

/* Botón ENVIAR */
.mz-landing-btn {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f80d9 0%, #4fb1f5 100%);
  color: #ffffff;
  font-family: var(--mz-l-font);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.mz-landing-btn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.mz-landing-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Mensaje de respuesta */
.mz-landing-message {
  display: none;
  margin-top: 14px;
  font-size: 19px;
}

.mz-landing-message.error {
  color: #d0637e;
}

/* ---------- Animaciones del formulario de landing ---------- */
.mz-landing {
  position: relative;
}

/* Botón: etiqueta normal / ecualizador mientras envía */
.mz-landing-btn {
  position: relative;
  overflow: hidden;
}

.mz-landing-btn-label,
.mz-landing-btn-sending {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mz-landing-btn-sending {
  position: absolute;
  inset: 0;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
}

.mz-landing-btn.is-sending .mz-landing-btn-label {
  opacity: 0;
  transform: translateY(-12px);
}

.mz-landing-btn.is-sending .mz-landing-btn-sending {
  opacity: 1;
  transform: none;
}

.mz-landing-btn.is-sending:disabled {
  opacity: 1;
}

/* Barras de ecualizador (marca EQ) */
.mz-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}

.mz-eq i {
  display: block;
  width: 4px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform-origin: bottom;
  animation: mzEq 0.9s ease-in-out infinite;
}

.mz-eq i:nth-child(2) { animation-delay: -0.6s; }
.mz-eq i:nth-child(3) { animation-delay: -0.3s; }
.mz-eq i:nth-child(4) { animation-delay: -0.75s; }
.mz-eq i:nth-child(5) { animation-delay: -0.15s; }
.mz-eq i:nth-child(6) { animation-delay: -0.45s; }
.mz-eq i:nth-child(7) { animation-delay: -0.9s; }

@keyframes mzEq {
  0%, 100% { transform: scaleY(0.25); }
  50% { transform: scaleY(1); }
}

/* El formulario "despega" al enviarse */
.mz-landing.is-sent .mailzmazivo-landing-form {
  animation: mzFormAway 0.55s cubic-bezier(0.55, 0, 0.75, 0) forwards;
  pointer-events: none;
}

@keyframes mzFormAway {
  to { opacity: 0; transform: translateY(-40px) scale(0.96); filter: blur(2px); }
}

/* Error: el formulario tiembla */
.mailzmazivo-landing-form.mz-shake {
  animation: mzShake 0.45s ease;
}

@keyframes mzShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* Pantalla de agradecimiento */
.mz-landing-success {
  margin-top: 18px;
  padding: 44px 28px 36px;
  border: 2px solid #e4d6fb;
  border-radius: 14px;
  background: linear-gradient(160deg, #ffffff 0%, #f6f0ff 100%);
  text-align: center;
  animation: mzSuccessIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.mz-landing-success[hidden] {
  display: none;
}

@keyframes mzSuccessIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: none; }
}

.mz-landing-success-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--mz-l-purple);
  box-shadow: 0 10px 30px rgba(106, 18, 212, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mzPop 0.5s 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.mz-landing-success-icon svg {
  width: 56px;
  height: 56px;
}

.mz-check-circle {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 2;
}

.mz-check-mark {
  stroke: #ffffff;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: mzDraw 0.45s 0.55s ease forwards;
}

@keyframes mzPop {
  from { opacity: 0; transform: scale(0.3); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes mzDraw {
  to { stroke-dashoffset: 0; }
}

.mz-eq-big {
  height: 30px;
  gap: 5px;
  margin-bottom: 14px;
  color: var(--mz-l-purple);
}

.mz-eq-big i {
  width: 6px;
}

.mz-landing-success-title {
  margin: 0 0 12px;
  font-family: "Anton", "Oswald", Impact, sans-serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--mz-l-purple);
  animation: mzSuccessIn 0.6s 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.mz-landing-success-text {
  max-width: 560px;
  margin: 0 auto;
  font-size: 19px;
  line-height: 1.5;
  color: var(--mz-l-text);
  animation: mzSuccessIn 0.6s 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.mz-landing-success-note {
  display: inline-block;
  margin: 18px auto 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: #ede3fd;
  font-size: 15px;
  color: #4b0fa0;
  animation: mzSuccessIn 0.6s 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.mz-landing-again {
  display: block;
  margin: 22px auto 0;
  padding: 8px 4px;
  border: none;
  border-bottom: 2px solid currentColor;
  background: none;
  font-family: var(--mz-l-font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #2f80d9;
  cursor: pointer;
  animation: mzSuccessIn 0.6s 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Confeti */
.mz-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.mz-confetti i {
  position: absolute;
  top: 30%;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: mzConfetti 2s ease-out forwards;
}

.mz-confetti i:nth-child(3n) {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

@keyframes mzConfetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  15% { opacity: 1; transform: translate(calc(var(--mz-drift) * 0.3), -140px) rotate(calc(var(--mz-spin) * 0.3)); }
  100% { opacity: 0; transform: translate(var(--mz-drift), 380px) rotate(var(--mz-spin)); }
}

@media (prefers-reduced-motion: reduce) {
  .mz-landing *,
  .mz-landing *::before,
  .mz-landing *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }
  .mz-check-mark {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 600px) {
  .mz-landing-title {
    font-size: 30px;
  }
  .mz-landing-input {
    font-size: 17px;
    padding: 12px 16px;
  }
  .mz-landing-optin {
    font-size: 16px;
    padding: 14px;
  }
  .mz-landing-optin-text small {
    font-size: 14px;
  }
  .mz-landing-success {
    padding: 34px 18px 28px;
  }
  .mz-landing-success-title {
    font-size: 24px;
  }
  .mz-landing-success-text {
    font-size: 17px;
  }
}
