/**
 * Módulo ghconsulta · estilos del modal de consulta.
 * BEM bajo prefijo .ghconsulta-*. Usa los tokens CSS del tema (--gh-*).
 */

/* ─── Overlay ─── */
.ghconsulta-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ghconsulta-modal[hidden] { display: none; }

/* El JS marca el body mientras el modal está abierto: bloquea el scroll de fondo. */
body.ghconsulta-open { overflow: hidden; }

.ghconsulta-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ─── Panel ─── */
/* Mismo tamaño que tenía el modal de NEXT (680px × ~78vh). */
.ghconsulta-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(680px, calc(94vw / var(--gh-zoom, 1)));
  min-height: min(calc(78vh / var(--gh-zoom, 1)), 720px);
  max-height: calc(calc(100vh / var(--gh-zoom, 1)) - 32px);
  overflow-y: auto;
  background: var(--gh-white, #fff);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(10, 10, 10, 0.35);
  padding: 28px 32px 32px;
}

.ghconsulta-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.ghconsulta-modal__title {
  font-family: var(--gh-font-display, inherit);
  font-weight: 800;
  font-size: 23px;
  color: var(--gh-green-900, #0f3d2e);
}

.ghconsulta-modal__close {
  border: 0;
  background: var(--gh-grey-100, #f5f5f5);
  color: var(--gh-grey-700, #404040);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.ghconsulta-modal__close:hover { background: var(--gh-grey-200, #e5e5e5); }

.ghconsulta-modal__intro {
  margin: 0 0 20px;
  font-size: 14.5px;
  color: var(--gh-grey-600, #525252);
}

/* ─── Formulario ─── */
.ghconsulta-modal__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* El campo del mensaje absorbe la altura sobrante del panel. */
.ghconsulta-modal__field:has(.ghconsulta-modal__input--area) { flex: 1; }

.ghconsulta-modal__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ghconsulta-modal__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gh-grey-700, #404040);
}

.ghconsulta-modal__input {
  width: 100%;
  border: 1px solid var(--gh-grey-300, #d4d4d4);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--gh-grey-900, #1a1a1a);
  background: var(--gh-white, #fff);
}

.ghconsulta-modal__input:focus {
  outline: 2px solid var(--gh-ai-start, #3b82f6);
  outline-offset: -1px;
  border-color: var(--gh-ai-start, #3b82f6);
}

.ghconsulta-modal__input--area {
  resize: vertical;
  min-height: 130px;
  flex: 1;
}

/* Honeypot: fuera de pantalla, no display:none (algunos bots lo detectan). */
.ghconsulta-modal__hp {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ghconsulta-modal__privacy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--gh-grey-600, #525252);
  cursor: pointer;
}

.ghconsulta-modal__privacy input { margin-top: 2px; }

.ghconsulta-modal__privacy a {
  color: var(--gh-green-700, #1f6f4a);
  text-decoration: underline;
}

.ghconsulta-modal__error {
  margin: 0;
  font-size: 13px;
  color: #b3261e;
}

/* Mismo degradado AI que el lanzador «¿Alguna duda?» del tema. */
.ghconsulta-modal__submit {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-family: var(--gh-font-display, inherit);
  font-weight: 700;
  font-size: 15px;
  color: var(--gh-white, #fff);
  background: var(--gh-ai-grad, linear-gradient(135deg, #1e3a8a, #3b82f6, #22d3ee));
  box-shadow: 0 8px 22px rgba(123, 95, 175, 0.3);
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.ghconsulta-modal__submit:hover { filter: brightness(1.06); }
.ghconsulta-modal__submit:active { transform: translateY(1px); }
.ghconsulta-modal__submit[disabled] { opacity: 0.6; cursor: default; }

/* ─── Estado de éxito ─── */
.ghconsulta-modal__success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 20px 8px 4px;
  color: var(--gh-green-700, #1f6f4a);
}

.ghconsulta-modal__success[hidden] { display: none; }

.ghconsulta-modal__success-title {
  margin: 0;
  font-family: var(--gh-font-display, inherit);
  font-weight: 800;
  font-size: 18px;
  color: var(--gh-green-900, #0f3d2e);
}

.ghconsulta-modal__success-text {
  margin: 0 0 8px;
  font-size: 13.5px;
  color: var(--gh-grey-600, #525252);
}
