/* ============================================================
   TripSwap — Design System · Premium Edition
   Viajes por intercambio en anillos. Mobile-first PWA.
   Identidad: deep teal × sunset coral × arena cálida.
   Tipografía display: Sora · UI: Inter.
   ============================================================ */

:root {
  /* paleta */
  --bg: #F6F5F1;
  --bg-deep: #EFEEE8;
  --surface: #FFFFFF;
  --surface-2: #F4F3EE;
  --ink: #102E2B;
  --ink-2: #55696B;
  --ink-3: #93A5A3;
  --hair: rgba(16, 46, 43, .08);

  --teal: #0D9488;
  --teal-deep: #0B7A70;
  --teal-dark: #0A5A53;
  --teal-glow: rgba(13, 148, 136, .28);
  --teal-soft: #DEF7F2;

  --coral: #FF6B5E;
  --coral-deep: #E8473A;
  --coral-glow: rgba(255, 107, 94, .35);
  --coral-soft: #FFECE8;

  --sun: #F2B33D;
  --sun-soft: #FCF3DD;
  --gold: #C8942E;

  --ok: #178A4C; --ok-soft: #DFF5E7;
  --warn: #B45309; --warn-soft: #FCF0DC;
  --danger: #C63D2F; --danger-soft: #FCE8E5;

  --grad-sunset: linear-gradient(135deg, #FF8A5E 0%, #FF6B5E 45%, #F2B33D 110%);
  --grad-teal: linear-gradient(150deg, #0A5A53 0%, #0B7A70 70%, #0B7A70 130%);

  /* profundidad: sombras en capas */
  --shadow-1: 0 1px 2px rgba(16,46,43,.05), 0 3px 10px rgba(16,46,43,.06);
  --shadow-2: 0 1px 2px rgba(16,46,43,.05), 0 10px 28px rgba(16,46,43,.10);
  --shadow-3: 0 2px 4px rgba(16,46,43,.06), 0 24px 56px rgba(16,46,43,.16);
  --shadow-sunset: 0 8px 22px var(--coral-glow);

  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 15px;
  --r-sm: 12px;

  --font-display: 'Sora', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ease-out: cubic-bezier(.22,.9,.28,1);
  --ease-spring: cubic-bezier(.34,1.4,.44,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
}

/* aurora de la casa: 3 blobs radiales con deriva lenta (punto 4) */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(52rem 32rem at 115% -12%, rgba(13,148,136,.13), transparent 60%),
    radial-gradient(44rem 30rem at -18% 112%, rgba(255,107,94,.11), transparent 60%),
    radial-gradient(38rem 26rem at 62% 8%, rgba(255,194,75,.10), transparent 62%);
  animation: auroraDrift 26s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  from { background-position: 0 0, 0 0, 0 0; }
  to   { background-position: -3% 2%, 3% -3%, -2% 3%; }
}
@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
}

::selection { background: var(--teal); color: #fff; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(16,46,43,.16); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- App frame ---------- */
#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  z-index: 1;
}
@media (min-width: 900px) {
  body::before {
    content: 'TripSwap · el anillo cierra tu destino — demo premium';
    position: fixed; top: 16px; left: 0; right: 0;
    text-align: center; color: #8CA5A1; font-size: 12.5px; letter-spacing: .12em;
    text-transform: uppercase; font-weight: 600; z-index: 0;
  }
  #app {
    margin-top: 52px; min-height: calc(100vh - 92px);
    border-radius: 36px; overflow: hidden;
    box-shadow: 0 0 0 1px var(--hair), 0 40px 90px rgba(16,46,43,.22);
  }
}

/* ---------- Topbar glass ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(246, 245, 241, .78);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid var(--hair);
  padding: 14px 18px 12px;
  display: flex; align-items: center; gap: 12px;
}
.topbar .logo {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  background: conic-gradient(from 215deg, #0B7A70, #2BB8A5, #F2B33D, #FF6B5E, #0B7A70);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.85), var(--shadow-2);
}
.topbar .logo svg { width: 25px; height: 25px; }
.topbar .tt { flex: 1; min-width: 0; }
.topbar .tt h1 {
  font-family: var(--font-display); font-size: 19px; font-weight: 700;
  letter-spacing: -.025em;
}
.topbar .tt p { font-size: 11.5px; color: var(--ink-2); margin-top: -2px; font-weight: 500; }
.topbar .avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  border: 2.5px solid #fff; box-shadow: var(--shadow-2);
  object-fit: cover; background: var(--teal-soft);
}

/* ---------- Contenido ---------- */
.screen { display: none; padding: 18px 18px 110px; }
.screen.active { display: block; }
.screen.active > * { animation: riseIn .5s var(--ease-out) both; }
.screen.active > *:nth-child(2) { animation-delay: .05s; }
.screen.active > *:nth-child(3) { animation-delay: .1s; }
.screen.active > *:nth-child(4) { animation-delay: .15s; }
.screen.active > *:nth-child(5) { animation-delay: .2s; }
.screen.active > *:nth-child(n+6) { animation-delay: .24s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

h2.sec {
  font-family: var(--font-display);
  font-size: 12px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--ink-2); margin: 26px 4px 12px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
h2.sec:first-child { margin-top: 6px; }
h2.sec .pill-mini {
  background: var(--teal-soft); color: var(--teal-deep);
  font-family: var(--font); font-size: 10.5px; padding: 3px 9px; border-radius: 99px;
  text-transform: none; letter-spacing: 0; font-weight: 700;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: 18px; margin-bottom: 14px;
  position: relative;
}
.card.click { cursor: pointer; transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out); }
.card.click:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.card.click:active { transform: scale(.982); }

/* Hero: el anillo recomendado */
.hero-ring {
  background:
    radial-gradient(120% 130% at 85% -20%, rgba(43,184,165,.5), transparent 52%),
    radial-gradient(90% 90% at -10% 115%, rgba(255,138,94,.32), transparent 55%),
    linear-gradient(155deg, #0A5A53 0%, #0B7A70 42%, #0D9488 100%);
  border: 1px solid rgba(255,255,255,.14);
  color: #fff; overflow: hidden; position: relative;
  border-radius: var(--r-xl);
  box-shadow: 0 2px 4px rgba(6,44,40,.1), 0 26px 52px rgba(6,44,40,.32);
  padding: 20px;
}
.hero-ring::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
}
.hero-ring .kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  opacity: .82; display: flex; align-items: center; gap: 7px;
}
.hero-ring h3 {
  font-family: var(--font-display);
  font-size: 22px; margin: 8px 0 3px; letter-spacing: -.025em; line-height: 1.22;
}
.hero-ring .sub { font-size: 13px; opacity: .85; font-weight: 450; }
.hero-ring .ring-wrap { margin: 10px -6px 6px; }
.hero-ring .stats { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 2; }
.hero-ring .stat {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
  border-radius: 14px; padding: 8px 12px; font-size: 11.5px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.hero-ring .stat b { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.hero-ring .cta-row { display: flex; gap: 10px; margin-top: 16px; position: relative; z-index: 2; }

/* ---------- Botones ---------- */
.btn {
  border: none; cursor: pointer; font-family: var(--font); font-weight: 650;
  border-radius: 15px; padding: 13px 20px; font-size: 14.5px; letter-spacing: -.005em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .18s var(--ease-spring), box-shadow .2s var(--ease-out), filter .2s;
}
.btn:active { transform: scale(.96); }
.btn:focus-visible { outline: 2.5px solid var(--teal); outline-offset: 2px; }
.btn.primary {
  /* texto INK sobre gradiente sunset: 5.2-7.8:1 en TODA la extensión (A5 — el blanco
     caía a 1.9:1 sobre el tramo dorado); vibrante Y legible, sin promediar */
  background: var(--grad-sunset); color: var(--ink); font-weight: 750;
  box-shadow: var(--shadow-sunset), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn.primary:hover { filter: brightness(1.06) saturate(1.05); box-shadow: 0 10px 26px var(--coral-glow), inset 0 1px 0 rgba(255,255,255,.35); }
.btn.ghost {
  background: rgba(255,255,255,.13); color: #fff;
  border: 1.5px solid rgba(255,255,255,.34);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn.soft { background: var(--teal-soft); color: var(--teal-dark); box-shadow: inset 0 0 0 1px rgba(13,148,136,.16); }
.btn.line { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--hair), var(--shadow-1); }
.btn.block { width: 100%; }
.btn.sm { padding: 9px 14px; font-size: 13px; border-radius: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.3); }

/* ---------- Ring SVG ---------- */
.ring-svg { width: 100%; height: auto; display: block; }
.ring-svg .edge {
  fill: none; stroke: rgba(255,255,255,.8); stroke-width: 3;
  stroke-dasharray: 2 9; stroke-linecap: round;
  animation: orbitFlow 2.2s linear infinite;
}
.ring-svg.on-light .edge { stroke: rgba(11,122,112,.5); }
@keyframes orbitFlow { to { stroke-dashoffset: -44; } }
.ring-svg .edge-label { font-size: 15px; }
.ring-svg .node-halo { fill: rgba(255,255,255,.14); stroke: rgba(255,255,255,.5); stroke-width: 1.5; }
.ring-svg.on-light .node-halo { fill: #fff; stroke: var(--hair); }
.ring-svg .node-flag { font-size: 22px; }
.ring-svg .node-city {
  fill: #fff; font-size: 13px; font-weight: 700; text-anchor: middle;
  font-family: var(--font-display); letter-spacing: -.01em;
  paint-order: stroke; stroke: rgba(6,44,40,.35); stroke-width: 2.6px;
}
.ring-svg.on-light .node-city { fill: var(--ink); stroke: none; }
.ring-svg .node-kind { fill: rgba(255,255,255,.8); font-size: 9.5px; text-anchor: middle; letter-spacing: .03em; font-weight: 600; }
.ring-svg.on-light .node-kind { fill: var(--ink-2); }

/* ---------- Chips / badges ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--hair); background: var(--surface);
  border-radius: 99px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  color: var(--ink-2); cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .18s var(--ease-out);
  box-shadow: var(--shadow-1);
}
.chip.on {
  background: var(--grad-teal); border-color: transparent; color: #fff;
  box-shadow: 0 5px 14px var(--teal-glow);
  transform: translateY(-1px);
}
.chip:focus-visible { outline: 2.5px solid var(--teal); outline-offset: 2px; }
.chips.select .chip.on { background: var(--grad-sunset); box-shadow: 0 5px 14px var(--coral-glow); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; padding: 3.5px 9px; border-radius: 99px;
  letter-spacing: .01em;
}
.badge.teal { background: var(--teal-soft); color: var(--teal-dark); }
.badge.coral { background: var(--coral-soft); color: var(--coral-deep); }
.badge.sun { background: var(--sun-soft); color: #7A5A14; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.gray { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--hair); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

.score-orb {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 15.5px;
  font-family: var(--font-display);
  background: conic-gradient(var(--teal) calc(var(--v) * 1%), #E7E6DF 0);
  position: relative;
  box-shadow: 0 4px 12px var(--teal-glow);
}
.score-orb::before { content: ''; position: absolute; inset: 4.5px; background: #fff; border-radius: 50%; box-shadow: inset 0 1px 3px rgba(16,46,43,.08); }
.score-orb span { position: relative; color: var(--teal-dark); }

/* ---------- Filas (viajeros / anillos) ---------- */
.row {
  display: flex; gap: 13px; align-items: center; padding: 13px 15px;
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--r-md); margin-bottom: 10px;
  box-shadow: var(--shadow-1);
}
.row.click { cursor: pointer; transition: transform .18s var(--ease-out), box-shadow .18s; }
.row.click:hover { transform: translateY(-1.5px); box-shadow: var(--shadow-2); }
.row.click:active { transform: scale(.985); }
.row .ph {
  width: 62px; height: 62px; border-radius: 16px; object-fit: cover; flex: none;
  background: var(--surface-2); box-shadow: var(--shadow-1);
}
.row .ph.round { border-radius: 50%; width: 50px; height: 50px; border: 2px solid #fff; }
.row .body { flex: 1; min-width: 0; }
.row .body h4 { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row .body p { font-size: 12.5px; color: var(--ink-2); margin-top: 1.5px; }
.row .side { text-align: right; flex: none; }
.row .side .sc { font-weight: 800; color: var(--teal-dark); font-size: 16px; font-family: var(--font-display); letter-spacing: -.02em; }
.row .side .lbl { font-size: 9.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }

/* ---------- Explorar ---------- */
.grid-dest { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dest-card {
  border-radius: var(--r-lg); overflow: hidden; position: relative;
  aspect-ratio: 1.02; cursor: pointer;
  border: 1px solid var(--hair); background: var(--surface-2);
  box-shadow: var(--shadow-2);
  transition: transform .24s var(--ease-out), box-shadow .24s;
}
.dest-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); }
.dest-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s var(--ease-out); }
.dest-card:hover img { transform: scale(1.07); }
.dest-card .cap {
  position: absolute; inset: auto 0 0 0; padding: 30px 13px 12px;
  background: linear-gradient(transparent, rgba(7,32,29,.88) 78%);
  color: #fff;
}
.dest-card .cap b { font-size: 15.5px; display: block; font-family: var(--font-display); letter-spacing: -.02em; }
.dest-card .cap span { font-size: 11.5px; opacity: .82; font-weight: 500; }
.dest-card .flag-big {
  position: absolute; top: 10px; left: 11px; font-size: 22px;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.45));
}

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: ''; position: absolute; left: 9.5px; top: 10px; bottom: 10px; width: 2.5px;
  border-radius: 3px;
  background: linear-gradient(var(--teal) 0%, var(--teal) var(--tl-done, 0%), var(--hair) var(--tl-done, 0%));
}
.tstep { position: relative; padding: 7px 0 14px; }
.tstep::before {
  content: ''; position: absolute; left: -28px; top: 12.5px;
  width: 13.5px; height: 13.5px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--hair);
  transition: all .3s var(--ease-out);
}
.tstep.done::before { background: var(--teal); border-color: var(--teal-soft); box-shadow: 0 0 0 3px rgba(13,148,136,.14); }
.tstep.now::before {
  background: var(--sun); border-color: var(--sun-soft);
  box-shadow: 0 0 0 5px rgba(242,179,61,.22);
  animation: pulseNode 2.2s ease-in-out infinite;
}
@keyframes pulseNode { 50% { box-shadow: 0 0 0 8px rgba(242,179,61,.08); } }
.tstep h5 { font-size: 13.5px; color: var(--ink-3); font-weight: 700; letter-spacing: .01em; }
.tstep.done h5, .tstep.now h5 { color: var(--ink); }
.tstep p { font-size: 12px; color: var(--ink-2); }

/* ---------- Tab bar flotante glass ---------- */
.tabbar {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
  width: calc(100% - 28px); max-width: 396px; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--hair);
  border-radius: 22px;
  display: flex; padding: 7px;
  box-shadow: var(--shadow-3);
}
.tab {
  flex: 1; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3.5px;
  font-family: var(--font); font-size: 10px; font-weight: 700;
  color: var(--ink-3); letter-spacing: .02em;
  padding: 8px 2px; border-radius: 15px;
  transition: color .2s, background .2s, transform .18s var(--ease-spring);
}
.tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: stroke-width .2s; }
.tab.on {
  color: var(--teal-dark);
  background: linear-gradient(180deg, rgba(13,148,136,.1), rgba(13,148,136,.16));
}
.tab.on svg { stroke-width: 2.5; }
.tab:active { transform: scale(.93); }

/* ---------- Onboarding premium ---------- */
#onboarding {
  position: fixed; inset: 0; z-index: 100;
  background: #0A2422;
  display: none; flex-direction: column; color: #fff; overflow: hidden;
}
#onboarding.show { display: flex; }
#onboarding .ob-img { flex: 1.25; min-height: 0; position: relative; }
#onboarding .ob-img img { width: 100%; height: 100%; object-fit: cover; opacity: .9; animation: slowZoom 9s var(--ease-out) both; }
@keyframes slowZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
#onboarding .ob-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(rgba(10,36,34,.1) 40%, rgba(10,36,34,.86) 88%, #0A2422 99%);
}
#onboarding .ob-body { flex: 1; padding: 0 30px 30px; position: relative; z-index: 2; margin-top: -52px; display: flex; flex-direction: column; }
#onboarding h2 {
  font-family: var(--font-display); font-size: 30px; letter-spacing: -.035em;
  line-height: 1.16; margin: 10px 0 12px;
}
#onboarding p { font-size: 15px; color: #B9D4CF; line-height: 1.6; max-width: 34ch; }
#onboarding .ob-steps { display: flex; gap: 7px; margin: auto 0 16px; }
#onboarding .ob-steps i { height: 6px; border-radius: 99px; background: rgba(255,255,255,.18); flex: 1; transition: all .3s var(--ease-out); }
#onboarding .ob-steps i.on { background: var(--grad-sunset); flex: 1.6; }
#onboarding .ob-actions { display: flex; justify-content: space-between; align-items: center; }
#onboarding .skip { background: none; border: none; color: #7FA19B; font-family: var(--font); font-size: 14px; cursor: pointer; padding: 8px; }
#onboarding .skip:hover { color: #fff; }

/* ---------- Modal sheet premium ---------- */
.modal {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: rgba(8,28,26,.52);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  align-items: flex-end; justify-content: center;
}
.modal.show { display: flex; }
.modal .sheet {
  background: var(--bg); width: 100%; max-width: 430px;
  border-radius: 30px 30px 0 0; max-height: 88vh; overflow-y: auto;
  padding: 10px 18px 34px;
  box-shadow: 0 -20px 60px rgba(6,44,40,.3);
  animation: sheetUp .42s var(--ease-spring);
}
@keyframes sheetUp { from { transform: translateY(80px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal .grab { width: 44px; height: 5px; border-radius: 99px; background: rgba(16,46,43,.16); margin: 6px auto 14px; }
.modal h3.mt { font-family: var(--font-display); font-size: 20px; letter-spacing: -.025em; margin: 4px 0 3px; }
.modal .msub { font-size: 13px; color: var(--ink-2); margin-bottom: 14px; }

.gal { display: flex; gap: 9px; overflow-x: auto; scrollbar-width: none; margin: 10px 0 4px; border-radius: 16px; }
.gal::-webkit-scrollbar { display: none; }
.gal img {
  width: 220px; height: 148px; object-fit: cover; border-radius: 16px; flex: none;
  background: var(--surface-2); box-shadow: var(--shadow-2);
  scroll-snap-align: start;
}
.gal { scroll-snap-type: x mandatory; }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 12px 0; }
.kv .box {
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow-1);
}
.kv .box small { display: block; color: var(--ink-3); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin-bottom: 2px; }
.kv .box b { font-size: 14.5px; letter-spacing: -.01em; }

.stars { color: var(--sun); font-size: 13px; letter-spacing: 1.5px; }
.stars .off { color: rgba(16,46,43,.14); }

/* ---------- Simulador ---------- */
.sim-note {
  background: linear-gradient(135deg, var(--sun-soft), #FDF8EA);
  border: 1px solid rgba(200,148,46,.2); color: #6B4E0D;
  border-radius: var(--r-md); padding: 12px 14px; font-size: 12.5px; margin-bottom: 12px;
  box-shadow: var(--shadow-1);
}
.slider-row { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--teal); height: 4px; }
.slider-row output { font-weight: 800; color: var(--teal-dark); min-width: 64px; text-align: right; font-size: 13px; font-family: var(--font-display); }

.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.legend .l {
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: 14px; padding: 10px 12px; font-size: 11.5px; color: var(--ink-2);
  box-shadow: var(--shadow-1);
}
.legend .l b { display: block; color: var(--ink); font-size: 12.5px; margin-bottom: 3px; letter-spacing: -.01em; }

/* ---------- Contingencias ---------- */
.cov-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed rgba(16,46,43,.12); }
.cov-item:last-child { border-bottom: none; }
.cov-item .ic {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  display: grid; place-items: center; font-size: 18px;
  box-shadow: var(--shadow-1);
}
.cov-item .ic.ok { background: var(--ok-soft); }
.cov-item .ic.warn { background: var(--warn-soft); }
.cov-item .ic.coral { background: var(--coral-soft); }
.cov-item .ic.teal { background: var(--teal-soft); }
.cov-item b { font-size: 13.5px; display: block; letter-spacing: -.01em; }
.cov-item p { font-size: 12px; color: var(--ink-2); margin-top: 1.5px; }

.sancion-table { width: 100%; border-collapse: separate; border-spacing: 0 7px; font-size: 12px; }
.sancion-table th { text-align: left; color: var(--ink-3); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; padding: 0 9px; }
.sancion-table td {
  background: var(--surface); padding: 10px 9px;
  border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
}
.sancion-table td:first-child { border-left: 1px solid var(--hair); border-radius: 12px 0 0 12px; font-weight: 700; white-space: nowrap; }
.sancion-table td:last-child { border-right: 1px solid var(--hair); border-radius: 0 12px 12px 0; }

/* ---------- Perfil ---------- */
.profile-head { text-align: center; padding: 10px 0 6px; }
.profile-head img.bigav {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 3.5px solid #fff; box-shadow: var(--shadow-3);
}
.profile-head h3 { font-family: var(--font-display); font-size: 19px; letter-spacing: -.02em; }
.verif-list .row { margin-bottom: 8px; }
.verif-list .row .ph {
  width: 40px; height: 40px; border-radius: 13px; font-size: 17px;
  display: grid; place-items: center; background: var(--teal-soft); box-shadow: none;
}

/* ---------- Campanita ---------- */
.bell {
  position: relative; border: none; background: var(--surface);
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
  box-shadow: inset 0 0 0 1.5px var(--hair), var(--shadow-1);
  transition: color .2s, transform .18s var(--ease-spring);
}
.bell:hover { color: var(--teal-dark); }
.bell:active { transform: scale(.92); }
.bell svg { width: 20px; height: 20px; }
.bell-badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--grad-sunset); color: var(--ink); font-size: 10.5px; font-weight: 800;
  border-radius: 99px; min-width: 19px; height: 19px;
  display: grid; place-items: center; padding: 0 5px;
  border: 2px solid var(--bg);
  box-shadow: 0 3px 8px var(--coral-glow);
  animation: badgePop .4s var(--ease-spring);
}
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }

/* ---------- Auth ---------- */
#auth {
  position: fixed; inset: 0; z-index: 110; display: none;
  background:
    radial-gradient(70% 55% at 85% -8%, rgba(43,184,165,.24), transparent 60%),
    radial-gradient(60% 50% at -10% 108%, rgba(255,107,94,.18), transparent 55%),
    linear-gradient(160deg, #0A2422 0%, #0E3733 55%, #0B4A42 100%);
  align-items: center; justify-content: center; padding: 22px; overflow-y: auto;
}
#auth.show { display: flex; }
.auth-card {
  width: 100%; max-width: 402px; background: var(--surface);
  border-radius: 28px; padding: 28px 24px 22px; text-align: center;
  box-shadow: 0 40px 90px rgba(4,26,23,.55);
  border: 1px solid rgba(255,255,255,.5);
  animation: riseIn .5s var(--ease-out);
}
.auth-card .logo { margin: 0 auto 12px; }
.auth-card h2 { font-family: var(--font-display); font-size: 23px; letter-spacing: -.03em; }
.auth-sub { font-size: 13px; color: var(--ink-2); margin: 5px 0 6px; }
.auth-foot { font-size: 11.5px; color: var(--ink-3); margin-top: 13px; }
.auth-err {
  display: none; background: var(--danger-soft); color: var(--danger);
  font-size: 12.5px; font-weight: 650; border-radius: 12px; padding: 10px 13px; margin-top: 10px;
  box-shadow: inset 0 0 0 1px rgba(198,61,47,.18);
}
.auth-err.show { display: block; animation: shakeX .35s ease; }
@keyframes shakeX { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }

/* ---------- Formularios ---------- */
.form { text-align: left; }
.f-row { margin-top: 12px; }
.f-row label {
  display: block; font-size: 11px; font-weight: 800; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .09em; margin-bottom: 6px;
}
.f-row input[type=text], .f-row input[type=email], .f-row input[type=password],
.f-row input[type=date], .f-row select, .f-row textarea {
  width: 100%; border: 1.5px solid var(--hair); border-radius: 13px;
  padding: 12px 14px; font-family: var(--font); font-size: 14.5px; color: var(--ink);
  background: var(--surface); outline: none;
  transition: border-color .18s, box-shadow .18s;
  box-shadow: var(--shadow-1);
}
.f-row input:focus, .f-row select:focus, .f-row textarea:focus {
  border-color: var(--teal); box-shadow: 0 0 0 3.5px rgba(13,148,136,.13);
}
.f-row textarea { resize: vertical; min-height: 66px; }
.f-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.f-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }

.photo-strip { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.photo-strip .ph-item {
  position: relative; width: 88px; height: 64px; border-radius: 12px; overflow: hidden;
  border: 1.5px solid var(--hair); background: var(--surface-2); box-shadow: var(--shadow-1);
}
.photo-strip .ph-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-strip .ph-item .rm {
  position: absolute; top: 4px; right: 4px; width: 21px; height: 21px;
  border-radius: 99px; border: none; background: rgba(10,36,34,.72); color: #fff;
  font-size: 11px; cursor: pointer; display: grid; place-items: center;
  backdrop-filter: blur(4px);
}
.file-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1.5px dashed rgba(13,148,136,.5); color: var(--teal-dark);
  background: var(--teal-soft); padding: 10px 15px; border-radius: 13px;
  font-size: 13px; font-weight: 700; margin-top: 9px;
  transition: all .18s var(--ease-out);
}
.file-btn:hover { background: #D2F2EB; }
.file-btn input { display: none; }
.file-btn.busy { opacity: .55; pointer-events: none; }
.file-btn.on { border-style: solid; border-color: var(--teal); background: #CFF4EC; }

/* ---------- Checklist de perfil ---------- */
.checklist .ck-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 4px; border-bottom: 1px dashed rgba(16,46,43,.1);
  cursor: pointer; border-radius: 8px;
}
.checklist .ck-item:last-child { border-bottom: none; }
.checklist .ck-item .ck-ic {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-size: 15px;
  background: var(--surface-2);
}
.checklist .ck-item.done { cursor: default; opacity: .68; }
.checklist .ck-item.done .ck-ic { background: var(--ok-soft); color: var(--ok); font-weight: 800; }

/* ---------- Social login ---------- */
.soc-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 4px 0 2px; }
.soc-btn {
  border: none; cursor: pointer; width: 100%; aspect-ratio: 1; border-radius: 16px;
  background: var(--c, #999); color: #fff; font-family: var(--font);
  display: grid; place-items: center; position: relative;
  font-size: 17px; font-weight: 800;
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,.28);
  transition: transform .18s var(--ease-spring), box-shadow .18s;
}
.soc-btn span { line-height: 1; }
.soc-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.soc-btn:active { transform: scale(.92); }
.soc-btn:focus-visible { outline: 2.5px solid var(--teal); outline-offset: 2px; }
.soc-btn[title]:not([title=""])::after {
  content: attr(title); position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
  font-size: 8.5px; color: var(--ink-3); font-weight: 700; white-space: nowrap; opacity: 0;
  transition: opacity .15s;
}
.soc-grid { margin-bottom: 20px; }
.soc-btn:hover::after { opacity: 1; }

/* ---------- Notificaciones ---------- */
.notif-item { display: flex; gap: 12px; padding: 12px 2px; border-bottom: 1px dashed rgba(16,46,43,.12); align-items: flex-start; }
.notif-item:last-child { border-bottom: none; }
.notif-item .dot {
  width: 9px; height: 9px; border-radius: 99px; background: var(--grad-sunset);
  flex: none; margin-top: 6px; box-shadow: 0 0 0 3px rgba(255,107,94,.15);
}
.notif-item.read .dot { background: rgba(16,46,43,.15); box-shadow: none; }
.notif-item p { font-size: 13px; letter-spacing: -.005em; }
.notif-item small { color: var(--ink-3); font-size: 11px; font-weight: 500; }
.notif-empty { text-align: center; color: var(--ink-3); padding: 26px 0; font-size: 13px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%) translateY(24px) scale(.95);
  background: #0A2422; color: #fff; font-size: 13.5px; font-weight: 600;
  border-radius: 16px; padding: 12px 19px; opacity: 0; pointer-events: none;
  transition: all .34s var(--ease-spring); z-index: 120; max-width: 86%;
  box-shadow: 0 16px 40px rgba(6,44,40,.4);
  text-align: center; border: 1px solid rgba(255,255,255,.14);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }

/* ---------- Empty / skeleton / utilidades ---------- */
.empty { text-align: center; color: var(--ink-3); font-size: 13px; padding: 30px 12px; }
.empty .big { font-size: 36px; display: block; margin-bottom: 8px; filter: saturate(.85); }
img.lzy {
  background: linear-gradient(100deg, #ECEBE4 40%, #F7F6F0 50%, #ECEBE4 60%);
  background-size: 220% 100%; animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }

.footer-note { text-align: center; color: var(--ink-3); font-size: 11px; padding: 10px 0 4px; letter-spacing: .02em; }
.mode-banner {
  background: linear-gradient(135deg, var(--teal-soft), #E8F8F3);
  color: var(--teal-dark); font-size: 12px; font-weight: 650; text-align: center;
  padding: 9px 13px; border-radius: 14px; margin: 4px 2px 14px;
  border: 1px solid rgba(13,148,136,.15);
}
.mode-banner.warn {
  background: linear-gradient(135deg, var(--warn-soft), #FCF4E3);
  color: var(--warn); border-color: rgba(180,83,9,.15);
}

.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex .grow { flex: 1; min-width: 0; }

/* accesibilidad: respetar motion reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- PASE DE MADUREZ 15/11 — plan features, sheet-x, tabular-nums ---------- */
.plan-features { display: grid; gap: 7px; margin: 10px 0 2px; }
.plan-features .pf {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-2); font-weight: 550;
  background: rgba(13,148,136,.05); border: 1px solid rgba(13,148,136,.10);
  padding: 8px 11px; border-radius: 12px;
}
.plan-on { border: 2px solid var(--teal); box-shadow: 0 8px 26px rgba(13,148,136,.16); position: relative; }
.plan-on::after {
  content: 'TU PLAN'; position: absolute; top: -9px; right: 14px;
  background: var(--teal); color: #fff; font-size: 9.5px; font-weight: 800;
  letter-spacing: .1em; padding: 3px 9px; border-radius: 99px;
}
.sheet-x {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  width: 34px; height: 34px; border-radius: 99px; border: 1px solid var(--hair);
  background: rgba(255,255,255,.75); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--ink-2); font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s var(--ease-out), background .18s;
}
.sheet-x:hover { background: #fff; transform: scale(1.06); }
.sheet-x:focus-visible { outline: 2.5px solid var(--teal); outline-offset: 2px; }
.sheet { position: relative; }
/* numerales tabulares en TODA cifra (punto 9) */
.legend b, .stat b, .plan-features .pf, .msub b, .badge, .stars,
.rep-chip, [class*="precio"], .sim-note, .mode-banner { font-variant-numeric: tabular-nums; }
.red-apicus {
  margin: 18px 6px 8px; padding: 14px 16px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(13,148,136,.07), rgba(255,194,75,.08));
  border: 1px solid rgba(13,148,136,.14);
}
.red-apicus h4 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.red-apicus .ra-links { display: flex; flex-wrap: wrap; gap: 7px; }
.red-apicus .ra-links a {
  font-size: 12px; font-weight: 650; color: var(--teal-deep, #0D9488); text-decoration: none;
  background: rgba(255,255,255,.6); border: 1px solid rgba(13,148,136,.18);
  padding: 6px 11px; border-radius: 99px; transition: transform .18s var(--ease-out), background .18s;
}
.red-apicus .ra-links a:hover { background: #fff; transform: translateY(-2px); }

/* ---------- pase de madurez 15/11: sheet ✕, planes, vacíos ilustrados ---------- */
.sheet-x {
  position: absolute; top: 10px; right: 12px; z-index: 5;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--hair); background: rgba(255,255,255,.85);
  color: var(--ink-2); font-size: 14px; cursor: pointer;
  display: grid; place-items: center; transition: background .18s var(--ease-out);
}
.sheet-x:hover { background: #fff; color: var(--ink); }
.sheet { position: relative; }
.modal { position: fixed; inset: 0; z-index: 90; }
.empty-art { width: 120px; height: 72px; display: block; margin: 4px auto 8px; }
.empty-txt { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.plan-orb {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  display: grid; place-items: center; font-size: 19px; color: var(--teal-deep);
  background: var(--teal-soft); border: 1.5px solid rgba(13,148,136,.25);
}
.plan-features { margin-top: 8px; }
.plan-features .pf { font-size: 12.5px; color: var(--ink-2); padding: 3px 0; }
.border-pro { border: 1.5px solid rgba(242,179,61,.55); background: var(--sun-soft); }

/* ============================================================
   OLA P1 (17/11) — hero animada, momento firma FIRME, a11y focus
   ============================================================ */

/* --- escena hero del ingreso (viajero nuevo): casa -> anillo --- */
.hero-auth { margin: 2px auto 10px; max-width: 300px; }
.hero-scene { width: 100%; height: auto; display: block; }
.hs-house { animation: hs-float 5s ease-in-out infinite; transform-origin: 54px 78px; }
.hs-trail { animation: hs-dash 2.8s linear infinite; }
.hs-plane { animation: hs-fly 6s ease-in-out infinite; }
.hs-ring { animation: hs-spin 30s linear infinite; transform-origin: 230px 66px; }
.hs-coin { animation: hs-orbit 13s linear infinite; transform-origin: 230px 66px; }
.hs-n1 { animation: hs-pulse 2.8s ease-in-out infinite; transform-origin: 230px 20px; }
.hs-n2 { animation: hs-pulse 2.8s ease-in-out .9s infinite; transform-origin: 190px 92px; }
.hs-n3 { animation: hs-pulse 2.8s ease-in-out 1.8s infinite; transform-origin: 270px 92px; }
@keyframes hs-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes hs-dash { to { stroke-dashoffset: -33; } }
@keyframes hs-fly { 0%,100% { transform: translate(0,0) rotate(0deg); } 50% { transform: translate(7px,-6px) rotate(6deg); } }
@keyframes hs-spin { to { transform: rotate(360deg); } }
@keyframes hs-orbit { to { transform: rotate(360deg); } }
@keyframes hs-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.22); } }

/* --- momento firma: el sello del ANILLO FIRME --- */
.firme-moment {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--ok-soft); border: 1.5px solid #B7E4C0; border-radius: 16px;
}
.firme-seal { width: 74px; height: 74px; flex: none; display: block; background: var(--teal-deep); border-radius: 50%; }
.firme-seal .fs-ring { animation: fs-draw 1.1s cubic-bezier(.65,0,.35,1) both; stroke-dasharray: 252; stroke-dashoffset: 252; }
.firme-seal .fs-tri { animation: fs-fade .5s .7s ease-out both; opacity: 0; }
.firme-seal .fs-n1 { animation: fs-pop .45s .9s cubic-bezier(.34,1.56,.64,1) both; transform-origin: 52px 12px; }
.firme-seal .fs-n2 { animation: fs-pop .45s 1.05s cubic-bezier(.34,1.56,.64,1) both; transform-origin: 17.4px 72px; }
.firme-seal .fs-n3 { animation: fs-pop .45s 1.2s cubic-bezier(.34,1.56,.64,1) both; transform-origin: 86.6px 72px; }
.firme-seal .fs-check { animation: fs-draw .6s 1.25s cubic-bezier(.65,0,.35,1) both; stroke-dasharray: 56; stroke-dashoffset: 56; }
.firme-txt b { display: block; color: #14532D; font-size: 15px; letter-spacing: .3px; }
.firme-txt span { font-size: 12.5px; color: #14532D; opacity: .85; line-height: 1.45; }
@keyframes fs-draw { to { stroke-dashoffset: 0; } }
@keyframes fs-fade { to { opacity: .85; } }
@keyframes fs-pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }

/* --- escena hero del admin (tipo de usuario interno) --- */
.admin-hero { margin: 0 0 10px; }
.admin-hero svg { width: 150px; height: 64px; display: block; }
.ah-shield { animation: hs-pulse 3.2s ease-in-out infinite; transform-origin: 30px 28px; }
.ah-b1 { animation: ah-grow 2.4s ease-in-out infinite; transform-origin: 70px 48px; }
.ah-b2 { animation: ah-grow 2.4s .3s ease-in-out infinite; transform-origin: 84px 48px; }
.ah-b3 { animation: ah-grow 2.4s .6s ease-in-out infinite; transform-origin: 98px 48px; }
.ah-scan { animation: hs-dash 2.2s linear infinite; }
@keyframes ah-grow { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(.55); } }

/* --- a11y A3 (GATE-ACCESIBILIDAD): focus-visible en TODO lo clicable --- */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible, .tab:focus-visible, .chip:focus-visible {
  outline: 2.5px solid var(--teal); outline-offset: 2px; border-radius: 8px;
}

/* --- hero y firma se apagan con reduced-motion (punto 14) --- */
@media (prefers-reduced-motion: reduce) {
  .hs-house, .hs-trail, .hs-plane, .hs-ring, .hs-coin, .hs-n1, .hs-n2, .hs-n3,
  .ah-shield, .ah-b1, .ah-b2, .ah-b3, .ah-scan { animation: none; }
  .firme-seal .fs-ring { stroke-dashoffset: 0; animation: none; }
  .firme-seal .fs-tri { opacity: .85; animation: none; }
  .firme-seal .fs-n1, .firme-seal .fs-n2, .firme-seal .fs-n3 { animation: none; }
  .firme-seal .fs-check { stroke-dashoffset: 0; animation: none; }
}

/* ---------- Auxilio (regla 24 SS7, C1): flotante discreto ---------- */
.btn-auxilio {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  right: max(16px, env(safe-area-inset-right));
  z-index: 60;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(12, 14, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f4f6ff;
  font-weight: 700; font-size: 0.9rem;
  text-decoration: none;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s var(--ease, ease-out);
}
.btn-auxilio:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) {
  .btn-auxilio { transition: none !important; }
}
