/**
 * @file modal.css
 * @description Estilos para modal WhatsApp
 * Accesible, responsive, minimalista
 */

/* Modal overlay */
.atl-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(2px);
}

.atl-modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal contenedor */
.atl-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 420px;
  animation: slideUp 0.3s ease;
  overflow: hidden;
}

/* Header WhatsApp */
.atl-modal-header {
  background: linear-gradient(135deg, #25D366 0%, #20ba5a 100%);
  padding: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.atl-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.atl-modal-header svg {
  width: 24px;
  height: 24px;
}

.atl-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.atl-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Body formulario */
.atl-modal-body {
  padding: 24px;
}

.atl-form-group {
  margin-bottom: 16px;
}

.atl-form-group:last-child {
  margin-bottom: 0;
}

.atl-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.atl-form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.atl-form-group input:focus {
  outline: none;
  border-color: #25D366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.atl-form-group input::placeholder {
  color: #999;
}

.atl-form-error {
  color: #e74c3c;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.atl-form-group.error input {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.05);
}

.atl-form-group.error .atl-form-error {
  display: block;
}

/* Footer con botón */
.atl-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
}

.atl-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.atl-btn-submit {
  background: linear-gradient(135deg, #25D366 0%, #20ba5a 100%);
  color: #fff;
}

.atl-btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.atl-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.atl-btn-cancel {
  background: #f5f5f5;
  color: #333;
}

.atl-btn-cancel:hover {
  background: #eee;
}

/* Mensajes */
.atl-message {
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.atl-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.atl-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.atl-message.show {
  display: block;
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 480px) {
  .atl-modal {
    width: 95%;
    max-width: none;
  }

  .atl-modal-body {
    padding: 20px;
  }

  .atl-modal-footer {
    flex-direction: column;
  }
}
