/**
 * Modales interactivos para Gestoría Insfrán:
 * - Modal de confirmación de envío / error
 * - Modal de visualización de Política de Privacidad en la misma página
 */

/* Contenedor del Modal */
.gi-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 42, 86, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.gi-modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

/* Tarjeta del Modal */
.gi-modal-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(9, 42, 86, 0.25), 0 0 0 1px rgba(9, 42, 86, 0.08);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;
}

.gi-modal-backdrop.is-active .gi-modal-card {
  transform: translateY(0) scale(1);
}

/* Modal específico de política (más ancho y con scroll) */
.gi-modal-card.gi-modal-privacy {
  max-width: 680px;
}

/* Encabezado */
.gi-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e8eff6;
  background: #fafcff;
}

.gi-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #092A56;
  letter-spacing: -0.01em;
}

.gi-modal-close {
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #62748d;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.gi-modal-close:hover {
  background: #edf3fa;
  color: #092A56;
}

/* Cuerpo del Modal */
.gi-modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.65;
  color: #33445c;
}

.gi-modal-body h4 {
  font-size: 16px;
  font-weight: 700;
  color: #092A56;
  margin: 18px 0 6px;
}

.gi-modal-body h4:first-child {
  margin-top: 0;
}

.gi-modal-body p {
  margin: 0 0 12px;
}

.gi-modal-body ul {
  margin: 0 0 16px 20px;
  padding: 0;
}

.gi-modal-body li {
  margin-bottom: 6px;
}

/* Estilos de Respuesta de Envío (Icono grande y centrado) */
.gi-modal-status-body {
  text-align: center;
  padding: 36px 28px 24px;
}

.gi-modal-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: bold;
}

.gi-modal-badge.is-success {
  background: #e6f7ee;
  color: #18a85c;
  box-shadow: 0 0 0 8px #f0faf4;
}

.gi-modal-badge.is-error {
  background: #fdeeee;
  color: #c93b27;
  box-shadow: 0 0 0 8px #fff5f5;
}

.gi-modal-status-title {
  font-size: 24px;
  font-weight: 800;
  color: #092A56;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.gi-modal-status-desc {
  font-size: 16px;
  color: #51647c;
  margin: 0 0 24px;
  line-height: 1.6;
}

/* Pie y botones de acción */
.gi-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e8eff6;
  background: #fafcff;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.gi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  cursor: pointer;
  transition: 0.18s;
  border: 1px solid transparent;
}

.gi-btn-primary {
  background: #2479c5;
  color: #ffffff;
}

.gi-btn-primary:hover {
  background: #185f9f;
}

.gi-btn-whatsapp {
  background: #18a85c;
  color: #ffffff;
}

.gi-btn-whatsapp:hover {
  background: #138749;
}

.gi-btn-secondary {
  background: #ffffff;
  border-color: #cbd8e6;
  color: #092A56;
}

.gi-btn-secondary:hover {
  background: #f0f6fc;
}

/* Estado de carga en el botón del formulario */
.button.is-submitting {
  opacity: 0.8;
  cursor: not-allowed;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: gi-spin 0.75s linear infinite;
}

@keyframes gi-spin {
  to { transform: rotate(360deg); }
}

/* Enlace a la política con cursor pointer */
.privacy-link {
  color: #2479c5;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

.privacy-link:hover {
  color: #092A56;
}
