/* Itineraly · itineraly.app
 *
 * La misma paleta que la app (app/lib/core/theme/itineraly_theme.dart) y el
 * panel: tinta azul noche, coral para la ida, turquesa para la vuelta y ámbar
 * para lo opcional. Aquí el coral y el turquesa se usan como líneas de un
 * plano de transporte; para texto y botones van en sus variantes oscuras, que
 * pasan AA.
 *
 * Tipografía: Overpass (nace de la señalética de carreteras) para titulares,
 * placas y el código de invitación; Atkinson Hyperlegible Next para el texto.
 */

:root {
  color-scheme: light dark;

  /* Paleta de marca (idéntica a la app). */
  --ink: #14213d;
  --route: #e4572e;
  --return: #17a398;
  --optional: #f2a541;
  --paper: #faf7f2;
  --line: #e7e1d7;

  /* Papeles en la página. */
  --bg: var(--paper);
  --surface: #ffffff;
  --text: var(--ink);
  --muted: #5d6574;
  --rule: var(--line);
  --route-strong: #c2441c;     /* coral con contraste AA sobre blanco */
  --return-strong: #0e7c73;
  --on-accent: #ffffff;
  --plate: #14213d;            /* placa de estación */
  --plate-text: #ffffff;
  --tag-route: #fbe3da;
  --tag-optional: #fdebd0;
  --district: #00782a;         /* color de la línea District de Londres */
  --focus: #1d4ed8;

  /* Escala tipográfica fija (razón 1,25 sobre 1,0625 rem). */
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.5625rem;
  --fs-xl: 1.9375rem;
  --fs-2xl: 2.4375rem;
  --fs-3xl: 3.0625rem;

  --font-display: "Overpass", "Arial Narrow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-text: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Radios con intención: placas casi rectas, tarjetas como la app (16),
   * etiquetas como la app (8), botones de una mano (16). */
  --r-plate: 3px;
  --r-tag: 8px;
  --r-card: 16px;

  --gutter: max(16px, 4vw);
  --measure: 65ch;
  --wrap: 72rem;
  --line-w: 6px;               /* grosor de una línea del plano */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1424;
    --surface: #152038;
    --text: #eef1f6;
    --muted: #a7b0c0;
    --rule: #26324d;
    --route: #ff7a52;
    --return: #3cc7ba;
    --route-strong: #ff7a52;
    --return-strong: #3cc7ba;
    --on-accent: #0d1424;
    --plate: #1f2c4a;
    --plate-text: #ffffff;
    --tag-route: #3a2622;
    --tag-optional: #3a3020;
    --district: #23a453;
    --focus: #93b4ff;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--fs-base);
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  text-wrap: balance;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-2xl); font-weight: 900; }
h2 { font-size: var(--fs-xl); font-weight: 800; }
h3 { font-size: var(--fs-md); font-weight: 800; }
@media (min-width: 48rem) {
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
}

p, li { max-width: var(--measure); text-wrap: pretty; }
p { margin: 0 0 1em; }

a { color: var(--route-strong); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--plate);
  color: var(--plate-text);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}
.skip:focus { top: 0.5rem; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }

/* ── Cabecera y pie ───────────────────────────────────────────────────── */

.site-head {
  border-bottom: 1px solid var(--rule);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-md);
  letter-spacing: -0.01em;
}
.brand svg { width: 30px; height: 30px; flex: none; }
.site-nav { display: flex; gap: 1.25rem; font-size: var(--fs-sm); }
.site-nav a { color: var(--text); text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }
@media (max-width: 30rem) {
  .site-nav .opt { display: none; }
}

.site-foot {
  margin-top: 5rem;
  border-top: var(--line-w) solid var(--plate);
  padding-block: 2rem 3rem;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
}
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.site-foot a { color: var(--text); }

/* ── Botones ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 56px;
  padding: 0 1.5rem;
  border-radius: var(--r-card);
  border: 1.5px solid transparent;
  font: 700 var(--fs-md)/1 var(--font-display);
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--route-strong); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--text); }

/* ── Placa de estación: el detalle propio de la web ───────────────────── */
/* Fondo azul noche, letra de señalética y una franja con el color de la
 * línea debajo, como los letreros de andén. */

.plate {
  display: inline-flex;
  flex-direction: column;
  background: var(--plate);
  color: var(--plate-text);
  border-radius: var(--r-plate);
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  padding: 0.35rem 0.6rem 0.3rem;
  box-shadow: inset 0 -5px 0 var(--plate-line, var(--route));
  padding-bottom: calc(0.3rem + 5px);
}
.plate small {
  font-weight: 700;
  font-size: 0.72em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}
.plate.district { --plate-line: var(--district); }
.plate.back { --plate-line: var(--return); }

/* ── Portada ──────────────────────────────────────────────────────────── */

.hero {
  padding-block: 3rem 2rem;
  display: grid;
  gap: 2.5rem;
  align-items: start;
}
@media (min-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); padding-block: 5rem 3rem; gap: 4rem; }
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--route-strong);
  margin-bottom: 1rem;
}
.lead { font-size: var(--fs-md); line-height: 1.5; }
.soon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 2rem;
}
.soon-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-md);
  padding: 0.6rem 1rem;
  border: 2px dashed var(--rule);
  border-radius: var(--r-tag);
}

/* Plano del día: una línea vertical con sus estaciones. La ida en coral y la
 * vuelta al alojamiento en turquesa, como en el mapa de la app. */
.dayline {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  padding: 1.5rem 1.25rem 1.25rem;
}
.dayline-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-display);
}
.dayline-head strong { font-size: var(--fs-md); font-weight: 900; }
.dayline-head span { font-size: var(--fs-sm); color: var(--muted); font-weight: 700; }
.stations { list-style: none; margin: 0; padding: 0; }
.stations li {
  --c: var(--route);
  position: relative;
  padding: 0 0 1.1rem 2.5rem;
  max-width: none;
}
.stations li::before {           /* el tramo que sale de esta estación */
  content: "";
  position: absolute;
  left: calc(0.75rem - var(--line-w) / 2);
  top: 0.9rem;
  bottom: -0.35rem;
  width: var(--line-w);
  background: var(--c);
}
.stations li.walk::before {
  background: repeating-linear-gradient(to bottom, var(--c) 0 6px, transparent 6px 11px);
}
.stations li.back { --c: var(--return); }
.stations li:last-child::before { display: none; }
.stations li:last-child { padding-bottom: 0; }
.stations .dot {
  position: absolute;
  left: 0.25rem;
  top: 0.3rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--c);
  z-index: 1;
}
.stations li.home .dot {
  left: 0.05rem;
  top: 0.15rem;
  width: 1.4rem;
  height: 1.4rem;
  border-color: var(--text);
  border-width: 5px;
}
.stations .name { font-weight: 700; display: block; line-height: 1.35; }
.stations .how { font-size: var(--fs-sm); color: var(--muted); display: block; }
.dayline-foot {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Etiquetas de la app: «Estimación» y «Por verificar en TfL». */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--r-tag);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
}
.tag svg { width: 14px; height: 14px; flex: none; }
.tag-estimate { background: var(--tag-optional); }
.tag-verify { background: var(--tag-route); }

/* ── Secciones ────────────────────────────────────────────────────────── */

.section { padding-block: 3.5rem; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { max-width: var(--measure); margin-bottom: 2rem; }

/* Lo que pide la app: un billete con cuatro casillas. */
.ticket-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-tag);
  margin: 0;
  overflow: hidden;
}
.ticket-form div {
  padding: 1rem 1.25rem 1.1rem;
  border-right: 1px dashed var(--rule);
  border-bottom: 1px dashed var(--rule);
  margin-right: -1px;
  margin-bottom: -1px;
}
.ticket-form dt {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ticket-form dd { margin: 0.2rem 0 0; font-weight: 700; font-size: var(--fs-md); line-height: 1.3; }
.ticket-form dd span { display: block; font-weight: 400; font-size: var(--fs-sm); color: var(--muted); }

/* Un tramo, tal como lo enseña la app. */
.leg-grid {
  display: grid;
  gap: 2rem;
  align-items: start;
}
@media (min-width: 56rem) {
  .leg-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 3.5rem; }
}
.leg {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  overflow: hidden;
}
.leg-top {
  padding: 1.1rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
}
.leg-top .from-to { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-md); line-height: 1.25; }
.leg-top .from-to span { color: var(--muted); font-weight: 700; }
.leg-top .total { font-family: var(--font-display); font-weight: 900; font-size: var(--fs-xl); line-height: 1; white-space: nowrap; }
.leg-top .total small { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 1rem 1.25rem 0.25rem; }
.steps > li {
  position: relative;
  padding: 0 0 1.25rem 2.75rem;
  max-width: none;
}
.steps > li::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 2.1rem;
  bottom: 0.1rem;
  width: 4px;
  border-radius: 2px;
  background: var(--c, var(--route));
}
.steps > li.walk::before {
  background: repeating-linear-gradient(to bottom, var(--route) 0 5px, transparent 5px 10px);
}
.steps > li.ride { --c: var(--district); }
.steps > li:last-child::before { display: none; }
.steps .ico {
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--rule);
  color: var(--text);
}
.steps .ico svg { width: 18px; height: 18px; }
.steps .what { font-weight: 700; display: block; }
.steps .detail { display: block; font-size: var(--fs-sm); color: var(--muted); }
.line-pill {
  display: inline-block;
  background: var(--district);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-sm);
  padding: 0.05rem 0.5rem;
  border-radius: var(--r-tag);
  margin-right: 0.35rem;
}
.ride-stops {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  font-size: var(--fs-sm);
}
.ride-stops .plate { font-size: var(--fs-sm); }
.ride-stops .between { color: var(--muted); }
.leg-foot {
  padding: 0.9rem 1.25rem 1.1rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Tres diferenciadores como tres estaciones de una misma línea. */
.line-map {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.line-map li {
  position: relative;
  padding: 0 0 2.25rem 3rem;
  max-width: none;
}
.line-map li::before {
  content: "";
  position: absolute;
  left: calc(0.85rem - var(--line-w) / 2);
  top: 0.5rem;
  bottom: -0.5rem;
  width: var(--line-w);
  background: var(--route);
}
.line-map li:last-child::before { background: var(--return); bottom: 1rem; }
.line-map li::after {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.2rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--bg);
  border: 5px solid var(--text);
}
.line-map h3 { font-size: var(--fs-lg); margin-bottom: 0.35rem; }
.line-map p { margin: 0; }
@media (min-width: 56rem) {
  .line-map { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
  .line-map li { padding: 3rem 2rem 0 0; }
  .line-map li::before {
    left: 0;
    right: 0;
    top: calc(0.75rem - var(--line-w) / 2);
    bottom: auto;
    width: auto;
    height: var(--line-w);
  }
  .line-map li:last-child::before { bottom: auto; right: 40%; }
  .line-map li::after { left: 0; top: 0; }
}

/* Honestidad con los datos. */
.honest {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 48rem) { .honest { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.honest > div {
  border-left: var(--line-w) solid var(--optional);
  padding: 0.25rem 0 0.25rem 1.25rem;
}
.honest > div.v { border-left-color: var(--route); }
.honest .tag { margin-bottom: 0.5rem; }

/* ── Invitación ───────────────────────────────────────────────────────── */

.invite {
  padding-block: 3rem 1rem;
  max-width: 40rem;
}
.invite h1 { font-size: var(--fs-xl); }
@media (min-width: 48rem) { .invite h1 { font-size: var(--fs-2xl); } }

/* El código va en un billete con muescas y una línea troquelada. */
.ticket {
  --notch: 14px;
  position: relative;
  margin: 2rem 0;
  background:
    radial-gradient(circle at 0 3.35rem, transparent var(--notch), var(--surface) calc(var(--notch) + 0.5px)) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 3.35rem, transparent var(--notch), var(--surface) calc(var(--notch) + 0.5px)) right / 51% 100% no-repeat;
  filter: drop-shadow(0 0 0.5px var(--muted));
  border-radius: var(--r-tag);
  padding: 1.25rem 1.5rem 1.5rem;
}
.ticket-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.75rem;
  border-bottom: 2px dashed var(--rule);
  margin-bottom: 1rem;
}
.code {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.25rem, 11vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin: 0.25rem 0 1rem;
}
.code .dash { color: var(--route); padding-inline: 0.05em; }
.ticket-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.ticket-actions .btn { flex: 1 1 14rem; }
.copied { min-height: 1.6em; margin: 0.5rem 0 0; font-size: var(--fs-sm); color: var(--return-strong); }
.form-error { min-height: 1.6em; margin: 0.5rem 0 0; font-size: var(--fs-sm); font-weight: 700; color: var(--route-strong); }

.steps-plain { padding-left: 1.25rem; }
.steps-plain li { margin-bottom: 0.4rem; }

.bad-code {
  border-left: var(--line-w) solid var(--route);
  padding-left: 1.25rem;
  margin: 2rem 0;
}
.code-form { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.code-form label { flex: 1 0 100%; font-weight: 700; }
.code-form input {
  flex: 1 1 12rem;
  min-height: 56px;
  padding: 0 1rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--text);
  font: 800 var(--fs-md) var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.code-form input:focus-visible { border-color: var(--text); }
.code-form .btn { flex: 0 1 auto; }

[hidden] { display: none !important; }

/* ── Textos legales ───────────────────────────────────────────────────── */

.legal { padding-block: 3rem 1rem; }
.legal h1 { font-size: var(--fs-xl); }
@media (min-width: 48rem) { .legal h1 { font-size: var(--fs-2xl); } }
.legal h2 { font-size: var(--fs-lg); margin-top: 2.5rem; }
.legal h3 { margin-top: 1.5rem; }
.legal table { border-collapse: collapse; width: 100%; max-width: 52rem; font-size: var(--fs-sm); margin: 1rem 0 1.5rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem 0.6rem 0; border-bottom: 1px solid var(--rule); }
.legal th { font-family: var(--font-display); font-weight: 800; }
.table-scroll { overflow-x: auto; }
.draft {
  background: var(--tag-optional);
  border-left: var(--line-w) solid var(--optional);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2rem;
  max-width: var(--measure);
  border-radius: 0 var(--r-tag) var(--r-tag) 0;
}
.draft strong { font-family: var(--font-display); font-size: var(--fs-md); display: block; }
.hole {
  background: var(--tag-route);
  padding: 0 0.3em;
  border-radius: 4px;
  font-weight: 700;
  white-space: normal;
}

/* ── 404 ──────────────────────────────────────────────────────────────── */

.lost { padding-block: 4rem 1rem; }
.lost .plate { font-size: var(--fs-lg); margin-bottom: 1.5rem; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .btn { transition: filter 120ms ease, border-color 120ms ease; }
}
