/* InsurgentLab · solicitud de contacto (modal). Mismo lenguaje que el resto de la web:
   Warm White, Emerald estructural, Coral solo como microacento. Sin sombras pesadas ni degradados. */

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

html.ct-open { overflow: hidden; }
.ct-modal { width: min(640px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 1px solid var(--rule); border-top: 3px solid var(--emerald); border-radius: 4px; background: var(--white); color: var(--graphite); overflow: hidden; }
.ct-modal::backdrop { background: rgba(0, 51, 41, 0.55); }
.ct-inner { display: flex; flex-direction: column; max-height: calc(100dvh - 52px); }
.ct-top { display: flex; justify-content: flex-end; padding: 10px 14px 0; flex: 0 0 auto; }
.ct-close { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--emerald); font: 600 0.92rem var(--font-body); cursor: pointer; }
.ct-close span[aria-hidden] { font-size: 1.5rem; line-height: 1; font-weight: 400; }
.ct-close:hover { text-decoration: underline; text-underline-offset: 4px; }
.ct-close:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.ct-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px clamp(22px, 4vw, 40px) clamp(24px, 4vw, 36px); }

.ct-body h2 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 1.95rem); line-height: 1.18; color: var(--emerald); }
.ct-body h2:focus { outline: none; }
.ct-body h2::after { content: ""; display: block; width: 28px; height: 2px; margin-top: 14px; background: var(--coral); }
.ct-lead { margin: 14px 0 0; font-size: 1.04rem; line-height: 1.55; color: var(--graphite); }
.ct-sub { margin: 4px 0 0; font-size: 0.92rem; color: var(--muted); }
.ct-demo { margin: 14px 0 0; padding: 8px 12px; border-left: 3px solid var(--lab-orange); background: var(--paper); font-size: 0.86rem; color: var(--graphite); }

.ct-form { margin-top: 20px; }
.ct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.ct-field { display: grid; gap: 6px; align-content: start; }
.ct-field label, .ct-pref legend { font-weight: 600; font-size: 0.9rem; color: var(--emerald); }
.ct-opt { font-weight: 400; color: var(--muted); }
.ct-opt[hidden] { display: none; }
.ct-field input, .ct-field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--sage); border-radius: 4px; background: var(--paper); color: var(--emerald); font: 400 1rem var(--font-body); }
.ct-field textarea { min-height: 92px; resize: vertical; line-height: 1.45; }
.ct-field textarea::placeholder { color: var(--muted); }
.ct-field input:focus-visible, .ct-field textarea:focus-visible { outline: 3px solid var(--coral); outline-offset: 1px; border-color: var(--emerald); }
.ct-field input[aria-invalid="true"] { border: 2px solid #C2253F; }
.ct-err { margin: 0; font-size: 0.86rem; font-weight: 600; color: #A8102B; }
.ct-err[hidden] { display: none; }
.ct-count { margin: 0; font-size: 0.78rem; color: var(--muted); text-align: right; }

.ct-pref { margin: 18px 0 0; padding: 0; border: 0; min-width: 0; }
.ct-pref legend { padding: 0; margin-bottom: 6px; }
.ct-pref-opts { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.ct-pref-opts label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 0.95rem; color: var(--graphite); cursor: pointer; }
.ct-pref-opts input { width: 20px; height: 20px; margin: 0; accent-color: var(--emerald); }
.ct-field-msg { margin-top: 10px; }

.ct-consent { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; font-size: 0.92rem; line-height: 1.45; color: var(--graphite); cursor: pointer; }
.ct-consent input { flex: 0 0 auto; width: 22px; height: 22px; margin: 0; accent-color: var(--emerald); }
.ct-consent input[aria-invalid="true"] { outline: 2px solid #C2253F; outline-offset: 2px; }
.ct-consent a { color: var(--emerald); }
.ct-consent + .ct-err { margin: 6px 0 0 34px; }
.ct-pref-opts input:focus-visible, .ct-consent input:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.ct-msg { margin: 12px 0 0; font-size: 0.92rem; }
.ct-msg:empty { display: none; }
.ct-msg.is-error { color: #A8102B; font-weight: 600; }
.ct-actions { margin-top: 18px; }
.ct-submit { min-height: 48px; }
.ct-modal .btn-ghost { background: transparent; }

.ct-done { padding: 22px 0 4px; }
.ct-done:focus { outline: none; }
.ct-done-title { margin: 0; font: 600 clamp(1.2rem, 2vw, 1.4rem)/1.3 var(--font-display); color: var(--emerald); }
.ct-done-text { margin: 8px 0 20px; max-width: 34em; color: var(--graphite); }
.ct-done-text[hidden] { display: none; }
.ct-done .btn { margin-top: 12px; }

/* móvil: hoja prácticamente a pantalla completa, con scroll interno; el teclado no tapa campos ni botón */
@media (max-width: 640px) {
  .ct-modal { width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-top: 3px solid var(--emerald); border-radius: 0; }
  .ct-inner { height: 100%; max-height: 100dvh; }
  .ct-top { padding: 6px 8px 0; }
  .ct-body { flex: 1 1 auto; padding: 0 20px calc(28px + env(safe-area-inset-bottom)); scroll-padding-bottom: 96px; }
  .ct-grid { grid-template-columns: 1fr; gap: 12px; }
  .ct-field input { min-height: 48px; font-size: 16px; } /* 16 px: sin zoom automático en iOS */
  .ct-field textarea { font-size: 16px; }
  .ct-submit { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: no-preference) {
  .ct-modal[open] { animation: ct-in .18s ease-out; }
  @keyframes ct-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* honeypot antispam: fuera de pantalla, sin foco ni lectura para personas */
.hp-field { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* escritorio: si el modal no cabe en la ventana, el cuerpo hace scroll y la acción principal queda siempre visible */
@media (min-width: 641px) {
  .ct-body { scroll-padding-bottom: 96px; padding-bottom: 0; }
  .ct-done { padding-bottom: clamp(24px, 4vw, 36px); }
  .ct-actions { position: sticky; bottom: 0; z-index: 1; margin: 18px calc(-1 * clamp(22px, 4vw, 40px)) 0; padding: 14px clamp(22px, 4vw, 40px) 16px; border-top: 1px solid var(--rule); background: var(--white); }
}

/* información básica de protección de datos (primera capa) */
.ct-privacy { margin: 12px 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--muted); }
.ct-privacy a { color: var(--emerald); }
