/* Q.INGENIERÍA — hoja de estilos
   Diseño adaptable: móvil primero, tablet desde 640 px, ordenador desde 960 px */

:root {
  --marino: #0b2350;
  --marino-oscuro: #071834;
  --azul: #1677d2;
  --cian: #00aeef;
  --cian-claro: #e6f6fd;
  --fondo-claro: #f2f6fb;
  --texto: #1c2a3a;
  --texto-suave: #4c5d70;
  --borde: #d6e0ec;
  --blanco: #fff;
  --radio: 10px;
  --sombra: 0 6px 24px rgba(11, 35, 80, .08);
  --alto-cabecera: 64px;
  --fuente: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--alto-cabecera) + 8px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--texto);
  background: var(--blanco);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--azul); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--marino); }
p { margin: 0 0 1em; }

.saltar { position: absolute; left: -999px; top: 0; background: var(--marino); color: #fff; padding: .6em 1em; z-index: 100; }
.saltar:focus { left: 8px; top: 8px; }

.contenedor { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.contenedor--estrecho { max-width: 860px; }

/* ---------- Botones ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .8em 1.4em; border-radius: 8px; border: 2px solid transparent;
  font: 600 1rem/1.2 var(--fuente); text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .1s;
}
.boton svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.boton:active { transform: translateY(1px); }
.boton--primario { background: var(--cian); color: #fff; }
.boton--primario:hover { background: #0096d1; }
.boton--contorno { border-color: rgba(255,255,255,.7); color: #fff; }
.boton--contorno:hover { background: rgba(255,255,255,.12); }
.boton--ancho { width: 100%; }
.boton:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--cian); outline-offset: 2px;
}

/* ---------- Cabecera ---------- */
.cabecera {
  position: sticky; top: 0; z-index: 50;
  background: #fff;
  border-bottom: 1px solid transparent;
  transition: box-shadow .2s, border-color .2s;
}
.cabecera.con-sombra { box-shadow: 0 2px 16px rgba(11,35,80,.1); border-color: var(--borde); }
.cabecera__fila { display: flex; align-items: center; justify-content: space-between; height: var(--alto-cabecera); }
.cabecera__logo img { height: 44px; width: auto; }

.hamburguesa {
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px; margin-right: -10px;
  background: none; border: 0; cursor: pointer;
}
.hamburguesa span { display: block; height: 3px; border-radius: 2px; background: var(--marino); transition: transform .25s, opacity .2s; }
.hamburguesa[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburguesa[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburguesa[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Menú en móvil y tablet: desplegable */
.menu {
  position: absolute; top: var(--alto-cabecera); left: 0; right: 0;
  background: #fff; border-bottom: 1px solid var(--borde);
  box-shadow: 0 12px 24px rgba(11,35,80,.12);
  padding: 8px 20px 20px;
  display: none;
}
.menu.abierto { display: block; animation: bajar .2s ease-out; }
@keyframes bajar { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.menu__lista { list-style: none; margin: 0 0 12px; padding: 0; }
.menu__lista a {
  display: block; padding: 14px 4px; border-bottom: 1px solid var(--borde);
  color: var(--marino); font-weight: 600; text-decoration: none; font-size: 1.05rem;
}
.menu__lista a.activo { color: var(--cian); }
.menu__cta { width: 100%; }

/* ---------- Portada ---------- */
.portada { position: relative; background: var(--marino-oscuro); color: #fff; overflow: hidden; }
.portada__imagen img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: 60% 50%; }
.portada__texto { padding-top: 28px; padding-bottom: 36px; }
.portada h1 { color: #fff; font-size: clamp(1.9rem, 6.5vw, 3.2rem); font-weight: 700; letter-spacing: -.01em; }
.portada h1 span { display: block; color: var(--cian); }
.portada h1::after { content: ""; display: block; width: 72px; height: 4px; margin-top: 16px; background: var(--cian); border-radius: 2px; }
.portada__sub { font-size: clamp(1.1rem, 3.6vw, 1.45rem); margin-bottom: 18px; color: #e8f1fb; }
.lista-check { list-style: none; padding: 0; margin: 0 0 26px; }
.lista-check li { position: relative; padding-left: 30px; margin-bottom: 8px; color: #dbe7f5; }
.lista-check li::before {
  content: ""; position: absolute; left: 0; top: .2em; width: 18px; height: 18px;
  border: 2px solid var(--cian); border-radius: 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12l4 4 8-8' fill='none' stroke='%2300aeef' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.portada__botones { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Secciones ---------- */
.seccion { padding: 56px 0; }
.seccion--clara { background: var(--fondo-claro); }
.seccion--oscura { background: linear-gradient(160deg, var(--marino) 0%, var(--marino-oscuro) 100%); color: #dbe7f5; }
.titulo { text-align: center; font-size: clamp(1.6rem, 4.6vw, 2.2rem); }
.titulo::after { content: ""; display: block; width: 64px; height: 4px; margin: 14px auto 0; background: var(--cian); border-radius: 2px; }
.titulo--claro { color: #fff; }
.titulo--izq { text-align: left; }
.titulo--izq::after { margin-left: 0; }
.entradilla { text-align: center; max-width: 720px; margin: 0 auto 32px; color: var(--texto-suave); font-size: 1.06rem; }

/* Servicios */
.servicios { display: grid; gap: 20px; }
.tarjeta-servicio {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--fondo-claro); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 24px;
}
.tarjeta-servicio__icono { flex: 0 0 64px; }
.tarjeta-servicio__icono svg, .modalidad__icono svg {
  width: 64px; height: 64px; fill: none; stroke: var(--azul); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round;
}
.tarjeta-servicio h3 { font-size: 1.4rem; }
.tarjeta-servicio p { color: var(--texto-suave); }
.lista-punto { margin: 0; padding-left: 1.1em; color: var(--texto); }
.lista-punto li { margin-bottom: 4px; }
.lista-punto li::marker { color: var(--cian); }

.entregables { margin-top: 28px; text-align: center; }
.entregables__titulo { display: block; font-weight: 700; color: var(--marino); margin-bottom: 10px; }
.entregables ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.entregables li { background: var(--cian-claro); color: var(--marino); border-radius: 999px; padding: 4px 14px; font-weight: 600; font-size: .92rem; }

/* Modalidades */
.modalidades { display: grid; gap: 20px; }
.modalidad {
  background: #fff; border-radius: var(--radio); padding: 28px 24px; box-shadow: var(--sombra);
  border-top: 4px solid var(--cian); display: flex; flex-direction: column;
}
.modalidad__icono { margin-bottom: 12px; }
.modalidad h3 { font-size: 1.3rem; }
.modalidad p { color: var(--texto-suave); flex: 1; }
.modalidad__nota { font-size: .88rem; font-weight: 600; color: var(--azul); }

/* Proceso */
.proceso { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; counter-reset: paso; }
.paso { text-align: center; position: relative; }
.paso__icono {
  width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%;
  border: 2px solid var(--cian); box-shadow: 0 0 18px rgba(0,174,239,.35), inset 0 0 12px rgba(0,174,239,.2);
  display: grid; place-items: center;
}
.paso__icono svg { width: 38px; height: 38px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.paso h3 { color: #fff; font-size: 1.15rem; margin-bottom: .3em; }
.paso p { margin: 0 auto; max-width: 240px; font-size: .95rem; }

/* Aplicaciones: carrusel desplazable en móvil, cuadrícula en pantallas grandes */
.aplicaciones {
  display: grid; grid-auto-flow: column; grid-auto-columns: 78%;
  gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 12px; margin: 0 -20px; padding-left: 20px; padding-right: 20px;
  scrollbar-width: thin;
}
.aplicacion {
  margin: 0; scroll-snap-align: start; border-radius: var(--radio); overflow: hidden;
  background: var(--marino); box-shadow: var(--sombra);
}
.aplicacion img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.aplicacion figcaption { color: #fff; font-weight: 600; text-align: center; padding: 12px 10px; font-size: .98rem; }

/* Ventajas */
.ventajas { display: grid; gap: 18px; }
.ventaja { background: #fff; border-radius: var(--radio); padding: 22px; border-left: 4px solid var(--cian); box-shadow: var(--sombra); }
.ventaja h3 { font-size: 1.15rem; }
.ventaja p { margin: 0; color: var(--texto-suave); }

/* Preguntas */
.preguntas details { border: 1px solid var(--borde); border-radius: var(--radio); margin-bottom: 12px; background: #fff; }
.preguntas summary {
  cursor: pointer; list-style: none; padding: 16px 48px 16px 18px; font-weight: 600; color: var(--marino); position: relative;
}
.preguntas summary::-webkit-details-marker { display: none; }
.preguntas summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; color: var(--cian); line-height: 1;
}
.preguntas details[open] summary::after { content: "–"; }
.preguntas details p { padding: 0 18px 16px; margin: 0; color: var(--texto-suave); }

/* Llamada a la acción */
.llamada { background: linear-gradient(120deg, #123a78 0%, var(--marino) 60%, var(--marino-oscuro) 100%); color: #fff; padding: 40px 0; }
.llamada__fila { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.llamada h2 { color: #fff; font-size: clamp(1.5rem, 4.5vw, 2rem); margin-bottom: .2em; }
.llamada p { margin: 0; color: #dbe7f5; }

/* Presupuesto */
.presupuesto { display: grid; gap: 32px; }
.presupuesto__info p { color: var(--texto-suave); }
.contacto-lista { list-style: none; padding: 0; margin: 0 0 20px; }
.contacto-lista li { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 600; color: var(--marino); }
.contacto-lista svg { width: 22px; height: 22px; fill: none; stroke: var(--cian); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 22px; }
.nota { font-size: .92rem; background: var(--cian-claro); border-radius: 8px; padding: 12px 14px; }

.formulario { background: var(--fondo-claro); border: 1px solid var(--borde); border-radius: var(--radio); padding: 22px; }
.campo { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.campo label, .campo legend { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; color: var(--marino); padding: 0; }
.campo input[type="text"], .campo input[type="email"], .campo input[type="tel"], .campo input[type="url"], .campo select, .campo textarea {
  width: 100%; font: inherit; font-size: 16px; /* evita el zoom automático en iPhone */
  padding: 11px 12px; border: 1px solid #b9c7d8; border-radius: 8px; background: #fff; color: var(--texto);
}
.campo textarea { resize: vertical; min-height: 120px; }
.campo input[type="file"] { width: 100%; font-size: .95rem; padding: 10px; background: #fff; border: 1px dashed #b9c7d8; border-radius: 8px; }
.campo small { display: block; color: var(--texto-suave); font-size: .84rem; margin-top: 4px; }
.campo.error input, .campo.error textarea, .campo.error select { border-color: #c62828; }
.campo .mensaje-error { color: #c62828; font-size: .85rem; margin-top: 4px; display: block; }
.opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opcion { display: flex !important; align-items: center; gap: 8px; background: #fff; border: 1px solid #b9c7d8; border-radius: 8px; padding: 10px 12px; cursor: pointer; font-weight: 500 !important; margin: 0 !important; }
.opcion input { accent-color: var(--cian); width: 18px; height: 18px; flex: 0 0 18px; }
.opcion:has(input:checked) { border-color: var(--cian); background: var(--cian-claro); }
.consentimiento { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; margin: 6px 0 18px; }
.consentimiento input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--cian); flex: 0 0 20px; }
.consentimiento.error span { color: #c62828; }
.campo-oculto { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.formulario__estado { margin: 14px 0 0; font-weight: 600; min-height: 1.6em; }
.formulario__estado.ok { color: #1b7f3b; }
.formulario__estado.ko { color: #c62828; }
.formulario__estado.aviso { color: var(--azul); }
.boton[disabled] { opacity: .65; cursor: wait; }

/* Pie */
.pie { background: var(--marino-oscuro); color: #c6d4e6; padding: 44px 0 90px; }
.pie__fila { display: grid; gap: 28px; }
.pie__marca img { width: 230px; margin-bottom: 10px; }
.pie__marca p { margin: 0; color: #9fb4cc; font-style: italic; }
.pie h3 { color: #fff; font-size: 1rem; margin-bottom: 10px; }
.pie__enlaces { list-style: none; padding: 0; margin: 0; }
.pie__enlaces li { margin-bottom: 6px; }
.pie__enlaces a { color: #c6d4e6; text-decoration: none; }
.pie__enlaces a:hover { color: var(--cian); }
.pie__enlaces a::before { content: "→ "; color: var(--cian); }
.pie__legal { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 32px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: .88rem; }
.pie__legal a { color: #9fb4cc; }

/* Botón fijo de presupuesto en móvil */
.cta-movil {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
  padding: 14px; border-radius: 10px; text-align: center; font-weight: 700; text-decoration: none;
  background: var(--cian); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transform: translateY(140%); transition: transform .25s ease;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px) * .5);
}
.cta-movil.visible { transform: none; }

/* Páginas legales */
.texto-legal h1 { font-size: clamp(1.7rem, 5vw, 2.2rem); }
.texto-legal h2 { font-size: 1.2rem; margin-top: 1.6em; }
.texto-legal h3 { font-size: 1.05rem; margin-top: 1.2em; }
.texto-legal p, .texto-legal li { color: var(--texto-suave); }

/* ========== TABLET (≥ 640 px) ========== */
@media (min-width: 640px) {
  :root { --alto-cabecera: 72px; }
  .contenedor { padding: 0 32px; }
  .cabecera__logo img { height: 52px; }
  .seccion { padding: 72px 0; }
  .modalidades { grid-template-columns: repeat(2, 1fr); }
  .modalidad:last-child { grid-column: 1 / -1; }
  .proceso { grid-template-columns: repeat(2, 1fr); }
  .aplicaciones { grid-auto-columns: 44%; margin: 0 -32px; padding-left: 32px; padding-right: 32px; }
  .ventajas { grid-template-columns: repeat(2, 1fr); }
  .llamada__fila { flex-direction: row; align-items: center; justify-content: space-between; }
  .fila-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .fila-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
  .opciones { grid-template-columns: repeat(4, 1fr); }
  .formulario { padding: 28px; }
  .pie__fila { grid-template-columns: 1.4fr 1fr 1fr; }

  /* Portada con el texto sobre la imagen */
  .portada { min-height: 520px; display: flex; align-items: center; }
  .portada__imagen { position: absolute; top: 0; bottom: 0; right: 0; left: 30%; }
  .portada__imagen img { height: 100%; aspect-ratio: auto; object-position: 35% 50%; }
  .portada::before {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(90deg, var(--marino-oscuro) 0%, var(--marino-oscuro) 30%, rgba(7,24,52,.75) 42%, rgba(7,24,52,.15) 62%, rgba(7,24,52,0) 100%);
  }
  .portada__texto { position: relative; z-index: 2; padding-top: 56px; padding-bottom: 56px; }
  .portada h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); }
  .portada__texto > * { max-width: 470px; }
}

/* ========== ORDENADOR (≥ 960 px) ========== */
@media (min-width: 960px) {
  :root { --alto-cabecera: 84px; }
  .cabecera__logo img { height: 60px; }
  .hamburguesa { display: none; }
  .menu {
    position: static; display: flex !important; align-items: center; gap: 20px;
    background: none; border: 0; box-shadow: none; padding: 0; animation: none;
  }
  .menu__lista { display: flex; gap: 4px; margin: 0; }
  .menu__lista a { border: 0; padding: 8px 12px; border-radius: 6px; font-size: .98rem; }
  .menu__lista a:hover { background: var(--fondo-claro); }
  .menu__lista a.activo { background: var(--cian); color: #fff; }
  .menu__cta { width: auto; padding: .65em 1.1em; }

  .portada { min-height: 600px; }
  .portada__texto > * { max-width: 520px; }

  .servicios { grid-template-columns: 1fr 1fr; }
  .modalidades { grid-template-columns: repeat(3, 1fr); }
  .modalidad:last-child { grid-column: auto; }
  .proceso { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .paso:not(:last-child)::after {
    content: ""; position: absolute; top: 38px; right: -18%; width: 24%; height: 2px;
    background: linear-gradient(90deg, rgba(0,174,239,0), var(--cian));
  }
  .aplicaciones { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; margin: 0; padding: 0; }
  .ventajas { grid-template-columns: repeat(4, 1fr); }
  .presupuesto { grid-template-columns: 1fr 1.6fr; gap: 48px; align-items: start; }
  .presupuesto__info { position: sticky; top: calc(var(--alto-cabecera) + 24px); }
  .pie { padding-bottom: 44px; }
  .cta-movil { display: none; }
}

@media (min-width: 1200px) {
  .menu__lista a { padding: 8px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
