/* ============================================================
   AUTIA GPS — App cliente B2C · MOCKUP V2 (datos de ejemplo)
   Diseño propio, simple y consumer. Branding Autia (navy + cian, Geist).
   Mobile-first (PWA). Sin backend: solo look & feel y flujo.
   ============================================================ */
:root {
  --navy: #0A1628;
  --navy-2: #12243f;
  --cian: #00CFFF;
  --cian-2: #38D9F5;
  --cian-deep: #0369A1;
  --cian-soft: #E7F9FF;
  --cian-mist: #F2FCFF;
  --bg: #F4F7FA;
  --surface: #FFFFFF;
  --text: #0A1628;
  --muted: #4A5568;
  --muted-2: #8B96A8;
  --border: #E7E9EE;
  --line: rgba(10, 22, 40, .07);
  --ok: #10B981;
  --warn: #F59E0B;
  --err: #EF4444;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --app-w: 440px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--cian); color: var(--navy); }
:focus-visible { outline: 2px solid var(--cian-deep); outline-offset: 2px; border-radius: 6px; }

/* ============================ AUTH (login / crear clave) ============================ */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(40% 30% at 15% 8%, rgba(0, 207, 255, .18), transparent 70%),
    radial-gradient(45% 35% at 90% 6%, rgba(0, 207, 255, .12), transparent 70%),
    linear-gradient(180deg, #fff 0%, var(--cian-mist) 45%, var(--bg) 100%);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 30px 26px;
  box-shadow: 0 32px 80px -28px rgba(10, 22, 40, .3);
}
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; margin-bottom: 24px; }
.logo-badge {
  width: 76px; height: 76px; border-radius: 24px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--navy-2), var(--navy));
  box-shadow: 0 18px 38px -14px rgba(0, 207, 255, .5);
}
.logo-badge svg { width: 40px; height: 40px; color: var(--cian); }
.auth-brand h1 { margin: 0; font-size: 23px; font-weight: 600; letter-spacing: -.02em; }
.auth-brand p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.4; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; border-radius: 14px; background: var(--bg); margin-bottom: 20px; }
.tab { border-radius: 11px; padding: 11px 10px; color: var(--muted); font-weight: 600; font-size: 14px; transition: .15s; }
.tab.active { background: var(--surface); color: var(--cian-deep); box-shadow: 0 6px 16px -8px rgba(10, 22, 40, .25); }
.panel { display: none; }
.panel.active { display: block; }

label { display: block; margin: 14px 0 7px; font-size: 13px; font-weight: 500; color: var(--navy); }
.input {
  width: 100%; height: 52px;
  border: 1px solid var(--border); border-radius: 14px;
  padding: 0 15px; background: var(--bg); color: var(--text);
  font-size: 16px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: var(--muted-2); }
.input:focus { border-color: var(--cian-deep); background: var(--surface); box-shadow: 0 0 0 3px rgba(3, 105, 161, .12); }

.btn {
  width: 100%; min-height: 54px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border-radius: 16px; font-weight: 600; font-size: 15px;
  color: var(--navy);
  background: linear-gradient(135deg, var(--cian), var(--cian-2));
  box-shadow: 0 16px 30px -12px rgba(0, 207, 255, .5);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: var(--surface); color: var(--navy); border: 1px solid var(--border); box-shadow: none; }
.btn.dark { background: var(--navy); color: #fff; box-shadow: 0 16px 30px -14px rgba(10, 22, 40, .5); }
.btn.block { margin-top: 18px; }
.btn svg { width: 18px; height: 18px; }

.msg { margin-top: 14px; border-radius: 13px; padding: 12px 13px; font-size: 13px; line-height: 1.45; font-weight: 500; }
.msg.ok { background: rgba(16, 185, 129, .12); color: #047857; }
.msg.err { background: rgba(239, 68, 68, .1); color: #b91c1c; }
.msg.info { background: var(--cian-soft); color: var(--cian-deep); }

.auth-foot { margin-top: 18px; text-align: center; color: var(--muted-2); font-family: var(--mono); font-size: 12px; }
.auth-link { display: block; margin-top: 16px; text-align: center; color: var(--cian-deep); font-weight: 600; font-size: 14px; }

/* ============================ APP SHELL ============================ */
.app {
  width: 100%;
  max-width: var(--app-w);
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(60% 18% at 50% 0%, rgba(0, 207, 255, .10), transparent 70%),
    var(--bg);
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 18px 12px;
  background: rgba(244, 247, 250, .82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.app-hi { display: flex; align-items: center; gap: 11px; min-width: 0; }
.app-logo { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(150deg, var(--navy-2), var(--navy)); flex: 0 0 auto; }
.app-logo svg { width: 22px; height: 22px; color: var(--cian); }
.app-hi b { display: block; font-size: 15px; font-weight: 600; }
.app-hi span { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.hchip { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--cian-deep); flex: 0 0 auto; }
.hchip svg { width: 20px; height: 20px; }

.view { display: none; padding: 16px 16px 0; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted-2); margin: 4px 2px 10px; }

/* ---------- Tarjeta del vehículo (hero) ---------- */
.vcard {
  position: relative; overflow: hidden;
  border-radius: 26px;
  background:
    radial-gradient(circle at 85% 12%, rgba(0, 207, 255, .26), transparent 32%),
    linear-gradient(150deg, var(--navy-2), var(--navy));
  color: #fff;
  padding: 18px;
  box-shadow: 0 26px 56px -24px rgba(10, 22, 40, .5);
}
.vcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.vcard-plate {
  font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .12em;
  padding: 6px 10px; border-radius: 9px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16);
}
.vcard h2 { margin: 12px 0 2px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.vcard-sub { color: rgba(255, 255, 255, .68); font-size: 13px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16);
  font-family: var(--mono); font-size: 11px; font-weight: 500; white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 999px; background: var(--ok); box-shadow: 0 0 0 4px rgba(16, 185, 129, .2); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 4px rgba(245, 158, 11, .2); }

.mini-map {
  position: relative; margin-top: 16px; height: 150px; border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  background:
    linear-gradient(90deg, rgba(0, 207, 255, .1) 1px, transparent 1px) 0 0 / 30px 30px,
    linear-gradient(0deg, rgba(0, 207, 255, .1) 1px, transparent 1px) 0 0 / 30px 30px,
    radial-gradient(circle at 30% 38%, rgba(0, 207, 255, .22), transparent 30%),
    radial-gradient(circle at 76% 72%, rgba(16, 185, 129, .16), transparent 30%),
    #0c1c33;
}
.mini-map .route { position: absolute; left: 16%; top: 54%; width: 64%; height: 3px; border-radius: 9px; transform: rotate(-16deg); background: linear-gradient(90deg, var(--cian), var(--ok)); opacity: .85; }
.pin { position: absolute; left: 52%; top: 46%; transform: translate(-50%, -50%); width: 16px; height: 16px; border-radius: 50%; background: var(--cian); border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(0, 207, 255, .2); }
.pin::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid rgba(0, 207, 255, .5); animation: ping 1.9s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.1); opacity: 0; } }
.map-chip { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .95); color: var(--navy); font-size: 11px; font-weight: 600; }
.map-chip .dot { width: 6px; height: 6px; }
.vcard-cta { margin-top: 14px; }
.vcard-cta .btn { min-height: 48px; border-radius: 14px; }

/* ---------- Accesos rápidos ---------- */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.q { display: grid; gap: 8px; justify-items: center; padding: 14px 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 24px -16px rgba(10, 22, 40, .2); }
.q-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--cian-soft); color: var(--cian-deep); }
.q-ic svg { width: 20px; height: 20px; }
.q span { font-size: 11.5px; font-weight: 600; color: var(--navy); }
.q.pro .q-ic { background: var(--navy); color: var(--cian); }

/* ---------- Tarjetas / listas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 16px; box-shadow: 0 12px 30px -18px rgba(10, 22, 40, .2); margin-top: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.card-h a { font-size: 13px; font-weight: 600; color: var(--cian-deep); }

.doc { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.doc + .doc { margin-top: 9px; }
.doc-ic { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--cian-soft); color: var(--cian-deep); }
.doc-ic svg { width: 20px; height: 20px; }
.doc-tx { flex: 1; min-width: 0; }
.doc-tx b { display: block; font-size: 14px; font-weight: 600; }
.doc-tx span { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.badge { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .03em; padding: 5px 9px; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: rgba(16, 185, 129, .14); color: #047857; }
.badge.warn { background: rgba(245, 158, 11, .16); color: #b45309; }
.badge.err { background: rgba(239, 68, 68, .12); color: #b91c1c; }

/* ---------- Banner Pro (antirrobo) ---------- */
.pro-banner {
  position: relative; overflow: hidden; margin-top: 16px;
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, var(--navy-2), var(--navy));
}
.pro-banner::after { content: ""; position: absolute; right: -30px; top: -30px; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, rgba(0, 207, 255, .22), transparent 70%); }
.pro-ic { position: relative; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: rgba(0, 207, 255, .16); color: var(--cian); }
.pro-ic svg { width: 22px; height: 22px; }
.pro-tx { position: relative; flex: 1; }
.pro-tx b { display: block; font-size: 14px; font-weight: 600; }
.pro-tx span { display: block; font-size: 12px; color: rgba(255, 255, 255, .7); margin-top: 2px; }
.toggle { position: relative; flex: 0 0 auto; width: 46px; height: 27px; border-radius: 999px; background: var(--cian); }
.toggle::after { content: ""; position: absolute; top: 3px; right: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle.off { background: rgba(255, 255, 255, .25); }
.toggle.off::after { right: auto; left: 3px; }

/* ---------- Vista Mapa ---------- */
.big-map {
  position: relative; height: calc(100dvh - 320px); min-height: 320px; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--border);
  background:
    linear-gradient(90deg, rgba(0, 207, 255, .09) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(0deg, rgba(0, 207, 255, .09) 1px, transparent 1px) 0 0 / 34px 34px,
    radial-gradient(circle at 28% 34%, rgba(0, 207, 255, .2), transparent 30%),
    radial-gradient(circle at 74% 70%, rgba(16, 185, 129, .16), transparent 30%),
    #0c1c33;
}
.big-map .route { position: absolute; left: 18%; top: 52%; width: 60%; height: 3px; border-radius: 9px; transform: rotate(-14deg); background: linear-gradient(90deg, var(--cian), var(--ok)); }
.big-map .pin { left: 50%; top: 47%; }
.loc-card { margin-top: 14px; }
.loc-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.loc-row + .loc-row { border-top: 1px solid var(--line); }
.loc-row .doc-ic { background: var(--cian-soft); }
.loc-row .doc-tx b { font-size: 14px; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn.wa { background: rgba(16, 185, 129, .14); color: #047857; box-shadow: none; }

/* ---------- Perfil ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.avatar { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: var(--navy); background: linear-gradient(135deg, var(--cian-soft), var(--cian)); }
.profile-head b { display: block; font-size: 19px; font-weight: 600; }
.profile-head span { display: block; font-size: 13px; color: var(--muted); }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv span { color: var(--muted); font-size: 13px; }
.kv b { font-size: 14px; font-weight: 600; }
.plan-pill { font-family: var(--mono); font-size: 11px; padding: 5px 10px; border-radius: 999px; background: var(--cian-soft); color: var(--cian-deep); font-weight: 500; }
.menu-link { display: flex; align-items: center; gap: 12px; padding: 14px 0; color: var(--navy); font-size: 15px; font-weight: 500; }
.menu-link + .menu-link { border-top: 1px solid var(--line); }
.menu-link svg { width: 19px; height: 19px; color: var(--cian-deep); }
.menu-link .chev { margin-left: auto; color: var(--muted-2); }

/* ---------- Bottom nav ---------- */
.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: var(--app-w); z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabbtn { display: grid; gap: 4px; justify-items: center; padding: 7px 4px; border-radius: 14px; color: var(--muted-2); font-size: 11px; font-weight: 600; }
.tabbtn svg { width: 22px; height: 22px; }
.tabbtn.active { color: var(--cian-deep); background: var(--cian-soft); }

/* ---------- Sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 80; background: rgba(10, 22, 40, .45); display: none; }
.sheet.open { display: block; }
.sheet-panel {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100vw, var(--app-w)); max-height: 86dvh; overflow-y: auto;
  background: #fff; border-radius: 26px 26px 0 0;
  padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px rgba(10, 22, 40, .28);
}
.sheet-grip { width: 40px; height: 4px; border-radius: 999px; background: var(--border); margin: 6px auto 14px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-h h3 { margin: 0; font-size: 18px; font-weight: 600; }
.sheet-close { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--bg); color: var(--muted); }
.sheet-close svg { width: 18px; height: 18px; }
.doc-preview { height: 280px; border-radius: 16px; background: linear-gradient(180deg, #0c1c33, var(--navy)); display: grid; place-items: center; color: rgba(255, 255, 255, .5); font-size: 13px; text-align: center; padding: 20px; }
.doc-preview svg { width: 38px; height: 38px; color: var(--cian); margin-bottom: 10px; }

@media (min-width: 480px) {
  .app, .tabbar { box-shadow: 0 0 0 1px var(--line); }
  body { background: #eef1f5; }
  .app { min-height: 100dvh; }
}
