/* Formularios de servicio (generados desde forms.config.json). Mismos tokens que el resto del sitio. */
.f {
  --f-fg: #f5f2e9; --f-bg: #24242e; --f-line: rgb(245 242 233 / 45%); --f-focus: #72a9e8; --f-err: #ffb4a8; --f-sh: #2e6ab1;
  display: grid; gap: 16px; width: 100%; max-width: 760px; padding: clamp(18px, 4vw, 32px);
  background: var(--f-bg); color: var(--f-fg); border: 1px solid var(--f-line); box-shadow: 5px 5px 0 var(--f-sh);
  text-align: left; font: 400 1rem/1.5 Arial, Helvetica, sans-serif; text-transform: none; letter-spacing: 0;
}
.f--card { --f-bg: #293f61; --f-sh: #0c0d0c; }
.f--paper { --f-fg: #0c0d0c; --f-bg: #f5f2e9; --f-line: rgb(12 13 12 / 45%); --f-focus: #2e6ab1; --f-err: #a31d00; --f-sh: #0c0d0c; }
.f-title { margin: 0; font-size: clamp(1.25rem, 5vw, 1.75rem); font-weight: 800; letter-spacing: -0.02em; text-transform: uppercase; line-height: 1.1; }
.f-intro { margin: 0; }
.f [data-body] { display: grid; gap: 16px; }
.f-grid { display: grid; gap: 16px; }
.f-field { display: grid; gap: 6px; min-width: 0; }
.f-field[hidden] { display: none; }
.f label { font-weight: 700; font-size: 0.9375rem; }
.f-opt, .f-hint { font-weight: 400; opacity: 0.85; font-size: 0.875rem; margin: 0; }
.f input:not([type='checkbox']), .f select, .f textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--f-line); border-radius: 0;
  background: transparent; color: inherit; font: inherit; appearance: none; -webkit-appearance: none;
}
.f select { background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.f select option { color: #0c0d0c; background: #f5f2e9; }
.f textarea { min-height: 96px; resize: vertical; }
.f :is(input, select, textarea):focus-visible, .f-check:has(input:focus-visible) { outline: 3px solid var(--f-focus); outline-offset: 2px; }
.f [aria-invalid='true'] { border-color: var(--f-err); box-shadow: inset 0 0 0 1px var(--f-err); }
.f-error { margin: 0; color: var(--f-err); font-weight: 700; font-size: 0.875rem; }
.f-error[hidden], .f-hints[hidden], .f-status[hidden] { display: none; }
/* Casilla: toda la fila es clicable y mide al menos 44 px */
.f-check { display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 8px 0; font-weight: 400; cursor: pointer; }
.f-check input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--f-focus); }
.f-check a, .f-legal a { color: inherit; text-underline-offset: 3px; }
.f-legal { margin: 0; font-size: 0.875rem; opacity: 0.88; line-height: 1.45; }
.f-hints { display: grid; gap: 8px; padding: 12px 14px; border-left: 4px solid var(--f-focus); background: rgb(114 169 232 / 14%); }
.f--paper .f-hints { background: rgb(46 106 177 / 10%); }
.f-hints p { margin: 0; font-size: 0.9375rem; }
.f-submit { justify-self: start; width: 100%; --bg: #f5f2e9; --fg: #0c0d0c; --sh: #2e6ab1; }
.f--paper .f-submit { --bg: #0c0d0c; --fg: #f5f2e9; }
.f-submit[disabled] { opacity: 0.6; cursor: progress; }
.f-status { margin: 0; padding: 12px 14px; border: 1px solid var(--f-line); font-weight: 700; }
.f-status[data-kind='error'] { border-color: var(--f-err); color: var(--f-err); }
.f-noscript { margin: 0; font-size: 0.9375rem; }
/* Rejilla de 6 columnas: nombre · correo · teléfono, empresa y campo específico, mensaje */
@media (min-width: 640px) {
  .f-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .f-field { grid-column: span 3; }
  .f-field[data-field='mensaje'], .f-field[data-kind='extra'], .f-field[data-field='privacidad'] { grid-column: 1 / -1; }
  .f-submit { width: auto; }
}
@media (prefers-reduced-motion: reduce) { .f * { transition: none !important; } }
@media (forced-colors: active) { .f-hints { border: 1px solid CanvasText; } }

/* ═════ Envío: botón «Enviando…» y panel de éxito / error que cubre la tarjeta ═════
   La tarjeta no cambia nunca de tamaño ni de posición: el panel es un overlay absoluto (inset: 0) y el formulario se queda en el flujo,
   oculto con opacity/visibility e `inert` (sin display:none ni height:0). Solo transform, opacity y clip-path (+ el trazo del SVG). */
.f { position: relative; overflow: hidden; }
.f-main { display: grid; gap: 16px; transition: opacity 360ms var(--ease, ease), filter 360ms var(--ease, ease), visibility 0s linear 0s; }
.f.is-sent .f-main, .f.is-failed .f-main { opacity: 0; filter: blur(5px); visibility: hidden; pointer-events: none; transition-delay: 0s, 0s, 360ms; }
/* Botón: las dos etiquetas comparten celda, así el ancho y el alto son siempre los mismos */
.f-submit__in { display: inline-grid; }
.f-submit__l, .f-submit__s { grid-area: 1 / 1; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.f-submit__s { opacity: 0; }
.f-submit__l { transition: opacity 160ms; }
.f.is-sending .f-submit__l { opacity: 0; }
.f.is-sending .f-submit__s { opacity: 1; }
.f-submit:has(.f-submit__in)::after { content: none; }
.f-spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: f-spin 800ms linear infinite; }
@keyframes f-spin { to { transform: rotate(360deg); } }
.f-submit[disabled] { opacity: 1; }
.f.is-sending .f-submit { cursor: progress; }

/* Overlay */
.f-over { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: clamp(14px, 4vw, 32px); background: #24242e; color: #f5f2e9;
  visibility: hidden; opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0);
  transition: clip-path 560ms cubic-bezier(.65, 0, .25, 1), opacity 200ms linear 0s, visibility 0s linear 560ms; }
.f.is-sent .f-over, .f.is-failed .f-over { visibility: visible; opacity: 1; pointer-events: auto; clip-path: inset(0 0 0 0); transition-delay: 0s, 0s, 0s; }
.f-panel { grid-area: 1 / 1; display: grid; justify-items: center; align-content: center; gap: 10px; width: 100%; max-height: 100%; text-align: center; outline: none; visibility: hidden; }
.f.is-sent .f-panel--ok, .f.is-failed .f-panel--err { visibility: visible; }
.f-panel > * { margin: 0; }
.f-panel__t { font-size: clamp(1.25rem, 5vw, 1.625rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; text-transform: uppercase; }
.f-panel__p { max-width: 36ch; font-size: 0.9375rem; line-height: 1.5; }
.f-panel__p a { color: #f5f2e9; text-underline-offset: 3px; }
.f-panel__b { min-height: 44px; margin-top: 4px; padding: 0 20px; border: 2px solid #f5f2e9; background: transparent; color: #f5f2e9; font: 700 0.8125rem/1 Arial, Helvetica, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; transition: background-color 140ms, color 140ms; }
@media (hover: hover) { .f-panel__b:hover { background: #f5f2e9; color: #24242e; } }
.f-panel__b:active { background: #f5f2e9; color: #24242e; }
.f-panel__b:focus-visible, .f-panel__p a:focus-visible, .f-panel:focus-visible { outline: 3px solid #72a9e8; outline-offset: 3px; }
/* Icono: círculo y marca dibujados con trazo; destellos de marca saliendo del check */
.f-ico { position: relative; display: grid; place-items: center; width: 72px; height: 72px; color: #72a9e8; }
.f-ico svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.f-ico__c, .f-ico__k { stroke-dasharray: 1; stroke-dashoffset: 1; }
.f-ico { margin-bottom: 4px; }
.f-panel--err .f-ico { color: #ffb4a8; }
.f-spark { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #72a9e8; opacity: 0; }
.f-spark:nth-of-type(even) { background: #f5f2e9; }
.f-spark:nth-of-type(3n) { background: #2e6ab1; width: 5px; height: 5px; }
.f-spark.s1 { --tx: 0px; --ty: -52px; } .f-spark.s2 { --tx: 37px; --ty: -37px; } .f-spark.s3 { --tx: 52px; --ty: 0px; } .f-spark.s4 { --tx: 37px; --ty: 37px; }
.f-spark.s5 { --tx: 0px; --ty: 52px; } .f-spark.s6 { --tx: -37px; --ty: 37px; } .f-spark.s7 { --tx: -52px; --ty: 0px; } .f-spark.s8 { --tx: -37px; --ty: -37px; }

/* Entrada: primero el círculo, luego la marca; título, texto y botón escalonados (60–100 ms); pulso suave y destellos */
.f.is-sent .f-ico__c, .f.is-failed .f-ico__c { animation: f-draw 520ms cubic-bezier(.4, 0, .2, 1) 360ms forwards; }
.f.is-sent .f-ico__k, .f.is-failed .f-ico__k { animation: f-draw 340ms cubic-bezier(.4, 0, .2, 1) 840ms forwards; }
.f.is-sent .f-ico, .f.is-failed .f-ico { animation: f-pulse 520ms ease-out 1180ms both; }
.f.is-sent .f-spark { animation: f-spark 700ms cubic-bezier(.2, .7, .3, 1) 1060ms both; }
.f.is-sent .f-panel__t, .f.is-sent .f-panel__p, .f.is-sent .f-panel__b,
.f.is-failed .f-panel__t, .f.is-failed .f-panel__p, .f.is-failed .f-panel__b { animation: f-rise 420ms cubic-bezier(.2, .7, .2, 1) both; }
.f.is-sent .f-panel__t, .f.is-failed .f-panel__t { animation-delay: 720ms; }
.f.is-sent .f-panel__p, .f.is-failed .f-panel__p { animation-delay: 800ms; }
.f.is-sent .f-panel__b, .f.is-failed .f-panel__b { animation-delay: 880ms; }
@keyframes f-draw { to { stroke-dashoffset: 0; } }
@keyframes f-pulse { 0% { transform: scale(1); } 45% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes f-spark { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(1); } }
@keyframes f-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* Móvil: el panel se compacta, nunca hace crecer la tarjeta */
@media (max-width: 639px), (max-height: 500px) {
  .f-over { padding: 12px; }
  .f-panel { gap: 7px; }
  .f-ico { width: 56px; height: 56px; }
  .f-panel__p { font-size: 0.875rem; line-height: 1.4; }
}
/* Sin movimiento: solo un fundido corto, con la marca ya dibujada */
@media (prefers-reduced-motion: reduce) {
  .f-main, .f-over { transition: opacity 150ms linear !important; }
  .f.is-sent .f-main, .f.is-failed .f-main { filter: none; transition: opacity 150ms linear, visibility 0s linear 150ms !important; }
  .f-over { clip-path: none; transition: opacity 150ms linear !important; }
  .f:not(.is-sent):not(.is-failed) .f-over { transition: opacity 150ms linear, visibility 0s linear 150ms !important; }
  .f-ico__c, .f-ico__k { stroke-dashoffset: 0; animation: none !important; }
  .f-ico, .f-spark, .f-panel__t, .f-panel__p, .f-panel__b { animation: none !important; }
  .f-spark { display: none; }
  .f-spin { animation: none; border-right-color: currentColor; }
}
@media (forced-colors: active) { .f-over { border: 1px solid CanvasText; } .f-ico { color: CanvasText; } }

/* ═════ Sección de contacto (Inicio, servicios, Proyectos y Diseño web): texto y canales a la izquierda, formulario visible a la derecha ═════ */
.panel__in.contact { display: grid; gap: 28px; }
.contact__info { display: grid; gap: 22px; align-content: start; }
.contact__cta { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.contact__in { --fg: var(--c-paper); font-size: 0.875rem; }
.contact__list { display: grid; gap: 0; justify-items: start; }
.contact__list a:not(.button) { display: inline-flex; align-items: center; min-height: 44px; font-size: 1.0625rem; font-weight: 700; text-underline-offset: 5px; }
.contact__social { display: flex; gap: 4px; align-items: center; margin-left: -10px; }
.contact__social a { opacity: 0.85; }
.contact__form .f { max-width: none; }
.contact__form .f-title { font-size: 1.125rem; }
.contact__form .f-grid { gap: 12px; }
.contact__form .f-submit { width: 100%; }
.contact__form .f-legal { font-size: 0.8125rem; }
@media (min-width: 700px) { .contact__list { grid-auto-flow: column; justify-content: start; gap: 8px 28px; align-items: center; } }
@media (min-width: 900px) {
  .panel__in.contact { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s6, 40px) clamp(32px, 5vw, 80px); align-items: center; }
  .contact__list { grid-auto-flow: row; }
}
@media (max-width: 699px) {
  .contact__form .f { padding: 16px; }
  .contact__list { display: none; }
  .contact__info .lead { display: none; }
  .contact__wa { display: none; }
  .contact__cta { margin-bottom: -4px; }
}
/* Escritorio con deck: formulario compacto; el bloque (texto, formulario, cinta y pie) cabe en la pantalla */
@media (min-width: 1100px) and (min-height: 800px) and (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .panel__in.contact { gap: 28px clamp(32px, 5vw, 72px); grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .contact__form { justify-self: end; width: 100%; max-width: 660px; }
  .contact__form .f { padding: 16px 22px 14px; gap: 8px; box-shadow: 4px 4px 0 var(--f-sh); }
  .contact__form .f [data-body] { gap: 8px; }
  .contact__form .f-title { font-size: 1rem; }
  .contact__form .f-grid { gap: 8px 12px; }
  .f-field[data-field='nombre'], .f-field[data-field='correo'], .f-field[data-field='telefono'] { grid-column: span 2; }
  .contact__form .f label { font-size: 0.8125rem; }
  .contact__form .f-field { gap: 4px; }
  .contact__form .f input:not([type='checkbox']), .contact__form .f select { min-height: 44px; padding: 8px 10px; }
  .contact__form .f-field[data-field='empresa'] { grid-column: span 3; }
  .contact__form .f-field[data-kind='extra'] { grid-column: span 3; }
  .contact__form .f-grid:not(:has([data-kind='extra'])) .f-field[data-field='empresa'] { grid-column: span 6; }
  .contact__form [data-field='mensaje'] textarea { min-height: 52px; height: 52px; resize: none; }
  .contact__form .f-check { min-height: 36px; padding: 2px 0; font-size: 0.8125rem; }
  .contact__form .f-check input { width: 20px; height: 20px; }
  .contact__form .f-legal { font-size: 0.6875rem; line-height: 1.35; }
  .contact__form .f-submit { min-height: 44px; }
}

/* Táctil: enlaces de la capa informativa y de la casilla con área de toque de 44 px (relleno en línea: no cambia el interlineado) */
@media (max-width: 1023px), (hover: none) and (pointer: coarse) {
  .f-legal a, .f-check a { padding-block: 13px; }
}
