/* ==========================================================================
   Formulario de contacto (ventana dentro de la página) · lo usa formulario.js
   Prefijo «fc-» = formulario de contacto, para no chocar con styles.css.
   Toma de la landing: --color-1 y --color-2 (marca), --fuente y --fuente-titulo.
   Si no existen, usa los mismos valores por defecto.
   ========================================================================== */

.fc {
  --fc-c1: color-mix(in oklab, var(--color-1, #57985f) 80%, #fff 20%);
  --fc-c2: color-mix(in oklab, var(--color-2, #152d8f) 72%, #fff 28%);
  --fc-cm: color-mix(in oklab, var(--fc-c1), var(--fc-c2));
  --fc-panel: #0f0f0f;
  --fc-campo: #161616;
  --fc-borde: #262626;
  --fc-texto: #f2f2f2;
  --fc-texto-2: #a1a1a1;
  --fc-texto-3: #6f6f6f;
  --fc-rojo: #ff7b72;
  --fc-curva: cubic-bezier(.2, .7, .2, 1);
  position: fixed;
  inset: 0;
  z-index: 1000;
  color: var(--fc-texto);
  font-family: var(--fuente, "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
}
/* Donde el navegador lo permite, el verde y el azul salen más vivos (igual que los botones destacados). */
@supports (color: oklch(from red l c h)) {
  .fc {
    --fc-c1: oklch(from var(--color-1, #57985f) calc(l + 0.1) calc(c * 1.45) h);
    --fc-c2: oklch(from var(--color-2, #152d8f) calc(l + 0.16) calc(c * 1.1) h);
  }
}
@supports not (color: color-mix(in oklab, red, blue)) {
  .fc { --fc-c1: #74b37b; --fc-c2: #4f63c4; --fc-cm: #6189a0; }
}

.fc *, .fc *::before, .fc *::after { box-sizing: border-box; }
.fc[hidden], .fc [hidden] { display: none !important; }
.fc :focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.fc-ventana:focus, .fc-ventana:focus-visible, .fc-exito-titulo:focus { outline: none; }

/* La página de atrás no se mueve mientras la ventana está abierta. */
html.fc-bloqueo, html.fc-bloqueo body { overflow: hidden !important; }

/* ---------- Fondo y capa ---------- */
.fc-fondo {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .62);
  -webkit-backdrop-filter: blur(12px) saturate(.9);
          backdrop-filter: blur(12px) saturate(.9);
  opacity: 0;
  transition: opacity .25s ease;
}
.fc-capa {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.fc:not(.fc-abierto) { pointer-events: none; }
.fc-abierto .fc-fondo { opacity: 1; transition-duration: .4s; }

/* ---------- Ventana ---------- */
.fc-ventana {
  position: relative;
  flex: none;
  width: 100%;
  max-width: 460px;
  margin: auto;
  padding: 30px 28px 28px;
  border-radius: 20px;
  background: var(--fc-panel);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 30px 80px -20px rgba(0, 0, 0, .85);
  opacity: 0;
  transform: translateY(14px) scale(.97);
  transition: opacity .22s ease, transform .3s ease;
}
/* Un brillo muy suave arriba, con el verde y el azul de la credencial. */
@supports (background: color-mix(in oklab, red 10%, transparent)) {
  .fc-ventana {
    background:
      radial-gradient(90% 50% at 0% 0%, color-mix(in oklab, var(--color-1, #57985f) 12%, transparent), transparent 70%),
      radial-gradient(90% 50% at 100% 0%, color-mix(in oklab, var(--color-2, #152d8f) 16%, transparent), transparent 70%),
      var(--fc-panel);
  }
}
.fc-abierto .fc-ventana {
  opacity: 1;
  transform: none;
  transition: opacity .45s ease, transform .6s var(--fc-curva);
}

/* Entrada escalonada de los elementos (como el resto de la página). */
.fc-anima {
  opacity: 0;
  transform: translateY(6px);
  filter: blur(3px);
  transition: opacity .2s ease, transform .2s ease, filter .2s ease;
}
.fc-abierto .fc-anima {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity .5s ease var(--fc-d, 0ms), transform .6s var(--fc-curva) var(--fc-d, 0ms), filter .5s ease var(--fc-d, 0ms);
}

/* ---------- Botón de cerrar ---------- */
.fc-cerrar {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  color: var(--fc-texto-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease, color .2s ease, transform .2s var(--fc-curva);
}
.fc-cerrar:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.fc-cerrar:active { transform: scale(.94); }
.fc-cerrar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- Textos ---------- */
.fc-titulo {
  margin: 0;
  padding-right: 44px;
  font-family: var(--fuente-titulo, "Inter Tight", "DM Sans", system-ui, sans-serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: #fff;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.fc-descripcion {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--fc-texto-2);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

/* ---------- Campos ---------- */
.fc-formulario { display: grid; gap: 16px; margin: 24px 0 0; }
.fc-campo { min-width: 0; }
.fc-etiqueta {
  display: block;
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: #d6d6d6;
}
.fc-opcional { font-weight: 400; color: var(--fc-texto-3); }
.fc-control { position: relative; isolation: isolate; border-radius: 12px; }
.fc-entrada {
  display: block;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--fc-borde);
  border-radius: 12px;
  background: var(--fc-campo);
  color: var(--fc-texto);
  font: inherit;
  font-size: 16px;            /* 16 px: así el iPhone no hace zoom al escribir */
  line-height: 1.4;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
          appearance: none;
  transition: border-color .2s ease, background-color .2s ease;
}
textarea.fc-entrada {
  height: auto;
  min-height: 120px;
  max-height: 40vh;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}
.fc-entrada::placeholder { color: #5a5a5a; opacity: 1; }
.fc-entrada:hover { border-color: #333; }
.fc-entrada:focus-visible { outline: none; }
.fc-entrada:-webkit-autofill,
.fc-entrada:-webkit-autofill:hover,
.fc-entrada:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--fc-texto);
  -webkit-box-shadow: 0 0 0 100px var(--fc-campo) inset;
  caret-color: var(--fc-texto);
}

/* Aro de foco en degradado (verde → azul) + halo suave. */
.fc-control::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 1;
  border-radius: 13px;
  padding: 2px;
  background: linear-gradient(100deg, var(--fc-c1) 0%, var(--fc-cm) 52%, var(--fc-c2) 100%) border-box;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.fc-control::after {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: -1;
  border-radius: 12px;
  background: linear-gradient(100deg, var(--fc-c1), var(--fc-c2));
  filter: blur(14px);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.fc-control:focus-within::before { opacity: 1; }
.fc-control:focus-within::after { opacity: .3; }
.fc-control:focus-within .fc-entrada { border-color: transparent; background-color: #181818; }

/* Errores */
.fc-con-error .fc-entrada { border-color: rgba(255, 123, 114, .6); }
.fc-error {
  margin: 7px 2px 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--fc-rojo);
}
.fc-error:empty { display: none; }
.fc-error:not(:empty) { animation: fc-error-entra .25s var(--fc-curva); }
@keyframes fc-error-entra { from { opacity: 0; transform: translateY(-3px); } }
.fc-pie { display: flex; align-items: flex-start; gap: 12px; }
.fc-pie .fc-error { flex: 1 1 auto; min-width: 0; }
.fc-contador {
  flex: none;
  margin: 7px 2px 0 auto;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--fc-texto-3);
  font-variant-numeric: tabular-nums;
  transition: color .2s ease;
}
.fc-contador.fc-cerca { color: #e0b25c; }

/* Campo trampa para robots: fuera de la vista, pero no con display:none. */
.fc-trampa {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  clip-path: inset(50%);
  pointer-events: none;
}

/* Solo para lectores de pantalla */
.fc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Aviso general y botón de enviar ---------- */
.fc-acciones { margin-top: 4px; }
.fc-aviso:not(:empty) {
  display: flex;
  gap: 10px;
  margin: 0 0 14px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 123, 114, .28);
  border-radius: 12px;
  background: rgba(255, 123, 114, .08);
  color: #ffb3ad;
  font-size: 14px;
  line-height: 1.4;
  animation: fc-error-entra .3s var(--fc-curva);
}
.fc-aviso:not(:empty)::before {
  content: "!";
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--fc-rojo);
  color: #1a0b0a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.fc-boton {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #0b0b0b;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s ease, transform .2s var(--fc-curva);
}
.fc-boton:hover { background: #e4e4e4; }
.fc-boton:active { transform: scale(.98); }
.fc-enviar-texto { overflow: hidden; text-overflow: ellipsis; }
.fc-boton[aria-disabled="true"] { background: #d9d9d9; cursor: progress; }
.fc-boton[aria-disabled="true"]:active { transform: none; }
.fc-giro {
  display: none;
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(11, 11, 11, .2);
  border-top-color: #0b0b0b;
  border-radius: 50%;
  animation: fc-girar .75s linear infinite;
}
.fc-enviando .fc-giro { display: block; }
@keyframes fc-girar { to { transform: rotate(360deg); } }

/* ---------- Pantalla de «gracias» ---------- */
.fc-vista-exito {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 0 0;
  text-align: center;
}
.fc-vista-exito .fc-titulo { margin-top: 26px; padding: 0 8px; }
.fc-vista-exito .fc-descripcion { max-width: 32ch; }
.fc-vista-exito > * { animation: fc-sube .6s var(--fc-curva) both; }
.fc-vista-exito > .fc-titulo { animation-delay: .18s; }
.fc-vista-exito > .fc-descripcion { animation-delay: .26s; }
.fc-listo { margin-top: 28px; animation-delay: .34s !important; }
@keyframes fc-sube { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }

.fc-check {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fc-c1), var(--fc-c2));
  box-shadow:
    0 0 0 8px color-mix(in oklab, var(--fc-cm) 16%, transparent),
    0 16px 44px -10px color-mix(in oklab, var(--fc-cm) 75%, transparent);
  animation: fc-pop .7s var(--fc-curva) both !important;
}
.fc-check svg { position: relative; width: 44px; height: 44px; overflow: visible; }
.fc-check-trazo {
  fill: none;
  stroke: #fff;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 1.1;
  stroke-dashoffset: 1.05;
  animation: fc-trazo .45s cubic-bezier(.65, 0, .35, 1) .38s forwards;
}
.fc-check-onda {
  position: absolute;
  inset: 0;
  border: 2px solid var(--fc-c1);
  border-radius: 50%;
  opacity: 0;
  animation: fc-onda 1.1s ease-out .28s;
}
.fc-destellos { position: absolute; inset: 0; pointer-events: none; }
.fc-destellos i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--s, 10px);
  height: var(--s, 10px);
  margin: calc(var(--s, 10px) / -2);
  background: color-mix(in oklab, var(--fc-c1) 45%, #fff 55%);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0c.4 2.9 1.4 4 5 5-3.6 1-4.6 2.1-5 5-.4-2.9-1.4-4-5-5 3.6-1 4.6-2.1 5-5Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0c.4 2.9 1.4 4 5 5-3.6 1-4.6 2.1-5 5-.4-2.9-1.4-4-5-5 3.6-1 4.6-2.1 5-5Z'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0;
  animation: fc-destello 1s ease-out var(--t, .35s) both;
}
@keyframes fc-pop {
  0% { opacity: 0; transform: scale(.4); }
  55% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes fc-trazo { to { stroke-dashoffset: 0; } }
@keyframes fc-onda {
  0% { opacity: .7; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.9); }
}
@keyframes fc-destello {
  0% { opacity: 0; transform: translate(0, 0) scale(.2) rotate(0deg); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1) rotate(45deg); }
}

/* ---------- Celular: sale como hoja desde abajo ---------- */
@media (max-width: 759px) {
  .fc-capa { padding: 16px 0 0; }
  .fc-ventana {
    max-width: none;
    margin: auto 0 0;
    padding: 26px 20px calc(22px + env(safe-area-inset-bottom, 0px));
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -1px 0 rgba(255, 255, 255, .08), 0 -24px 60px -12px rgba(0, 0, 0, .8);
    opacity: 1;
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.4, 0, 1, 1);
  }
  .fc-abierto .fc-ventana {
    opacity: 1;
    transform: none;
    transition: transform .55s var(--fc-curva);
  }
  .fc-cerrar { top: 14px; right: 14px; width: 38px; height: 38px; }
  .fc-titulo { font-size: 28px; }
  .fc-formulario { gap: 14px; margin-top: 20px; }
  textarea.fc-entrada { min-height: 108px; }
}

/* ---------- Menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  .fc-ventana, .fc-abierto .fc-ventana { transform: none; opacity: 0; transition: opacity .15s ease; }
  .fc-abierto .fc-ventana { opacity: 1; }
  .fc-anima, .fc-abierto .fc-anima { transform: none; filter: none; transition: opacity .15s ease; }
  .fc-vista-exito > *, .fc-error:not(:empty), .fc-aviso:not(:empty) { animation: none !important; }
  .fc-check { animation: none !important; }
  .fc-check-onda, .fc-destellos { display: none; }
  .fc-check-trazo { animation: none; stroke-dashoffset: 0; }
  .fc-giro { animation-duration: 1.6s; }
}
