/* Overlay general */
#lead-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Fondo difuminado */
.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}

/* Modal */
.overlay-modal {
  position: relative;
  width: min(900px, 90%);
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: 16px;
  z-index: 10000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Franja superior con boton cerrar */
.modal-header {
  width: 100%;
  min-height: 40px;
  background-color: #4F81BD;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 10px;
  box-sizing: border-box;
}

.modal-close {
  background: none !important;
  border: none !important;
  color: white !important;
  font-size: 20px !important;
  cursor: pointer !important;
  font-weight: bold !important;
  line-height: 1 !important;
  padding: 0 !important;
  transition: color 0.3s ease !important;
  outline: none !important;
  box-shadow: none !important;
}

.modal-close:hover,
.modal-close:focus {
  color: #2f5b8a !important;
}

.locker-public-shell {
  width: 100%;
  padding: 24px 32px 32px;
  box-sizing: border-box;
}

.locker-public-shell-modal {
  overflow-y: auto;
}

.overlay-modal h2,
.subscription-form-wrapper h2 {
  margin: 0 0 16px;
  font-size: 28px;
  line-height: 1.3;
  color: #4F81BD;
  font-weight: 700;
  text-align: center;
}

.locker-copy p,
.subscription-form-wrapper .subscription-text {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  text-align: center;
}

.overlay-modal .trial-note {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.4;
  color: #555;
  text-align: center;
}

.locker-public-form {
  width: 100%;
}

.overlay-modal .locker-public-form {
  text-align: center;
}

/* Input email */
.overlay-modal input[type="email"],
.subscription-form-wrapper input[type="email"] {
  width: 100%;
  max-width: 700px;
  padding: 10px;
  margin: 0 auto 1rem;
  display: block;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

.overlay-modal input[type="email"]:focus,
.subscription-form-wrapper input[type="email"]:focus {
  outline: none;
  border: 2px solid #4F81BD;
}

/* Consentimiento */
.overlay-modal .consent-text,
.subscription-form-wrapper .consent-text {
  display: flex;
  align-items: flex-start;
  width: 100%;
  max-width: 700px;
  margin: 0 auto 1.5rem;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
  text-align: left;
}

.overlay-modal .consent-text input[type="checkbox"],
.subscription-form-wrapper .consent-text input[type="checkbox"] {
  margin-right: 8px;
  margin-top: 4px;
  flex: 0 0 auto;
}

.overlay-modal .consent-text a,
.subscription-form-wrapper .consent-text a {
  color: #4F81BD;
  text-decoration: underline;
  font-weight: bold;
}

/* Boton submit */
.overlay-modal button#lead-submit,
.subscription-form-wrapper button#lead-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  background: #4F81BD;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
  margin-bottom: 1rem;
}

.overlay-modal button#lead-submit:hover:enabled,
.subscription-form-wrapper button#lead-submit:hover:enabled {
  background: #2f5b8a;
}

.overlay-modal button#lead-submit:disabled,
.subscription-form-wrapper button#lead-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.overlay-modal .recaptcha-wrapper,
.subscription-form-wrapper .recaptcha-wrapper {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.overlay-modal .recaptcha-error,
.subscription-form-wrapper .recaptcha-error {
  margin-top: 8px;
  color: #d93025;
  font-size: 14px;
  text-align: center;
}

/* Contenido detras bloqueado */
.page-content.blurred {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}

/* Bloqueo de contenido */
.content-locked {
  display: none;
}

.read-more-locked {
  text-align: center;
  margin: 2rem 0;
}

.read-more-locked a,
.read-more-locked button {
  margin: 8px;
}

.locked-btn {
  display: inline-block;
  padding: 12px 28px;
  background: #4F81BD;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-family: Arial, sans-serif;
  cursor: pointer;
  text-decoration: none !important;
  text-align: center;
  transition: background 0.3s ease, color 0.3s ease;
}

.locked-btn:hover {
  background: #2f5b8a;
  color: #fff;
  text-decoration: none;
}

#access-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
}

.loader-modal {
  position: relative;
  z-index: 2;
  background: #fff;
  padding: 2rem 3rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.3s ease;
}

.loader-modal p {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: #444;
}

/* Spinner animado */
.spinner {
  border: 4px solid #ddd;
  border-top: 4px solid #0073aa;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.trial-expired-notice {
  display: none;
  color: #fff;
  margin-top: 16px;
  margin-bottom: 16px;
  font-weight: bold;
  text-align: center;
}

.trial-expired-notice .trial-expired {
  background-color: #e74c3c;
  padding: 12px;
  border-radius: 8px;
}

.trial-expired-notice .locked-separator {
  color: #444;
}

.trial-expired-notice a {
  color: #fff !important;
  text-decoration: underline !important;
  font-weight: bold;
}

.trial-expired-notice a:hover {
  color: #ffdcdc !important;
}

.confirm-email-notice {
  display: none;
  background-color: #4F81BD;
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  margin-top: 16px;
  font-weight: bold;
  text-align: center;
}

.confirm-email-notice a {
  color: #fff;
  text-decoration: underline;
  font-weight: bold;
}

.confirm-email-notice a:hover {
  color: #d0e0f0;
}

/**** Form ****/

.subscription-form-wrapper {
  max-width: 700px;
  margin: 2rem auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  text-align: center;
  font-family: Arial, sans-serif;
}

.subscription-form-wrapper h2,
.subscription-form-wrapper .subscription-text {
  display: none;
}

.subscription-form-wrapper input[type="email"] {
  width: 100%;
  max-width: none;
  padding: 12px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  font-size: 15px;
  text-align: center;
  background: #ffffff;
  font-family: "Roboto Condensed", Arial, sans-serif;
}

.subscription-form-wrapper input[type="email"]:focus {
  border: 1px solid #4F81BD;
}

.subscription-form-wrapper .consent-text,
.subscription-form-wrapper .recaptcha-wrapper,
.subscription-form-wrapper .recaptcha-error {
  font-size: 12px;
  color: #555;
  font-family: "Roboto Condensed", Arial, sans-serif;
}

.subscription-form-wrapper .consent-text {
  max-width: none;
}

.subscription-form-wrapper button#lead-submit {
  width: 100%;
  max-width: none;
  padding: 14px;
  background: #4F81BD;
  color: #ffffff;
  font-weight: bold;
  border-radius: 4px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: "Roboto Condensed", Arial, sans-serif;
}

#form-message-page {
  margin-top: 1rem;
  padding: 10px;
  border-radius: 8px;
  font-weight: bold;
  display: block;
}

/**** .subscription-inline-message ***/

.subscription-inline-message {
  margin-top: 15px;
  padding: 12px 15px;
  border-radius: 6px;
  font-size: 15px;
  display: none;
}

.subscription-inline-message.info {
  background: #e8f3ff;
  border-left: 4px solid #1a73e8;
  color: #1a4fa8;
}

.subscription-inline-message.success {
  background: #e8fbe8;
  border-left: 4px solid #1dbf1d;
  color: #107510;
}

.subscription-inline-message.error {
  background: #ffe8e8;
  border-left: 4px solid #d93025;
  color: #a0211a;
}

@media (max-width: 767px) {
  #lead-overlay {
    align-items: flex-start;
    padding: 12px;
    box-sizing: border-box;
  }

  .overlay-modal {
    width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: 14px;
  }

  .locker-public-shell {
    padding: 18px 16px 20px;
  }

  .locker-public-shell-modal {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .overlay-modal h2,
  .subscription-form-wrapper h2 {
    font-size: 24px;
  }

  .locker-copy p,
  .subscription-form-wrapper .subscription-text {
    font-size: 15px;
    margin-bottom: 12px;
  }

  .overlay-modal .consent-text,
  .subscription-form-wrapper .consent-text {
    font-size: 13px;
    margin-bottom: 1rem;
  }

  .overlay-modal button#lead-submit,
  .subscription-form-wrapper button#lead-submit,
  .locked-btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .read-more-locked a,
  .read-more-locked button {
    margin: 8px 0;
  }

  .overlay-modal .recaptcha-wrapper,
  .subscription-form-wrapper .recaptcha-wrapper {
    justify-content: center;
    overflow: hidden;
  }

  .overlay-modal .g-recaptcha,
  .subscription-form-wrapper .g-recaptcha {
    transform: scale(0.92);
    transform-origin: center top;
  }

  .loader-modal {
    width: min(320px, calc(100vw - 32px));
    padding: 1.5rem;
  }
}

@media (max-width: 430px) {
  #lead-overlay {
    padding: 8px;
  }

  .overlay-modal {
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
  }

  .modal-header {
    min-height: 36px;
    padding: 0 8px;
  }

  .locker-public-shell {
    padding: 14px 12px 16px;
  }

  .overlay-modal h2 {
    font-size: 21px;
    margin-bottom: 10px;
  }

  .locker-copy p {
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 10px;
  }

  .overlay-modal .trial-note {
    font-size: 12px;
    line-height: 1.35;
    margin-bottom: 14px;
  }

  .overlay-modal input[type="email"] {
    margin-bottom: 12px;
    padding: 9px 10px;
  }

  .overlay-modal .consent-text {
    font-size: 12px;
    line-height: 1.3;
    margin-bottom: 12px;
  }

  .overlay-modal .recaptcha-wrapper {
    margin: 12px 0 10px;
  }

  .overlay-modal .g-recaptcha {
    transform: scale(0.84);
  }

  .overlay-modal button#lead-submit {
    margin-bottom: 0;
    padding: 11px 18px;
  }
}
