/* ==========================================================================
   Autoescuela Alonso Orihuela · demo de propuesta
   Sistema: papel cálido + tinta asfalto + azul de señal (la placa "L" de prácticas).
   Tipografía: Barlow / Barlow Condensed (inspirada en la rotulación de carretera), servida en local.
   Móvil primero.
   ========================================================================== */

@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("assets/fonts/Barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("assets/fonts/Barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/Barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/BarlowCondensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("assets/fonts/BarlowCondensed-700.woff2") format("woff2"); }

:root {
  --paper: #f4f1ea;
  --tint: #ebe6da;
  --surface: #ffffff;
  --ink: #15191e;
  --muted: #55606c;
  --line: #d8d2c4;
  --blue: #0a4fa6;
  --blue-deep: #083c80;
  --amber: #f5b301;
  --asphalt: #1b1f24;
  --asphalt-2: #262b32;

  --font: "Barlow", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;

  --r-sm: 6px;
  --r: 12px;
  --r-lg: 18px;

  --gutter: 20px;
  --top-h: 60px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, address { margin: 0; padding: 0; }
ul, ol { list-style: none; }
address { font-style: normal; }
a { color: inherit; }
strong, b { font-weight: 600; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.sec--road :focus-visible, .foot :focus-visible { outline-color: #fff; }

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
  text-decoration: none; transition: top .15s;
}
.skip:focus { top: 12px; }

/* ---------- Tipografía ---------- */
h1, h2, .score__num, .sign__num {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.005em;
  line-height: .98;
}
h1 { font-size: clamp(2.75rem, 11.5vw, 5.5rem); text-wrap: balance; }
h2 { font-size: clamp(2.25rem, 8vw, 3.75rem); text-wrap: balance; }
h3 { font: 600 1.1875rem/1.25 var(--font); }
.lede { color: var(--muted); font-size: 1.125rem; max-width: 46ch; text-wrap: pretty; }

/* ---------- Iconos ---------- */
.ico { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }
.ico--arrow { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease); }
.stars { display: inline-block; width: 100px; color: var(--amber); }
.stars svg { width: 100%; height: auto; fill: currentColor; }
.stars--lg { width: 150px; }

/* ---------- Botones (un solo sistema) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: 0 22px;
  font: 600 1.0625rem/1 var(--font);
  text-decoration: none; white-space: nowrap;
  border-radius: var(--r-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .18s var(--ease), background-color .18s, color .18s, border-color .18s, box-shadow .18s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.985); transition-duration: .06s; }
.btn--primary { background: var(--blue); color: #fff; box-shadow: 0 2px 0 var(--blue-deep); }
.btn--primary:hover { background: var(--blue-deep); box-shadow: 0 4px 0 #062d61; }
.btn--primary:active { box-shadow: 0 0 0 #062d61; }
.btn--ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--ghost:hover .ico--arrow { transform: translate(2px, -2px); }
.btn--light { background: #fff; color: var(--ink); }
.btn--sm { min-height: 44px; padding: 0 16px; font-size: 1rem; }
.btn--block { width: 100%; }

.link {
  color: var(--blue); font-weight: 600; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat;
  padding-bottom: 2px;
  transition: background-size .25s var(--ease);
}
.link:hover { background-size: 0% 1.5px; background-position: 100% 100%; }
.link--light { color: #fff; font-weight: 500; }

/* ---------- Cabecera ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top__in { height: var(--top-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-height: 44px; }
.brand__l {
  display: grid; place-items: center;
  width: 36px; height: 36px; flex: none;
  background: var(--blue); color: #fff;
  border-radius: 7px;
  box-shadow: inset 0 0 0 2px var(--blue), inset 0 0 0 3.5px #fff;
  font: 700 1.5rem/1 var(--display);
  transition: transform .25s var(--ease);
}
.brand:hover .brand__l { transform: rotate(-6deg); }
.brand__txt { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font: 700 1.3125rem/1 var(--display); letter-spacing: .005em; white-space: nowrap; }
.brand__place { font-size: .8125rem; font-weight: 500; color: var(--muted); margin-top: 3px; }

.nav { display: none; }
.top__call-long { display: none; }

/* ---------- Hero ---------- */
.hero { padding-block: 28px 44px; }
.hero__in { display: grid; gap: 32px; }
.hero__copy { display: grid; gap: 20px; align-content: center; justify-items: start; }
.hero__lede { font-size: 1.1875rem; color: #2f3740; max-width: 40ch; text-wrap: pretty; }
.hero__lede strong { color: var(--ink); }
.hero__actions { display: grid; gap: 12px; width: 100%; }
.hero__hours { display: flex; align-items: center; gap: 10px; font-size: .9375rem; font-weight: 500; color: var(--muted); text-wrap: balance; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); flex: none; }

.hero__visual { position: relative; padding-bottom: 34px; }
.frame { border-radius: var(--r-lg); overflow: hidden; background: var(--tint); aspect-ratio: 4 / 3; }
.frame img { width: 100%; height: 100%; object-fit: cover; object-position: 40% 40%; }

/* La valoración como señal informativa azul */
.sign {
  position: absolute; left: 14px; bottom: 0;
  display: inline-flex; align-items: center; gap: 14px;
  padding: 12px 20px 12px 16px;
  background: var(--blue); color: #fff; text-decoration: none;
  border-radius: var(--r);
  box-shadow: inset 0 0 0 3px var(--blue), inset 0 0 0 5px #fff, 0 14px 30px -12px rgba(8, 40, 90, .55);
  transition: transform .2s var(--ease);
}
.sign:hover { transform: translateY(-2px); }
.sign__num { font-size: 3.5rem; line-height: .9; }
.sign__side { display: grid; gap: 4px; }
.sign__txt { font-size: .9375rem; font-weight: 500; white-space: nowrap; }

/* Entrada del hero: una vez, al cargar */
@media (prefers-reduced-motion: no-preference) {
  .js-enter .enter { animation: enter .7s var(--ease) both; animation-delay: calc(var(--d, 0) * 90ms + 60ms); }
  /* red de seguridad: pasado 1,5 s el contenido queda visible aunque la animación no haya corrido */
  .js-enter.enter-done .enter { animation: none; }
  @keyframes enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}

/* ---------- Secciones ---------- */
.sec { padding-block: 64px; }
.sec--tint { background: var(--tint); }
.sec__head { display: grid; gap: 14px; margin-bottom: 32px; }

/* ---------- Permisos ---------- */
.permits { display: grid; gap: 12px; }
.permit {
  display: grid; grid-template-columns: auto 1fr; column-gap: 16px; row-gap: 6px; align-items: start; align-content: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px;
  transition: border-color .2s, box-shadow .2s;
}
.permit:hover { border-color: #b9c7da; box-shadow: 0 10px 24px -18px rgba(10, 79, 166, .6); }
.permit .plate { grid-row: span 2; }
.permit h3 { align-self: end; padding-top: 2px; }
.permit p { color: var(--muted); font-size: 1rem; }
.plate {
  display: grid; place-items: center;
  width: 64px; height: 64px;
  background: var(--blue); color: #fff;
  border-radius: 10px;
  box-shadow: inset 0 0 0 3px var(--blue), inset 0 0 0 5px #fff;
  font: 700 2rem/1 var(--display);
  transition: transform .25s var(--ease);
}
.plate--wide { font-size: 1.0625rem; letter-spacing: .01em; }
.permit:hover .plate { transform: rotate(-4deg); }
.permits__foot { margin-top: 24px; color: var(--muted); }

/* ---------- Cómo apuntarte: tramo de asfalto ---------- */
.sec--road { background: var(--asphalt); color: #fff; }
.sec--road .lede { color: #b9c0c9; }
.route { --p: 1; position: relative; display: grid; gap: 28px; }
/* línea discontinua de carril: vertical en móvil */
.route::before, .route::after {
  content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 4px;
  background: repeating-linear-gradient(to bottom, #fff 0 18px, transparent 18px 32px);
}
.route::before { opacity: .22; }
.route::after { clip-path: inset(0 0 calc((1 - var(--p)) * 100%) 0); transition: clip-path .15s linear; }
.stop { position: relative; z-index: 1; display: grid; grid-template-columns: 46px 1fr; column-gap: 18px; row-gap: 6px; }
.stop__n {
  grid-row: span 2;
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--asphalt); color: #fff;
  border: 2px solid rgba(255, 255, 255, .45);
  font: 700 1.5rem/1 var(--display);
  transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--ease);
}
.stop.is-on .stop__n { background: #fff; color: var(--asphalt); border-color: #fff; transform: scale(1.06); }
.stop h3 { align-self: center; padding-top: 9px; font-size: 1.25rem; }
.stop p { grid-column: 2; color: #b9c0c9; font-size: 1rem; max-width: 34ch; }

/* ---------- Opiniones ---------- */
.reviews { display: grid; gap: 40px; }
.reviews__score { display: grid; gap: 10px; justify-items: start; align-content: start; }
.score { display: flex; align-items: baseline; gap: 12px; margin-top: 12px; }
.score__num { font-size: clamp(6rem, 30vw, 9.5rem); line-height: .8; color: var(--blue); }
.score__of { font-size: 1.125rem; font-weight: 500; color: var(--muted); }
.score__count { font-weight: 600; margin-bottom: 12px; }
.reviews__body { display: grid; gap: 28px; align-content: start; }
.themes { display: grid; gap: 0; border-top: 1px solid var(--line); }
.themes li { display: grid; gap: 6px; padding-block: 20px; border-bottom: 1px solid var(--line); }
.themes p { color: var(--muted); max-width: 52ch; }
.topics { display: grid; gap: 12px; }
.topics__label { font-size: .9375rem; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 8px 7px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  font-size: .9375rem;
}
.chips b {
  display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 7px;
  background: var(--blue); color: #fff; border-radius: 999px; font-size: .8125rem; font-weight: 600;
}

/* ---------- Dónde estamos ---------- */
.visit { display: grid; gap: 28px; }
/* placa de calle (dibujo CSS) */
.plaque {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: stretch;
  color: var(--blue);
}
.plaque__street, .plaque__num {
  background: #fbf8f0;
  border-radius: 10px;
  box-shadow: inset 0 0 0 3px #fbf8f0, inset 0 0 0 6px var(--blue), inset 0 0 0 9px #fbf8f0, inset 0 0 0 10px var(--blue), 0 16px 30px -22px rgba(21, 25, 30, .7);
}
.plaque__street { display: grid; align-content: center; gap: 4px; padding: 26px 24px; }
.plaque__kind { font: 600 1.125rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase; }
.plaque__name { font: 700 clamp(2.125rem, 9.6vw, 5rem)/.95 var(--display); text-wrap: balance; }
.plaque__num { display: grid; place-items: center; min-width: 84px; padding: 0 18px; font: 700 clamp(2.5rem, 11vw, 4.75rem)/1 var(--display); }

.visit__info { display: grid; gap: 24px; justify-items: start; }
.facts { display: grid; gap: 0; width: 100%; border-top: 1px solid #cfc8b8; }
.facts > div { display: grid; gap: 2px; padding-block: 14px; border-bottom: 1px solid #cfc8b8; }
.facts dt { font-size: .875rem; font-weight: 600; color: var(--muted); }
.facts dd { font-weight: 500; }
.visit__info .btn { width: 100%; }

.pano { margin-top: 32px; border-radius: var(--r-lg); overflow: hidden; height: 200px; background: var(--line); }
.pano img { width: 100%; height: 100%; object-fit: cover; object-position: 55% 70%; transition: transform .6s var(--ease); }
.pano:hover img { transform: scale(1.025); }

/* ---------- Contacto ---------- */
.contact { display: grid; gap: 32px; }
.contact__copy { display: grid; gap: 14px; align-content: start; justify-items: start; }
.bigtel {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 10px;
  font: 700 clamp(3rem, 14vw, 5rem)/1 var(--display); color: var(--blue); text-decoration: none; white-space: nowrap;
  transition: color .2s;
}
.bigtel .ico { width: .62em; height: .62em; transition: transform .25s var(--ease); }
.bigtel:hover { color: var(--blue-deep); }
.bigtel:hover .ico { transform: rotate(-12deg) scale(1.08); }
.contact__hours { color: var(--muted); font-size: .9375rem; font-weight: 500; }

.form { display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .9375rem; font-weight: 600; }
.opt { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  font: 400 1.0625rem/1.4 var(--font); color: var(--ink);
  background: #fff; border: 1.5px solid #bdb6a6; border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 79, 166, .22); }
.field.is-bad input { border-color: #b3261e; }
.field__err { color: #b3261e; font-size: .9375rem; font-weight: 500; }
.form__status { padding: 14px 16px; border-radius: var(--r-sm); background: #e8f0fb; border: 1px solid #b9cfee; color: #0b2f61; font-size: 1rem; font-weight: 500; }
[hidden] { display: none !important; }

/* ---------- Pie ---------- */
.foot { background: var(--asphalt); color: #d7dce2; padding-block: 44px 110px; font-size: 1rem; }
.foot__in { display: grid; gap: 24px; }
.brand--foot .brand__name { color: #fff; }
.brand--foot .brand__place { color: #a9b1bb; }
.foot__legal { font-size: .875rem; color: #a9b1bb; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .14); max-width: 86ch; }
.foot__legal .link--light { color: #d7dce2; }

/* ---------- Barra fija de móvil ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--asphalt) 94%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transform: translateY(110%); transition: transform .3s var(--ease);
}
.bar.is-up { transform: none; }
.bar .btn { min-height: 48px; padding: 0 12px; }
.bar .btn--primary { box-shadow: none; }

/* ==========================================================================
   A partir de 600 px
   ========================================================================== */
@media (min-width: 600px) {
  :root { --gutter: 32px; }
  .hero__actions { display: flex; flex-wrap: wrap; width: auto; }
  .permits { grid-template-columns: 1fr 1fr; gap: 16px; }
  .permit { grid-template-columns: 1fr; row-gap: 8px; padding: 24px; }
  .permit .plate { grid-row: auto; margin-bottom: 14px; }
  .permit .plate--wide { width: auto; min-width: 64px; padding: 0 14px; justify-self: start; font-size: 1.375rem; }
  .permit h3 { align-self: start; padding-top: 0; }
  .visit__info .btn { width: auto; }
  .pano { height: 260px; }
  .form { padding: 28px; }
}

/* ==========================================================================
   A partir de 900 px (escritorio)
   ========================================================================== */
@media (min-width: 900px) {
  :root { --gutter: 40px; --top-h: 72px; }

  .nav { display: flex; gap: 28px; }
  .nav a {
    position: relative; text-decoration: none; font-weight: 500; font-size: 1rem; padding-block: 12px;
  }
  .nav a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; background: var(--blue);
    transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease);
  }
  .nav a:hover::after { transform: scaleX(1); }
  .top__call-short { display: none; }
  .top__call-long { display: inline; }
  .brand__l { width: 40px; height: 40px; }
  .brand__name { font-size: 1.5rem; }

  .hero { padding-block: 0; }
  .hero__in {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 56px; align-items: center;
    min-height: min(calc(100svh - var(--top-h)), 860px);
    padding-block: 48px 64px;
  }
  .hero__copy { gap: 26px; }
  .hero__lede { font-size: 1.3125rem; }
  .frame { aspect-ratio: 4 / 4.4; }
  .frame img { object-position: 46% 50%; }
  .hero__visual { padding-bottom: 40px; }
  .sign { left: -28px; padding: 16px 26px 16px 20px; gap: 18px; }
  .sign__num { font-size: 4.75rem; }
  .sign__txt { font-size: 1.0625rem; }
  .stars { width: 124px; }

  .sec { padding-block: 104px; }
  .sec__head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: end; margin-bottom: 48px; }
  .sec__head .lede { justify-self: end; }
  .lede { font-size: 1.1875rem; }

  .permits { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .permit { padding: 28px; }
  .plate { width: 76px; height: 76px; font-size: 2.375rem; }
  .permit .plate--wide { min-width: 76px; padding: 0 18px; font-size: 1.75rem; }

  /* la línea de carril pasa a horizontal */
  .route { grid-template-columns: repeat(4, 1fr); gap: 32px; padding-top: 0; }
  .route::before, .route::after {
    left: 24px; right: 0; top: 24px; bottom: auto; width: auto; height: 4px;
    background: repeating-linear-gradient(to right, #fff 0 26px, transparent 26px 46px);
  }
  .route::after { clip-path: inset(0 calc((1 - var(--p)) * 100%) 0 0); }
  .stop { grid-template-columns: 1fr; row-gap: 10px; }
  .stop__n { grid-row: auto; width: 52px; height: 52px; font-size: 1.75rem; margin-bottom: 18px; box-shadow: 0 0 0 10px var(--asphalt); }
  .stop h3 { padding-top: 0; font-size: 1.375rem; }
  .stop p { grid-column: auto; }

  .reviews { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 72px; }
  .reviews__body { padding-top: 12px; }
  .themes h3 { font-size: 1.3125rem; }
  .themes li { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 24px; padding-block: 24px; }

  .sec--tint .sec__head { margin-bottom: 36px; }
  .visit { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: stretch; }
  .plaque { gap: 14px; }
  .plaque__street { padding: 40px 40px; }
  .plaque__kind { font-size: 1.375rem; }
  .plaque__num { min-width: 150px; }
  .pano { height: 320px; margin-top: 56px; }

  .contact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; align-items: start; }
  .form { padding: 36px; }

  .foot { padding-block: 64px 56px; }
  .foot__in { grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
  .foot__legal { grid-column: 1 / -1; }

  .bar { display: none; }
}

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