/* Gestoría Berbel — cotizador de trámites */
:root {
  --navy: #003366;
  --navy-2: #0a4a85;
  --orange: #ff6b35;
  --orange-ink: #c2410c;   /* naranja con contraste suficiente sobre blanco */
  --paper: #f8f9fa;
  --white: #ffffff;
  --line: #d5dde7;
  --ink: #12263f;
  --muted: #4d5f75;
  --soft: #e7eef6;
  --wa: #128c4a;
  --ok: #0f7a45;
  --radius: 10px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.5;
  font-variation-settings: "wdth" 100;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; color: var(--navy); }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); font-weight: 800; font-variation-settings: "wdth" 112; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; font-weight: 750; }
p { margin: 0 0 1em; }
a { color: var(--navy-2); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* Cabecera */
.top { background: var(--navy); color: var(--white); }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { color: var(--white); text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-weight: 800; font-size: 1.35rem; letter-spacing: .08em; font-variation-settings: "wdth" 125; }
.brand__name::after { content: ""; display: inline-block; width: .45em; height: .45em; background: var(--orange); margin-left: .25em; border-radius: 2px; }
.brand__sub { font-size: .78rem; opacity: .8; }
.top__call { color: var(--white); font-weight: 700; text-decoration: none; padding: 8px 14px; border: 1.5px solid rgba(255,255,255,.5); border-radius: 999px; white-space: nowrap; }
.top__call:hover { background: rgba(255,255,255,.1); }

/* Intro */
.intro { padding-top: 36px; padding-bottom: 8px; }
.intro__lead { font-size: 1.12rem; color: var(--muted); max-width: 40em; }

/* Selector de trámites */
.tramites { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 16px 0 28px; }
.tr {
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; min-height: 84px;
}
.tr:hover { border-color: var(--navy-2); }
.tr[aria-pressed="true"] { border-color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--navy); background: var(--soft); }
.tr__name { font-weight: 650; line-height: 1.25; }
.tr__price { color: var(--muted); font-size: .95rem; }
.tr__price b { color: var(--navy); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.tr--main { grid-column: 1 / -1; background: var(--navy); border-color: var(--navy); color: var(--white); flex-direction: row; align-items: center; padding: 18px 20px; }
.tr--main .tr__name { font-size: 1.25rem; font-weight: 750; }
.tr--main .tr__price { color: rgba(255,255,255,.85); }
.tr--main[aria-pressed="true"] { background: var(--navy); box-shadow: inset 0 0 0 3px var(--orange); }
.tr--main:hover { border-color: var(--orange); }
@media (min-width: 760px) { .tr--main { grid-column: span 2; } }

/* Calculadora */
.calc { display: grid; gap: 24px; align-items: start; padding-bottom: 32px; }
@media (min-width: 960px) { .calc { grid-template-columns: minmax(0, 1fr) 360px; } }
.calc__form > h2 { font-size: 1.7rem; }
.step { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.step legend { font-weight: 750; font-size: 1.1rem; color: var(--navy); padding: 0; margin-bottom: 10px; }
.step[hidden] { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  font: inherit; font-size: .95rem; cursor: pointer; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 14px;
}
.chips button:hover { border-color: var(--navy-2); }
.chips button[aria-checked="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); font-weight: 650; }

.grid2 { display: grid; gap: 14px; }
@media (min-width: 620px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field[hidden] { display: none; }
.field label { font-weight: 600; font-size: .95rem; }
.field input, .field select {
  font: inherit; color: var(--ink); background: var(--white);
  border: 1.5px solid var(--line); border-radius: 8px; padding: 11px 12px; min-height: 48px; width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--navy-2); outline: none; box-shadow: 0 0 0 3px rgba(10,74,133,.18); }
.field input:disabled { background: #eef1f4; color: var(--muted); }
.hint { font-size: .85rem; color: var(--muted); }
.field--modelo { margin-top: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: .95rem; cursor: pointer; }
.check input, .field .check input { width: 20px; height: 20px; min-height: 0; padding: 0; margin: 2px 0 0; accent-color: var(--navy); flex: none; }
.field .check { font-weight: 400; }

/* Lista de versiones */
.options { list-style: none; margin: 4px 0 0; padding: 0; max-height: 320px; overflow-y: auto; border: 1.5px solid var(--line); border-radius: 8px; background: var(--white); }
.options:empty { display: none; }
.options li { padding: 10px 12px; border-bottom: 1px solid var(--soft); cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.options li:last-child { border-bottom: 0; }
.options li:hover, .options li[aria-selected="true"] { background: var(--soft); }
.options li[aria-selected="true"] { box-shadow: inset 4px 0 0 var(--navy); font-weight: 650; }
.options .o-meta { color: var(--muted); font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.options .o-more { color: var(--navy-2); font-weight: 600; justify-content: center; }
.options .o-empty { cursor: default; color: var(--muted); }

/* Matrícula con forma de placa */
.plate-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.plate {
  display: flex; align-items: stretch; flex: 1 1 260px; max-width: 360px;
  background: var(--white); border: 2.5px solid var(--ink); border-radius: 8px; overflow: hidden;
}
.plate__eu { background: #003399; color: #fff; width: 40px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 6px; font-weight: 700; font-size: .95rem; flex: none; }
.plate__stars { color: #ffcc00; font-size: .7rem; margin-bottom: auto; margin-top: 6px; }
.plate input {
  border: 0; flex: 1; min-width: 0; padding: 8px 12px; font: inherit; font-size: 1.9rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; font-variation-settings: "wdth" 82; color: var(--ink); background: transparent;
}
.plate input:focus { outline: none; }
.plate:focus-within { box-shadow: 0 0 0 3px var(--orange); }
.plate input::placeholder { color: #b7c0cc; }
.notice { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: #fff4ec; border: 1px solid #ffd2bd; font-size: .95rem; }
.notice.ok { background: #ebf7f0; border-color: #b9e2ca; }
.found { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: #ebf7f0; border: 1px solid #b9e2ca; font-size: .95rem; }
.found[hidden], .notice[hidden] { display: none; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--navy-2); text-decoration: underline; cursor: pointer; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border-radius: 8px; padding: 12px 18px; min-height: 48px; border: 2px solid transparent;
}
.btn--sm { min-height: 40px; padding: 8px 14px; font-size: .95rem; }
.btn--block { display: flex; width: 100%; }
.btn--dark { background: var(--navy); color: var(--white); }
.btn--dark:hover { background: var(--navy-2); }
.btn--dark:disabled { opacity: .6; cursor: wait; }
.btn--wa { background: var(--wa); color: var(--white); }
.btn--wa:hover { background: #0e7a40; }
.btn--wa::before { content: ""; width: 20px; height: 20px; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm0 18.2a8.2 8.2 0 0 1-4.2-1.2l-.3-.2-3 .8.8-2.9-.2-.3A8.2 8.2 0 1 1 12 20.2zm4.5-6.1c-.2-.1-1.5-.7-1.7-.8s-.4-.1-.6.1-.7.8-.8 1-.3.2-.5.1a6.7 6.7 0 0 1-3.3-2.9c-.3-.4.3-.4.7-1.3.1-.2 0-.3 0-.4l-.8-1.8c-.2-.5-.4-.4-.6-.4h-.5a1 1 0 0 0-.7.3 3 3 0 0 0-.9 2.2 5.2 5.2 0 0 0 1.1 2.7 11.8 11.8 0 0 0 4.5 4c1.7.7 2.3.8 3.2.6a2.7 2.7 0 0 0 1.8-1.2 2.2 2.2 0 0 0 .1-1.2c0-.1-.2-.2-.5-.3z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm0 18.2a8.2 8.2 0 0 1-4.2-1.2l-.3-.2-3 .8.8-2.9-.2-.3A8.2 8.2 0 1 1 12 20.2zm4.5-6.1c-.2-.1-1.5-.7-1.7-.8s-.4-.1-.6.1-.7.8-.8 1-.3.2-.5.1a6.7 6.7 0 0 1-3.3-2.9c-.3-.4.3-.4.7-1.3.1-.2 0-.3 0-.4l-.8-1.8c-.2-.5-.4-.4-.6-.4h-.5a1 1 0 0 0-.7.3 3 3 0 0 0-.9 2.2 5.2 5.2 0 0 0 1.1 2.7 11.8 11.8 0 0 0 4.5 4c1.7.7 2.3.8 3.2.6a2.7 2.7 0 0 0 1.8-1.2 2.2 2.2 0 0 0 .1-1.2c0-.1-.2-.2-.5-.3z'/%3E%3C/svg%3E") center/contain no-repeat; }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--navy); }
.btn--light { background: var(--white); color: var(--navy); }

/* Ticket */
.ticket {
  background: var(--white); border: 1.5px solid var(--line); border-top: 6px solid var(--orange);
  border-radius: var(--radius); padding: 20px; position: relative;
}
@media (min-width: 960px) { .ticket { position: sticky; top: 16px; } }
.ticket__title { font-size: 1.15rem; margin-bottom: 12px; }
.ticket__empty p { color: var(--muted); }
.ticket__empty ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .95rem; }
.ticket__veh { font-weight: 650; font-size: .95rem; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.lines { margin: 0; }
.lines div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--soft); }
.lines dt { color: var(--muted); }
.lines dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 4px; }
.total span { font-weight: 700; font-size: 1.1rem; color: var(--navy); }
.total strong { font-size: 2.3rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; font-variation-settings: "wdth" 90; letter-spacing: -.01em; }
.ticket__note { font-size: .82rem; color: var(--muted); }
.why { margin: 0 0 14px; font-size: .92rem; }
.why summary, .special summary { cursor: pointer; color: var(--navy-2); font-weight: 600; }
.why div { padding-top: 8px; color: var(--muted); }
.why div p { margin-bottom: .5em; }
.ticket .btn + .btn { margin-top: 8px; }
.special { margin-top: 14px; font-size: .95rem; }
.special p { margin: 8px 0; color: var(--muted); }

/* Barra fija en móvil */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--navy); color: var(--white); padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(0,30,60,.25);
}
.bar[hidden] { display: none; }
.bar__label { display: block; font-size: .8rem; opacity: .8; }
.bar strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
@media (min-width: 960px) { .bar { display: none !important; } }

/* Ficha de otro trámite */
.tramite { padding-bottom: 32px; }
.tramite[hidden] { display: none; }
.tcard { background: var(--white); border: 1.5px solid var(--line); border-top: 6px solid var(--orange); border-radius: var(--radius); padding: 22px; display: grid; gap: 20px; }
@media (min-width: 820px) { .tcard { grid-template-columns: 1.4fr 1fr; } }
.tcard h2 { font-size: 1.6rem; }
.tcard__price { font-size: 2.6rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1; margin-bottom: 6px; }
.tcard__price small { font-size: 1rem; font-weight: 600; color: var(--muted); margin-right: 6px; }
.tcard h3 { font-size: 1.05rem; }
.tcard .btn + .btn { margin-top: 8px; }

/* Secciones de información */
.docs, .how, .faq { padding-top: 28px; padding-bottom: 12px; }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; max-width: 46em; }
.checklist li { padding-left: 30px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .25em; width: 18px; height: 18px; border-radius: 4px; border: 2px solid var(--navy); background: linear-gradient(var(--navy), var(--navy)) center/8px 8px no-repeat; }
.how__steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
@media (min-width: 760px) { .how__steps { grid-template-columns: repeat(3, 1fr); } }
.how__steps li { counter-increment: s; background: var(--white); border-left: 4px solid var(--navy); padding: 14px 16px; border-radius: 0 8px 8px 0; }
.how__steps li::before { content: counter(s); display: block; font-weight: 800; font-size: 1.6rem; color: var(--orange-ink); line-height: 1; margin-bottom: 6px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; max-width: 50em; }
.faq summary { cursor: pointer; font-weight: 650; color: var(--navy); }
.faq details p { margin: 8px 0 0; color: var(--muted); }

/* Pie */
.foot { background: var(--navy); color: rgba(255,255,255,.85); margin-top: 40px; padding: 28px 0 90px; font-size: .95rem; }
@media (min-width: 960px) { .foot { padding-bottom: 28px; } }
.foot a { color: var(--white); }
.foot__in { display: grid; gap: 16px; }
@media (min-width: 760px) { .foot__in { grid-template-columns: 1fr 1fr; } }
.foot p { margin: 0 0 4px; }
.foot__name { font-weight: 750; color: var(--white); font-size: 1.1rem; }
.foot__legal { margin-top: 18px !important; font-size: .8rem; opacity: .75; }
