@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* RutaSegura · estilos do site. As variáveis de :root são o contrato com /app/app.css. */
:root {
  --rs-azul: #0b4a8f;
  --rs-azul-hondo: #062d59;
  --rs-amarillo: #ffc72c;
  --rs-tinta: #14202e;
  --rs-gris: #5a6878;
  --rs-fondo: #f3f5f8;
  --rs-panel: #ffffff;
  --rs-borde: #d5dce5;
  --rs-ok: #1d7a46;
  --rs-aviso: #b3261e;
  --rs-radio: 10px;
  --rs-sombra: 0 1px 2px rgb(6 45 89 / 12%);
  --rs-fuente: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --rs-titulo: "Barlow Condensed", "Figtree", sans-serif;
  --rs-toque: 44px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--rs-fondo);
  color: var(--rs-tinta);
  font: 17px/1.6 var(--rs-fuente);
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--rs-azul); text-underline-offset: 2px; }
a:hover { color: var(--rs-azul-hondo); }

:focus-visible { outline: 3px solid var(--rs-amarillo); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--rs-titulo); line-height: 1.15; letter-spacing: 0.005em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 3vw, 1.65rem); font-weight: 800; margin-top: 1.8em; }
h3 { font-size: 1.12rem; font-weight: 700; margin-top: 1.4em; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: 0.35em; }

.contenedor { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.saltar {
  position: absolute; left: 8px; top: -60px; z-index: 10;
  padding: 10px 14px; background: var(--rs-amarillo); color: var(--rs-tinta);
  font-weight: 700; border-radius: var(--rs-radio);
}
.saltar:focus { top: 8px; }

/* Cabecera: barra azul de carretera con a linha amarela tracejada */
.cabecera { background: var(--rs-azul-hondo); color: #fff; }
.cabecera-fila { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.marca {
  display: inline-flex; align-items: center; gap: 10px; min-height: var(--rs-toque);
  color: #fff; text-decoration: none; font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em;
}
.marca b { color: var(--rs-amarillo); font-weight: 800; }
.marca:hover { color: #fff; }
.menu { margin-left: auto; }
.menu ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.menu li { margin: 0; }
.menu a {
  display: flex; align-items: center; min-height: var(--rs-toque); padding: 0 12px;
  color: #dfe8f3; text-decoration: none; font-weight: 600; font-size: 0.95rem; border-radius: 8px; white-space: nowrap;
}
.menu a:hover { background: rgb(255 255 255 / 10%); color: #fff; }
.menu a[aria-current="page"] { color: var(--rs-tinta); background: var(--rs-amarillo); }
.linea-carril {
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--rs-amarillo) 0 34px, transparent 34px 54px) var(--rs-azul);
}

@media (max-width: 860px) {
  .cabecera-fila { padding-top: 8px; gap: 4px; }
  .menu { margin: 0 -16px; width: calc(100% + 32px); overflow-x: auto; scrollbar-width: none; }
  .menu::-webkit-scrollbar { display: none; }
  .menu ul { padding: 0 12px 8px; }
}

/* Migas */
.migas { font-size: 0.9rem; color: var(--rs-gris); margin: 20px 0 12px; }
.migas ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.migas li { margin: 0; }
.migas li + li::before { content: "›"; margin-right: 6px; color: var(--rs-gris); }
.migas a { color: var(--rs-gris); }

/* Cartel: painel azul com borda branca interna, como uma placa de autovía */
.cartel {
  background: var(--rs-azul); color: #fff; border-radius: 14px;
  padding: 28px 24px; margin: 20px 0 24px;
  box-shadow: inset 0 0 0 4px var(--rs-azul), inset 0 0 0 7px #fff, var(--rs-sombra);
}
.cartel h1 { color: #fff; margin-bottom: 0.35em; }
.cartel p { color: #e6eef8; max-width: 62ch; margin-bottom: 0; font-size: 1.05rem; }
.cartel a { color: #fff; }
.cartel .hito { margin-bottom: 14px; }

.hito {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  background: var(--rs-amarillo); color: var(--rs-tinta);
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
}

.fecha { font-size: 0.92rem; color: var(--rs-gris); margin-bottom: 1.2em; }
.cartel .fecha { color: #cfdcec; margin-top: 12px; }

/* Texto corrido */
.texto { max-width: 70ch; }
.texto > :first-child { margin-top: 0; }

.columnas { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); margin-bottom: 48px; }
@media (min-width: 960px) {
  .columnas { grid-template-columns: minmax(0, 1fr) 300px; }
  .columnas > aside { position: sticky; top: 16px; align-self: start; }
}

.panel {
  background: var(--rs-panel); border: 1px solid var(--rs-borde); border-radius: var(--rs-radio);
  padding: 20px; box-shadow: var(--rs-sombra);
}
.panel > :last-child { margin-bottom: 0; }
.panel h2:first-child, .panel h3:first-child { margin-top: 0; }

.ficha dl { margin: 0; display: grid; gap: 10px; }
.ficha dt { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--rs-gris); }
.ficha dd { margin: 0 0 4px; font-weight: 600; }

.aviso {
  border-left: 5px solid var(--rs-amarillo); background: #fff8e1;
  padding: 14px 16px; border-radius: 0 var(--rs-radio) var(--rs-radio) 0; margin: 1.2em 0;
}
.aviso > :last-child { margin-bottom: 0; }

/* Tabelas */
.tabla-scroll { overflow-x: auto; margin: 1em 0 1.4em; border-radius: var(--rs-radio); border: 1px solid var(--rs-borde); background: var(--rs-panel); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rs-borde); }
thead th { background: var(--rs-azul-hondo); color: #fff; font-weight: 700; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:nth-child(even) { background: #f7f9fc; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Passos numerados */
.pasos { list-style: none; counter-reset: paso; padding: 0; }
.pasos > li { counter-increment: paso; position: relative; padding-left: 52px; margin-bottom: 1em; min-height: 36px; }
.pasos > li::before {
  content: counter(paso); position: absolute; left: 0; top: -2px;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--rs-azul); color: #fff; font-weight: 800;
}

/* Cartões de ligação */
.rejilla { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin: 1em 0 2em; }
.tarjeta {
  display: block; background: var(--rs-panel); border: 1px solid var(--rs-borde); border-radius: var(--rs-radio);
  padding: 18px; text-decoration: none; color: var(--rs-tinta); box-shadow: var(--rs-sombra);
  border-top: 5px solid var(--rs-azul);
}
.tarjeta:hover { border-top-color: var(--rs-amarillo); color: var(--rs-tinta); }
.tarjeta strong { display: block; font-size: 1.05rem; margin-bottom: 4px; color: var(--rs-azul-hondo); }
.tarjeta span { color: var(--rs-gris); font-size: 0.95rem; }

/* Preguntas */
details { background: var(--rs-panel); border: 1px solid var(--rs-borde); border-radius: var(--rs-radio); margin-bottom: 10px; }
summary { cursor: pointer; padding: 12px 16px; min-height: var(--rs-toque); font-weight: 700; }
details > div { padding: 0 16px 4px; }

/* Fontes */
.fuentes { margin: 2.4em 0 1em; padding: 18px 20px; background: var(--rs-panel); border: 1px solid var(--rs-borde); border-left: 5px solid var(--rs-azul); border-radius: var(--rs-radio); }
.fuentes h2 { font-size: 1.1rem; margin: 0 0 0.6em; }
.fuentes ol { padding-left: 1.2em; margin: 0; font-size: 0.95rem; }
.fuentes li { margin-bottom: 0.6em; }
.fuentes small { display: block; color: var(--rs-gris); }

.figura { margin: 1.4em 0; }
.figura figcaption { font-size: 0.9rem; color: var(--rs-gris); margin-top: 6px; }

.boton {
  display: inline-flex; align-items: center; min-height: var(--rs-toque); padding: 0 18px;
  background: var(--rs-amarillo); color: var(--rs-tinta); font-weight: 800; text-decoration: none; border-radius: 8px;
}
.boton:hover { color: var(--rs-tinta); filter: brightness(0.95); }

/* Rodapé */
.pie { background: var(--rs-azul-hondo); color: #cfdcec; margin-top: 56px; padding: 36px 0 28px; font-size: 0.93rem; }
.pie a { color: #fff; }
.pie-rejilla { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pie h2 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 10px; }
.pie ul { list-style: none; padding: 0; margin: 0; }
.pie li { margin: 0; }
.pie li a { display: inline-flex; align-items: center; min-height: 36px; }
.pie-legal { border-top: 1px solid rgb(255 255 255 / 15%); margin-top: 28px; padding-top: 16px; }

/* Estados de vialidade por neve (guia de inverno) */
.estados { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 1em 0 1.6em; }
.estado { background: var(--rs-panel); border: 1px solid var(--rs-borde); border-radius: var(--rs-radio); padding: 16px; border-top: 10px solid var(--estado); box-shadow: var(--rs-sombra); }
.estado h3 { margin: 0 0 8px; font-size: 1.05rem; }
.estado h3 span { display: inline-block; padding: 1px 8px; border-radius: 5px; background: var(--estado); color: var(--estado-texto); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; margin-right: 4px; }
.estado p { font-size: 0.95rem; margin-bottom: 0.6em; }
.estado-amarillo { --estado: #ffc72c; --estado-texto: #14202e; }
.estado-naranja { --estado: #ef7d22; --estado-texto: #14202e; }
.estado-rojo { --estado: #c62828; --estado-texto: #fff; }
.estado-negro { --estado: #14202e; --estado-texto: #fff; }

/* Cabeçalho compacto das páginas com ferramenta (home e /app/) */
.cabeza-app { margin: 20px 0 18px; }
.cabeza-app h1 { margin: 10px 0 6px; }
.cabeza-app p { color: var(--rs-gris); max-width: 64ch; margin: 0; font-size: 1.05rem; }
.instalar { margin-top: 40px; }

/* Matriz de acesso por etiqueta (páginas de ZBE) */
.matriz-acceso th, .matriz-acceso td { text-align: center; }
.matriz-acceso tbody th { text-align: left; min-width: 150px; }
.acceso { font-weight: 700; font-size: 0.88rem; white-space: nowrap; }
.acceso-libre { color: var(--rs-ok); }
.acceso-condicionado { color: #8a5a00; background: #fff4d6; }
.acceso-prohibido { color: #fff; background: var(--rs-aviso); }
tbody tr:nth-child(even) .acceso-prohibido { background: var(--rs-aviso); }
.leyenda { font-size: 0.9rem; color: var(--rs-gris); }
.zona { margin-bottom: 14px; }
.zona h3 { margin-top: 0; }
.zona dl { margin: 0; }
.zona dt { font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--rs-gris); }
.zona dd { margin: 0 0 10px; }
.aviso h2 { font-size: 1.1rem; margin-top: 0; }
.acceso-a_confirmar { color: var(--rs-gris); font-style: italic; }

/* Cartões de cidade no guia de etiquetas */
.ciudad h3 { margin-top: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.estado-zbe { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 5px; }
.estado-zbe-en_vigor { background: #e3f1e8; color: var(--rs-ok); }
.estado-zbe-sin_sanciones { background: #fff4d6; color: #8a5a00; }
.nota-ciudad { font-size: 0.9rem; color: #8a5a00; }
.nota-tabla { display: block; color: var(--rs-gris); font-size: 0.85rem; margin-top: 4px; }

@media (max-width: 600px) {
  .matriz-acceso thead { display: none; }
  .matriz-acceso tr { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .matriz-acceso tbody th { grid-column: 1 / -1; border-bottom: 0; padding-bottom: 4px; }
  .matriz-acceso td { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 10px; font-size: 0.78rem; white-space: normal; text-align: center; }
  .matriz-acceso td::before { content: attr(data-etiqueta); font-weight: 800; font-size: 0.72rem; color: inherit; opacity: 0.85; }
}

.tabla-apilada tbody th { white-space: nowrap; }
@media (max-width: 600px) {
  .tabla-apilada thead { display: none; }
  .tabla-apilada tr { display: block; padding: 10px 12px; border-bottom: 1px solid var(--rs-borde); }
  .tabla-apilada tbody tr:last-child { border-bottom: 0; }
  .tabla-apilada th, .tabla-apilada td { display: block; border: 0; padding: 2px 0; }
  .tabla-apilada tbody th { font-size: 1.05rem; }
}

.fila-usada td { background: #fff4d6; }

/* Respiro entre a ferramenta e as seções do site (home e /app/) */
#pwa-root ~ section { margin-top: 48px; }
.instalar .rejilla { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); max-width: 900px; }
.vitrine-pwa { background: linear-gradient(135deg, #ffffff 0%, #eef4fb 100%); border-color: #bfd0e6; padding: 28px; }
.vitrine-pwa h2 { margin-top: 8px; }
.vitrine-pwa ul { margin: 0 0 18px; }
.acciones-pwa { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
@media (min-width: 900px) {
  .columnas { align-items: start; }
  .columnas > aside { position: sticky; top: 20px; }
}
