/* Modal de Login */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  z-index: 9001;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 420px;
  width: 90%;
  padding: 0;
  overflow: hidden;
  /* 🔧 FIX: Prevent gesture issues and create proper stacking context for touch */
  touch-action: manipulation;
  transform: translateZ(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.modal-header h2,
.modal-header h3.modal__title {
  margin: 0;
  font-size: 1.5rem;
  color: #1f2937;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-close:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.login-form {
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.2s;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-form .btn {
  width: 100%;
  padding: 0.75rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.login-form .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.login-form .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.login-form .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Botón block (ancho completo) */
.btn-block {
  display: block;
  width: 100%;
}

/* Divider con texto */
.modal-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 2rem;
  color: #374151;
  /* Gris oscuro para buen contraste */
  font-size: 0.9rem;
  font-weight: 500;
}

.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #d1d5db;
}

.modal-divider span {
  padding: 0 1rem;
  background: white;
  /* Asegurar fondo blanco detrás del texto */
}

/* Sección de registro en modal - CONTRASTE GARANTIZADO */
.modal-registro-section {
  padding: 1.25rem 2rem 1.75rem;
  text-align: center;
  background: #f3f4f6;
  /* Fondo gris más definido */
  border-top: 1px solid #d1d5db;
  border-radius: 0 0 12px 12px;
}

.modal-registro-section .modal-divider {
  margin: 0 0 1rem;
  padding: 0;
  color: #111827;
  /* Casi negro para máximo contraste */
  font-weight: 600;
  font-size: 0.95rem;
}

.modal-registro-section .modal-divider::before,
.modal-registro-section .modal-divider::after {
  border-bottom: 1px solid #9ca3af;
  /* Líneas más visibles */
}

.modal-registro-section .modal-divider span {
  background: #f3f4f6;
  /* Coincidir con fondo */
  padding: 0 0.75rem;
}

.modal-registro-texto {
  margin: 0 0 1rem;
  color: #374151;
  font-size: 0.95rem;
}

/* Botón de crear cuenta en modal - estilo outline prominente */
.btn-crear-cuenta-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: white;
  color: #16a34a;
  border: 2px solid #16a34a;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-crear-cuenta-modal:hover {
  background: #16a34a;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.3);
}

.btn-crear-cuenta-modal svg {
  stroke: currentColor;
}

/* Mantener compatibilidad con botón antiguo */
.btn-registro-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: #16a34a;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}

.btn-registro-modal:hover {
  background: #15803d;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

.btn-registro-modal svg {
  stroke: white;
}

/* Modal acceso mejorado */
.modal-acceso .login-form {
  padding: 1.5rem 2rem 1rem;
}

.modal-acceso .login-form .btn-primary {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  margin-top: 0.5rem;
}

.modal-acceso .login-form .btn-primary:hover {
  box-shadow: 0 10px 25px rgba(22, 163, 74, 0.3);
}

/* ========================================
   RESPONSIVE: Mobile optimizations
   ======================================== */
@media (max-width: 600px) {
  .modal-content {
    width: 95%;
    max-width: 100%;
    margin: 1rem;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-content.modal-acceso {
    padding-bottom: 1rem;
  }

  .modal-header {
    padding: 1rem;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
  }

  .modal-header h2,
  .modal-header h3.modal__title {
    font-size: 1.25rem;
  }

  .login-form {
    padding: 1rem 1.25rem;
  }

  .login-form .form-group label {
    font-size: 0.9rem;
  }

  .login-form input {
    font-size: 16px;
    /* Prevents iOS zoom on focus */
    padding: 0.75rem;
  }

  .modal-registro-section {
    margin: 0.75rem 1rem 0.5rem;
    padding: 1rem;
  }

  .modal-registro-title {
    font-size: 0.9rem;
  }

  .modal-registro-hint {
    font-size: 0.75rem;
  }

  .btn-registro-modal {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* How it works modal */
  .modal-como-funciona {
    width: 95%;
    max-width: 100%;
    margin: 0.5rem;
    max-height: 95vh;
    padding: 1.25rem;
  }

  .modal-como-funciona h2,
  .modal-como-funciona h3.modal__title {
    font-size: 1.25rem;
  }

  .paso {
    padding: 0.875rem;
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .paso-numero {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .paso h3 {
    font-size: 1rem;
  }

  .paso p {
    font-size: 0.875rem;
  }

  .cta-box {
    padding: 1rem;
  }

  .cta-box h3 {
    font-size: 1rem;
  }

  .cta-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }

  .cta-buttons .btn {
    width: 100%;
  }
}

/* Extra small screens */
@media (max-width: 380px) {
  .modal-content {
    width: 100%;
    margin: 0;
    border-radius: 12px 12px 0 0;
    position: absolute;
    bottom: 0;
    max-height: 85vh;
  }

  .modal-como-funciona {
    margin: 0;
    border-radius: 12px 12px 0 0;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
  }
}

/* ============================================
   MODAL DE CONFIRMACIÓN DE REGISTRO
   ============================================ */

.modal-blocking .modal-overlay-blocking {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.modal-content-confirm {
  max-width: 480px;
  padding: 2rem;
  text-align: center;
  animation: modalBounceIn 0.4s ease-out;
}

@keyframes modalBounceIn {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(-20px);
  }

  50% {
    transform: scale(1.02) translateY(0);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.confirm-icon {
  margin-bottom: 0.5rem;
}

.confirm-icon svg {
  animation: checkmarkPop 0.5s ease-out 0.2s both;
}

@keyframes checkmarkPop {
  0% {
    opacity: 0;
    transform: scale(0);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.confirm-alert {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  text-align: left;
}

.confirm-alert-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.confirm-alert-text strong {
  display: block;
  color: #92400e;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.confirm-alert-text p {
  margin: 0;
  color: #78350f;
  font-size: 0.95rem;
  line-height: 1.4;
}

.confirm-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.confirm-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f3f4f6;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-align: left;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.confirm-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.confirm-buttons .btn-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  padding: 1rem 1.5rem;
}

.confirm-buttons .btn-outline {
  color: #6b7280;
  border-color: #d1d5db;
}

.confirm-buttons .btn-outline:hover {
  background: #f3f4f6;
}

/* Dropzone mejorado para imágenes principales */
.dropzone-primary {
  border: 3px dashed #16a34a;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  transition: all 0.3s ease;
}

.dropzone-primary:hover {
  border-color: #15803d;
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  transform: translateY(-2px);
}

.dropzone-primary svg {
  color: #16a34a;
}

@media (max-width: 480px) {
  .modal-content-confirm {
    padding: 1.5rem;
  }

  .confirm-alert {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .confirm-icon svg {
    width: 60px;
    height: 60px;
  }
}

/* =============================================
   LEAD FORM MODAL - Formulario de Consulta
   ============================================= */

.lead-form-modal .modal-content--lead-form {
  max-width: 480px;
  padding: 0;
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.lead-form-modal .modal-content--lead-form .lead-form-header {
  flex-shrink: 0;
}

.lead-form-modal .modal-content--lead-form .modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 600px) {
  .lead-form-modal .modal-content--lead-form {
    max-height: 85vh;
    max-width: 95%;
    margin: 1rem auto;
  }

  .lead-form-modal .lead-form-header {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .lead-form-modal .modal-content--lead-form {
    max-height: calc(100vh - 2rem);
    max-width: 100%;
    margin: 1rem;
    border-radius: 0.75rem;
  }

  .lead-form-modal .modal-body {
    padding: 1.25rem 1rem 1.5rem;
  }

  .lead-form .form-input {
    font-size: 16px;
    padding: 0.75rem 0.875rem;
  }

  .lead-form textarea.form-input {
    min-height: 70px;
  }

  .lead-form .form-actions {
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .lead-form .form-actions .btn {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }
}

.lead-form-modal .modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.5rem;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lead-form-modal .modal-close:hover {
  background: white;
  color: #1f2937;
  transform: scale(1.1);
}

.lead-form-header {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: white;
  padding: 1.75rem 2rem;
  text-align: center;
}

.lead-form-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.lead-form-header h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.lead-form-subtitle {
  margin: 0.5rem 0 0 0;
  font-size: 0.9rem;
  opacity: 0.9;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-form-modal .modal-body {
  padding: 1.75rem 2rem 2rem;
  box-sizing: border-box;
}

.lead-form .form-group {
  margin-bottom: 1rem;
}

.lead-form .form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.5rem;
}

.lead-form .label-icon {
  font-size: 1rem;
}

.lead-form .required {
  color: #ef4444;
}

.lead-form .form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: all 0.2s;
  box-sizing: border-box;
  background: #f8fafc;
}

.lead-form .form-input:focus {
  outline: none;
  border-color: #16a34a;
  background: white;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
}

.lead-form .form-input::placeholder {
  color: #94a3b8;
}

.lead-form textarea.form-input {
  resize: vertical;
  min-height: 80px;
  max-height: 200px;
}

.lead-form .form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .lead-form .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.lead-form .form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.lead-form .form-actions .btn {
  flex: 1;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.lead-form .form-actions .btn--ghost {
  background: transparent;
  border: 2px solid #e2e8f0;
  color: #64748b;
}

.lead-form .form-actions .btn--ghost:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.lead-form .form-actions .btn--primary {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  border: none;
  color: white;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}

.lead-form .form-actions .btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

.lead-form .form-actions .btn--primary:disabled {
  opacity: 0.7;
  transform: none;
  cursor: not-allowed;
}

.lead-form .btn-icon {
  font-size: 1.1rem;
}

.lead-form .form-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
}

.lead-form .note-icon {
  font-size: 0.9rem;
}

/* Success state */
.lead-form-success {
  text-align: center;
  padding: 1rem 0;
}

.lead-form-success .success-animation {
  margin-bottom: 1rem;
}

.lead-form-success .success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: white;
  font-size: 2rem;
  font-weight: bold;
  border-radius: 50%;
  animation: successPop 0.4s ease-out;
}

@keyframes successPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.lead-form-success h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.35rem;
  color: #16a34a;
}

.lead-form-success p {
  margin: 0 0 1.5rem 0;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.5;
}

.lead-form-success .btn {
  min-width: 120px;
}

/* Password Strength Meter Styles */
#password-strength-container {
  margin-top: 1rem;
  margin-bottom: 1rem;
  background: #f8fafb;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.ps-bars {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  height: 4px;
}

.ps-bar {
  flex: 1;
  background-color: #e2e8f0;
  border-radius: 2px;
  transition: background-color 0.3s ease;
}

.ps-text-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
  font-weight: 500;
}

.ps-requirements {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ps-req-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 6px;
  transition: color 0.3s ease;
}

.req-icon {
  width: 14px;
  display: inline-block;
  text-align: center;
  font-weight: bold;
}