/* =========================================================
   Aguilar Toledo — Sistema visual "Lámina técnica"
   Azul Aguilar = consultoría / diseño · Verde Toledo = obra
   ========================================================= */
:root {
  --tinta: #0E2233;
  --acero: #0B5C99;
  --acero-900: #073B63;
  --obra: #62BC46;
  --obra-600: #3E9A2B;
  --obra-700: #2E7D1F;
  --calco: #F3F7FA;
  --linea: #C8D6E1;
}

html { scroll-behavior: smooth; scroll-padding-top: 76px; scrollbar-width: thin; scrollbar-color: var(--acero) var(--calco); }
@media (min-width: 768px) { html { scroll-padding-top: 88px; } }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--calco); }
::-webkit-scrollbar-thumb { background: rgba(11, 92, 153, .45); border-radius: 999px; border: 2px solid var(--calco); }
::-webkit-scrollbar-thumb:hover { background: var(--acero); }
body {
  font-family: 'Overpass', system-ui, sans-serif;
  color: var(--tinta);
  background: #fff;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
a, button, summary, select { touch-action: manipulation; }
.f-display { font-family: 'Archivo', system-ui, sans-serif; font-stretch: 125%; letter-spacing: -0.025em; }
.f-mono { font-family: 'Overpass Mono', ui-monospace, monospace; }
:focus-visible { outline: 3px solid var(--obra); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--obra); color: var(--tinta); }

/* ---------- Papel de dibujo ---------- */
.papel {
  overflow-x: clip;
  background-color: var(--calco);
  background-image:
    linear-gradient(rgba(11, 92, 153, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 92, 153, .08) 1px, transparent 1px),
    linear-gradient(rgba(11, 92, 153, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 92, 153, .035) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
}
.papel-oscuro {
  background-color: var(--acero-900);
  background-image:
    linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
}

/* ---------- Tablero: la barra verde del logotipo ---------- */
.tablero {
  height: 10px;
  background: var(--obra);
  clip-path: polygon(0 0, 100% 0, calc(100% - 26px) 100%, 0 100%);
}
.tablero--acero { background: var(--acero); }
.tablero--fino { height: 6px; }

/* ---------- Encabezado ---------- */
.nav-link { position: relative; padding: 6px 0; }
.nav-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 4px;
  background: var(--obra); transform: scaleX(0); transform-origin: left;
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  transition: transform .3s ease;
}
.nav-link:hover::after, .nav-link[aria-current="true"]::after { transform: scaleX(1); }
.nav-link[aria-current="true"] { color: var(--acero); }
#avance { transform: scaleX(0); transform-origin: left; }

/* ---------- Lámina principal (hero) ---------- */
.lamina { position: relative; container-type: inline-size; }
.dibujo { position: relative; aspect-ratio: 1200 / 520; margin-top: 1.5rem; }
.dibujo svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.h1-l1, .h1-l2 { display: block; line-height: .95; }

@media (min-width: 1024px) {
  .lamina { aspect-ratio: 1200 / 520; }
  .dibujo { position: absolute; inset: 0; margin: 0; aspect-ratio: auto; }
  .h1-l1, .h1-l2 { position: absolute; z-index: 2; font-size: 6.8cqw; line-height: 1; }
  .h1-l1 { left: 49%; bottom: calc(42.3% - .16em); }
  .h1-l2 { left: 33%; top: 64%; }
  .lamina-eyebrow { position: absolute; z-index: 2; right: 0; top: 7%; text-align: right; }
}

/* Secuencia de trazado del puente */
.trazo { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: trazar 1.1s cubic-bezier(.65, 0, .25, 1) var(--d, 0s) forwards; }
@keyframes trazar { to { stroke-dashoffset: 0; } }
.tab-anim { transform-box: fill-box; transform-origin: left center; transform: scaleX(0); animation: extender 1s cubic-bezier(.65, 0, .25, 1) .15s forwards; }
@keyframes extender { to { transform: scaleX(1); } }
.pilon-anim { transform-box: fill-box; transform-origin: center bottom; transform: scaleY(0); animation: levantar .8s cubic-bezier(.65, 0, .25, 1) .55s forwards; }
@keyframes levantar { to { transform: scaleY(1); } }
.anot { opacity: 0; animation: aparecer .7s ease var(--d, 1.9s) forwards; }
@keyframes aparecer { to { opacity: 1; } }
.h1-l1 { animation: subir .8s cubic-bezier(.2, .7, .2, 1) .35s both; }
.h1-l2 { animation: subir .8s cubic-bezier(.2, .7, .2, 1) .55s both; }
@keyframes subir { from { opacity: 0; transform: translateY(.3em); } }

/* ---------- Cajetín (rótulo del plano) ---------- */
.cajetin { background: #fff; border: 1.5px solid var(--acero); font-size: 13.5px; }
.cj-fila { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
.cj-fila + .cj-fila, .cj-rejilla { border-top: 1px solid var(--linea); }
.cj-rejilla { display: grid; grid-template-columns: 1fr 1fr; }
.cj-rejilla > div { padding: 9px 12px; }
@media (min-width: 640px) {
  .cajetin { font-size: 15px; }
  .cj-fila { gap: 16px; padding: 12px 16px; }
  .cj-rejilla > div { padding: 10px 16px; }
}
.cj-rejilla > div:nth-child(odd) { border-right: 1px solid var(--linea); }
.cj-rejilla > div:nth-child(n+3) { border-top: 1px solid var(--linea); }
.cj-l { display: block; font-family: 'Overpass Mono', monospace; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #4F6B82; }
.cj-v { display: block; font-weight: 700; color: var(--tinta); }
.sello {
  display: inline-block; padding: 4px 12px; border: 2.5px solid var(--obra-700); border-radius: 6px;
  color: var(--obra-700); font-family: 'Overpass Mono', monospace; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; font-size: 13px;
  opacity: 0; transform: rotate(-7deg) scale(1.7);
  animation: sellar .4s cubic-bezier(.3, 1.6, .5, 1) 2.6s forwards;
}
@keyframes sellar { to { opacity: 1; transform: rotate(-7deg) scale(1); } }

/* ---------- Selector de situaciones ---------- */
.sit {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 14px;
  text-align: left; background: #fff; border: 1px solid var(--linea); border-radius: 14px;
  font-weight: 700; font-size: .96rem; color: var(--tinta);
  transition: border-color .2s ease, background-color .25s ease, color .25s ease, transform .2s ease;
}
@media (min-width: 640px) { .sit { gap: 14px; min-height: 64px; padding: 14px 18px; font-size: 1.05rem; } }
@media (hover: hover) { .sit:hover { border-color: var(--acero); transform: translateX(4px); } }
.sit:focus-visible { border-color: var(--acero); }
.sit .caja { flex: none; width: 22px; height: 22px; border: 2px solid var(--acero); border-radius: 5px; display: grid; place-items: center; transition: background-color .2s ease, border-color .2s ease; }
.sit .cuenta { margin-left: auto; flex: none; font-family: 'Overpass Mono', monospace; font-weight: 400; font-size: 12px; color: #4F6B82; }
.sit[aria-selected="true"] { background: var(--acero-900); border-color: var(--acero-900); color: #fff; transform: none; }
.sit[aria-selected="true"] .cuenta { color: rgba(255, 255, 255, .7); }
.sit[aria-selected="true"] .caja { background: var(--obra); border-color: var(--obra); }
.sit[aria-selected="true"] .caja::after {
  content: ''; width: 10px; height: 6px; margin-top: -3px;
  border-left: 2.5px solid var(--acero-900); border-bottom: 2.5px solid var(--acero-900); transform: rotate(-45deg);
}

/* ---------- Hoja de detalle ---------- */
.hoja { position: relative; background: #fff; border: 1px solid var(--linea); border-radius: 6px; padding: 22px 18px; }
.hoja::before {
  content: ''; position: absolute; inset: 9px; pointer-events: none;
  background:
    linear-gradient(var(--acero), var(--acero)) left top / 16px 2px,
    linear-gradient(var(--acero), var(--acero)) left top / 2px 16px,
    linear-gradient(var(--acero), var(--acero)) right top / 16px 2px,
    linear-gradient(var(--acero), var(--acero)) right top / 2px 16px,
    linear-gradient(var(--acero), var(--acero)) left bottom / 16px 2px,
    linear-gradient(var(--acero), var(--acero)) left bottom / 2px 16px,
    linear-gradient(var(--acero), var(--acero)) right bottom / 16px 2px,
    linear-gradient(var(--acero), var(--acero)) right bottom / 2px 16px;
  background-repeat: no-repeat;
}
@media (min-width: 640px) { .hoja { padding: 40px; } }

.fila-servicio { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 16px 0; border-bottom: 1px dashed var(--linea); }
.fila-servicio:last-child { border-bottom: 0; }
.fila-servicio .txt { flex: 1 1 0%; min-width: 0; }
@media (min-width: 640px) { .fila-servicio { gap: 14px 18px; padding: 18px 0; } }
.entra { animation: entra .45s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes entra { from { opacity: 0; transform: translateY(10px); } }

/* Burbuja de llamada (referencia de detalle en planos) */
.burbuja {
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid currentColor; display: grid; grid-template-rows: 1fr 1fr; justify-items: center;
  font-family: 'Overpass Mono', monospace; font-size: 10px; line-height: 1;
}
.burbuja::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid currentColor; }
.burbuja b { align-self: end; padding-bottom: 3px; font-weight: 600; }
.burbuja i { align-self: start; padding-top: 3px; font-style: normal; }
@media (min-width: 640px) {
  .burbuja { width: 54px; height: 54px; font-size: 11px; }
  .burbuja b { padding-bottom: 5px; }
  .burbuja i { padding-top: 5px; }
}
.burbuja--consultoria { color: var(--acero); }
.burbuja--obra { color: var(--obra-700); }
.burbuja--chica { width: 42px; height: 42px; font-size: 9.5px; }
.burbuja--chica b { padding-bottom: 3px; }
.burbuja--chica i { padding-top: 3px; }

/* Botón agregar a la solicitud */
.agregar {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--acero); border-radius: 999px; color: var(--acero);
  font-weight: 700; font-size: 14px; background: #fff;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
@media (max-width: 519px) {
  .fila-servicio .agregar { width: 100%; }
}
.agregar:hover { background: var(--acero); color: #fff; }
.agregar .si { display: none; }
.agregar[aria-pressed="true"] { background: var(--obra); border-color: var(--obra); color: var(--tinta); }
.agregar[aria-pressed="true"] .si { display: inline; }
.agregar[aria-pressed="true"] .no { display: none; }
.agregar--chico { min-height: 44px; padding: 0 14px; font-size: 13px; margin-left: auto; }

/* ---------- Índice completo ---------- */
.indice summary { list-style: none; cursor: pointer; }
.indice summary::-webkit-details-marker { display: none; }
.indice .mas { transition: transform .3s ease; }
.indice[open] .mas { transform: rotate(45deg); }
.fila-indice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 0; border-top: 1px dashed var(--linea); }
@media (min-width: 520px) { .fila-indice { flex-wrap: nowrap; gap: 14px; } }

/* ---------- Proceso: tablero y pilas ---------- */
.proceso-lista { position: relative; }
.proceso-deck {
  position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--obra);
  transform-origin: left top; transform: scaleY(var(--p, 0));
}
.paso { position: relative; padding-left: 56px; }
.pila { position: absolute; left: 6px; top: 12px; width: 32px; height: 3px; background: rgba(255, 255, 255, .8); transform-origin: left; transform: scaleX(0); transition: transform .6s cubic-bezier(.2, .7, .2, 1) .15s; }
.paso.in .pila { transform: none; }
@media (min-width: 1024px) {
  .proceso-deck {
    right: 0; bottom: auto; width: auto; height: 12px; transform: scaleX(var(--p, 0));
    clip-path: polygon(0 0, 100% 0, calc(100% - 30px) 100%, 0 100%);
  }
  .paso { padding-left: 0; padding-top: 96px; }
  .pila { left: 0; top: 12px; width: 4px; height: 64px; transform-origin: top; transform: scaleY(0); }
}

/* ---------- Formulario ---------- */
.campo {
  width: 100%; min-height: 48px; margin-top: 8px; padding: 12px 14px; border: 1.5px solid var(--linea);
  border-radius: 10px; background: #fff; font-size: 16px; color: var(--tinta); transition: border-color .2s ease, box-shadow .2s ease;
}
.campo:focus { outline: none; border-color: var(--acero); box-shadow: 0 0 0 4px rgba(11, 92, 153, .15); }
.campo[aria-invalid="true"] { border-color: #B42318; }
.etiqueta { font-family: 'Overpass Mono', monospace; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--acero-900); }
.error { color: #B42318; font-size: 14px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--calco); border: 1px solid var(--linea); font-size: 14px; font-weight: 600; }
.chip button { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #4F6B82; }
.chip button:hover { background: #fff; color: #B42318; }

/* ---------- Barra de solicitud ---------- */
.barra {
  position: fixed; z-index: 45; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px;
  background: var(--tinta); color: #fff; border-radius: 999px; box-shadow: 0 20px 40px -12px rgba(7, 59, 99, .55);
  transform: translateY(140%); transition: transform .4s cubic-bezier(.2, .7, .2, 1);
}
.barra.visible { transform: none; }
@media (min-width: 640px) {
  .barra { left: 50%; right: auto; bottom: 12px; gap: 14px; padding: 10px 10px 10px 20px; transform: translate(-50%, 140%); }
  .barra.visible { transform: translate(-50%, 0); }
}
#waFlotante { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transition: bottom .4s cubic-bezier(.2, .7, .2, 1), transform .2s ease; }
@media (max-width: 639px) { .con-barra #waFlotante { bottom: calc(82px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- Filtros, galería referencial, menú móvil y confirmación ---------- */
.pill-filtro {
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--linea); background: #fff; color: var(--tinta);
  font-family: 'Overpass Mono', monospace; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.pill-filtro:hover { border-color: var(--acero); color: var(--acero); }
.pill-filtro[aria-pressed="true"] { background: var(--acero-900); border-color: var(--acero-900); color: #fff; }

.marco-foto {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 10px;
  border: 1px solid var(--linea);
  background-color: var(--calco);
  background-image:
    linear-gradient(rgba(11, 92, 153, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 92, 153, .08) 1px, transparent 1px);
  background-size: 24px 24px;
}
.marco-foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.marco-foto:hover img { transform: scale(1.04); }
.marco-foto.sin-foto img { opacity: 0; }

.nav-movil { transition: opacity .25s ease, transform .25s ease; }
.resumen-envio {
  border: 1.5px solid var(--obra-700); background: #F4FBF2; color: var(--tinta);
  border-radius: 12px; padding: 20px; transition: opacity .25s ease;
}

/* ---------- Apariciones al hacer scroll ---------- */
.js .rv { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 90ms); }
.js .rv.in { opacity: 1; transform: none; }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
  .js .rv { opacity: 1; transform: none; }
}
