@font-face { font-family: "Overpass"; src: url("fonts/Overpass.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }

:root {
  /* Azul medido en el icono real de mi DGT; rosa y azul europeo del permiso español */
  --azul: #0f5993;
  --azul-hondo: #0a3f6b;
  --azul-claro: #dfeaf5;
  --rosa: #f6d3dd;
  --rosa-2: #edb6c6;
  --ue: #003399;
  --amarillo: #ffcc00;
  --fondo: #eef3f8;
  --papel: #ffffff;
  --tinta: #0b1f33;
  --tinta-2: #4c5f73;
  --linea: #d8e2ec;
  --bien: #0a7448;
  --alerta: #a45200;
  --r-s: 10px; --r-m: 16px; --r-l: 22px;
  --sale: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; margin: 0; }
html { height: 100%; }
body { min-height: 100%; background: #dde6ef; color: var(--tinta); font: 400 16px/1.4 "Overpass", system-ui, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--azul); color: #fff; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; border-radius: 6px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.escena { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 340px) auto; gap: 72px; align-items: center; justify-content: center; padding: 24px; }
.ficha h1 { font-size: 2.5rem; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.ficha p { margin-top: 16px; color: var(--tinta-2); font-size: 1.0625rem; max-width: 34ch; }
.ficha .aviso { margin-top: 28px; font-size: .875rem; }
.corto { display: none; }
.interruptor { display: inline-flex; align-items: center; gap: 12px; margin-top: 28px; min-height: 44px; font-weight: 600; cursor: pointer; }
.interruptor input { position: absolute; opacity: 0; pointer-events: none; }
.carril { width: 50px; height: 30px; border-radius: 15px; background: #b3c2d1; position: relative; transition: background .2s; }
.carril::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(11 31 51 / .3); transition: translate .25s var(--sale); }
.interruptor input:checked + .carril { background: var(--azul); }
.interruptor input:checked + .carril::after { translate: 20px 0; }

.movil { width: 390px; height: 844px; zoom: var(--escala, 1); border-radius: 54px; padding: 10px; background: #0d1620; box-shadow: 0 2px 4px rgb(11 31 51 / .2), 0 30px 60px -20px rgb(15 89 147 / .45); }
.pantalla { position: relative; height: 100%; border-radius: 44px; overflow: hidden; background: var(--fondo); display: flex; flex-direction: column; }
.estado { flex: none; height: 50px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 6px 28px 0; font-weight: 700; font-size: .9375rem; }
.isla { width: 104px; height: 30px; border-radius: 15px; background: #0d1620; }

.vista { flex: 1; overflow-y: auto; padding: 4px 16px 24px; scrollbar-width: none; }
.vista::-webkit-scrollbar { display: none; }
.vista[hidden] { display: none; }
.cabecera { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 4px 14px; }
.cabecera h2 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.015em; }
.puntos { color: var(--tinta-2); font-size: .9375rem; font-variant-numeric: tabular-nums; }
.puntos b { color: var(--bien); font-size: 1.25rem; font-weight: 800; }
h3 { font-size: 1.0625rem; font-weight: 700; margin: 24px 4px 10px; }

.nota-red { display: none; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 14px; border-radius: var(--r-s); background: var(--tinta); color: #fff; font-size: .9375rem; font-weight: 600; }
.sin-red .nota-red { display: flex; }

/* ---------- el permiso ---------- */
.carne { background: linear-gradient(160deg, #fae3ea 0%, var(--rosa) 50%, var(--rosa-2) 100%); color: #3a1422; border-radius: var(--r-l); padding: 14px 16px 14px; box-shadow: 0 1px 2px rgb(120 40 70 / .25), 0 14px 28px -14px rgb(120 40 70 / .55); position: relative; overflow: hidden; }
.c-cab { display: flex; align-items: center; gap: 10px; }
.ue { width: 34px; height: 44px; border-radius: 5px; background: var(--ue); color: #fff; font-weight: 800; display: grid; place-items: end center; padding-bottom: 5px; position: relative; flex: none; }
.ue::before { content: ""; position: absolute; left: 50%; top: 8px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; border: 2px dotted var(--amarillo); }
.c-cab b { display: block; font-size: 1.0625rem; font-weight: 800; line-height: 1.1; }
.c-cab span { font-size: .8125rem; color: #6d3a4c; }
.muestra { margin-left: auto; align-self: flex-start; padding: 3px 9px; border-radius: 6px; background: #3a1422; color: #fff !important; font-size: .6875rem !important; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.c-cuerpo { display: grid; grid-template-columns: 92px 1fr; gap: 14px; margin-top: 12px; }
.foto { height: 112px; border-radius: 10px; background: rgb(255 255 255 / .55); box-shadow: inset 0 0 0 1px rgb(58 20 34 / .15); display: grid; place-items: end center; overflow: hidden; }
.foto svg { width: 84px; height: 84px; fill: #c98da1; stroke: none; }
.carne dl { display: grid; gap: 6px; align-content: start; }
.carne dt { font-size: .6875rem; color: #6d3a4c; line-height: 1.2; }
.carne dd { font-size: 1.0625rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .dos dd { font-size: .9375rem; }
.c-pie { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgb(58 20 34 / .3); }
.clases { display: flex; gap: 6px; } .clases b { min-width: 34px; height: 26px; padding: 0 7px; border-radius: 6px; background: #3a1422; color: #fff; font-size: .8125rem; font-weight: 800; display: grid; place-items: center; }
.guardado { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; color: #6d3a4c; }

.boton { min-height: 52px; padding: 0 20px; border-radius: 26px; font-weight: 700; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; gap: 10px; white-space: nowrap; transition: scale .15s var(--sale), background .15s; }
.boton:active { scale: .97; }
.boton-azul { background: var(--azul); color: #fff; } .boton-azul:hover { background: var(--azul-hondo); }
.ancho { width: 100%; margin-top: 14px; }

/* ---------- vehículos ---------- */
.vehiculos { list-style: none; padding: 0; background: var(--papel); border-radius: var(--r-m); box-shadow: inset 0 0 0 1px var(--linea); }
.vehiculos li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; }
.vehiculos li + li { border-top: 1px solid var(--linea); }
.matricula { display: inline-grid; grid-template-columns: 14px auto; align-items: stretch; height: 30px; border-radius: 5px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--tinta); overflow: hidden; font-weight: 800; font-size: .9375rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.matricula::before { content: ""; background: var(--ue); }
.matricula span { padding: 0 8px; display: grid; place-items: center; }
.veh b { display: block; font-size: .9375rem; font-weight: 700; line-height: 1.25; } .veh small { color: var(--tinta-2); font-size: .8125rem; }
.estado-v { font-size: .8125rem; font-weight: 700; color: var(--bien); text-align: right; } .estado-v.ojo { color: var(--alerta); }

.coche { background: var(--papel); border-radius: var(--r-m); box-shadow: inset 0 0 0 1px var(--linea); padding: 16px; margin-bottom: 12px; }
.coche-cab { display: flex; align-items: center; gap: 12px; }
.coche-cab div { flex: 1; } .coche-cab b { display: block; font-size: 1.0625rem; font-weight: 800; line-height: 1.2; } .coche-cab small { color: var(--tinta-2); font-size: .8125rem; }
.distintivo { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 1.25rem; color: #0b1f33; box-shadow: inset 0 0 0 3px rgb(11 31 51 / .15); }
.papeles { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 0; }
.papeles li { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 10px 0; border-top: 1px solid var(--linea); font-size: .9375rem; }
.papeles span { color: var(--tinta-2); } .papeles b { font-weight: 700; font-variant-numeric: tabular-nums; } .papeles .bien { color: var(--bien); } .papeles .ojo { color: var(--alerta); }

/* ---------- avisos y cuenta ---------- */
.avisos, .ajustes { list-style: none; padding: 0; background: var(--papel); border-radius: var(--r-m); box-shadow: inset 0 0 0 1px var(--linea); }
.avisos li { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px 16px; align-items: start; }
.avisos li + li, .ajustes li + li { border-top: 1px solid var(--linea); }
.avisos svg { color: var(--tinta-2); margin-top: 2px; } .avisos .ok svg { color: var(--bien); }
.avisos b { display: block; font-size: .9375rem; } .avisos small { color: var(--tinta-2); font-size: .8125rem; }
.perfil { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--papel); border-radius: var(--r-m); box-shadow: inset 0 0 0 1px var(--linea); margin-bottom: 14px; }
.iniciales { width: 48px; height: 48px; border-radius: 50%; background: var(--azul); color: #fff; display: grid; place-items: center; font-weight: 800; }
.perfil b, .perfil small { display: block; } .perfil small { color: var(--tinta-2); font-size: .875rem; }
.ajustes button { width: 100%; min-height: 54px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; text-align: left; }
.ajustes svg { color: var(--tinta-2); }
.pie-lista { margin: 18px 4px 0; color: var(--tinta-2); font-size: .875rem; }

/* ---------- pestañas: la activa, en el azul de la DGT ---------- */
.pestanas { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px 22px; background: var(--papel); border-top: 1px solid var(--linea); position: relative; z-index: 2; }
.pestanas button { min-height: 52px; display: grid; justify-items: center; align-content: center; gap: 2px; font-size: .75rem; font-weight: 600; color: var(--tinta-2); border-radius: 12px; }
.pestanas svg { box-sizing: border-box; width: 60px; height: 30px; padding: 3px 18px; border-radius: 15px; }
.pestanas button[aria-current="page"] { color: var(--azul); font-weight: 800; }
.pestanas button[aria-current="page"] svg { stroke-width: 2.3; background: var(--azul-claro); }

/* ---------- carné a pantalla completa ---------- */
.capa-carne { position: absolute; inset: 0; z-index: 5; background: var(--papel); padding: 54px 20px 24px; display: flex; flex-direction: column; align-items: center; overflow-y: auto; view-transition-name: carne; }
.capa-carne[hidden] { display: none; }
.capa-carne header { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.capa-carne h2 { font-size: 1.375rem; font-weight: 800; }
.redondo { width: 44px; height: 44px; border-radius: 50%; background: var(--azul-claro); display: grid; place-items: center; }
.red-carne { margin-top: 10px; align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; border-radius: var(--r-s); font-size: .875rem; font-weight: 600; background: #e4f5ec; color: #075c39; }
.sin-red .red-carne { background: var(--tinta); color: #fff; }
.qr { margin-top: 18px; padding: 16px; border-radius: var(--r-l); box-shadow: inset 0 0 0 1.5px var(--linea); line-height: 0; }
.viajero { margin-top: 14px; text-align: center; } .viajero b { display: block; font-size: 1.125rem; } .viajero span { color: var(--tinta-2); font-size: .875rem; font-variant-numeric: tabular-nums; }
.panel { align-self: stretch; display: grid; grid-template-columns: auto 1.4fr auto; gap: 0; margin-top: 16px; padding: 12px 0; border-block: 1px solid var(--linea); }
.panel div + div { border-left: 1px solid var(--linea); padding-left: 14px; } .panel div { padding-right: 14px; }
.panel dt { font-size: .75rem; color: var(--tinta-2); } .panel dd { font-size: 1.125rem; font-weight: 800; line-height: 1.2; white-space: nowrap; } .verde { color: var(--bien); }
.muestra-nota { margin-top: auto; color: var(--tinta-2); font-size: .8125rem; }

@media (prefers-reduced-motion: reduce) { * { animation-duration: .01s !important; transition-duration: .01s !important; } }

@media (max-width: 760px) {
  body { background: var(--fondo); }
  .escena { display: flex; flex-direction: column; gap: 0; padding: 0; height: 100dvh; align-items: stretch; }
  .ficha { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; padding: 4px 16px 8px; background: var(--tinta); color: #fff; }
  .ficha h1 { font-size: .9375rem; letter-spacing: 0; } .ficha p { display: none; }
  .ficha .aviso { display: block; order: 3; flex-basis: 100%; margin: 0; font-size: .75rem; line-height: 1.3; color: #b9c7d6; max-width: none; }
  .largo { display: none; } .corto { display: inline; }
  .interruptor { margin: 0; font-size: .8125rem; gap: 8px; flex-direction: row-reverse; font-weight: 500; }
  .carril { width: 40px; height: 24px; background: #56687a; } .carril::after { width: 18px; height: 18px; }
  .interruptor input:checked + .carril { background: #4aa3e8; } .interruptor input:checked + .carril::after { translate: 16px 0; }
  .movil { width: 100%; height: auto; flex: 1; min-height: 0; zoom: 1; border-radius: 0; padding: 0; background: none; box-shadow: none; display: flex; }
  .pantalla { border-radius: 0; flex: 1; height: auto; }
  .estado { display: none; } .vista { padding-top: 12px; } .capa-carne { padding-top: 16px; }
  .pestanas { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

body.embed { background: var(--fondo); }
body.embed .escena { display: block; padding: 0; } body.embed .ficha { display: none; }
body.embed .movil { zoom: 1; border-radius: 0; padding: 0; box-shadow: none; background: none; } body.embed .pantalla { border-radius: 0; }
