/* =========================================================================
   Mano a Mano · Sistema visual "Opción B — Confianza moderna"
   Sobrio, inspirado en Apple: aire, tipografía grande, vidrio esmerilado,
   movimiento con física de resorte. Respeta prefers-reduced-motion.
   ========================================================================= */

:root {
  --navy: #0B2540;
  --navy-2: #133A63;
  --green: #0B7A5E;
  --green-2: #0A5C47;
  --mint: #3FD1A5;
  --mint-soft: #E1F3EC;
  --ink: #0B2540;
  --ink-2: #33465E;
  --muted: #51627A;
  --line: #DCE4EE;
  --line-2: #E8EEF5;
  --bg: #F5F7FB;
  --card: #FFFFFF;
  --warn-bg: #FCEBC4; --warn: #6B4A00;
  --bad-bg: #F9DAD4; --bad: #7A2A18;
  --ok-bg: #DDF3EA; --ok: #0A5C47;
  --info-bg: #E2ECF8; --info: #1D4F86;
  --muted-bg: #EDF0F4; --muted-fg: #4A5A6E;

  --r-sm: 10px; --r: 16px; --r-lg: 24px; --r-xl: 32px;
  --shadow-1: 0 1px 2px rgba(11,37,64,.06), 0 1px 1px rgba(11,37,64,.04);
  --shadow-2: 0 10px 30px -12px rgba(11,37,64,.25), 0 2px 6px rgba(11,37,64,.06);
  --shadow-3: 0 30px 60px -20px rgba(11,37,64,.35), 0 8px 20px -8px rgba(11,37,64,.15);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

  /* Curvas de movimiento */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --spring: linear(0, .006, .025 2.8%, .101 6.1%, .539 18.9%, .721 25.3%, .849 31.5%, .937 38.1%, .968 41.8%, .991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.9%, 1);
  --spring-bouncy: linear(0, .009, .035 2.1%, .141, .281 6.7%, .723 12.9%, .938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .974 53.8%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1);
  --t-fast: 180ms; --t: 320ms; --t-slow: 650ms;

  --nav-h: 64px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=submit]):not([type=button]), textarea { cursor: text; caret-color: var(--ink); }
select { cursor: pointer; }
input[type=checkbox], input[type=radio], input[type=file], input[type=range] { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.025em; line-height: 1.1; font-weight: 700; }
p { margin: 0; }
::selection { background: var(--mint); color: var(--navy); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--mint) 70%, white); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 10px; transition: top var(--t) var(--ease-out); }
.skip:focus { top: 12px; }

/* ---------- Transiciones entre páginas (View Transitions API) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 260ms var(--ease-in-out) both; }
::view-transition-new(root) { animation: vt-in 420ms var(--ease-out) both; }
::view-transition-group(*) { animation-duration: 520ms; animation-timing-function: var(--ease-out); }
@keyframes vt-out { to { opacity: 0; transform: scale(.985); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px) scale(1.01); filter: blur(6px); } }
.app-nav { view-transition-name: chrome; }
.tabbar { view-transition-name: chrome-tabs; }
::view-transition-group(chrome), ::view-transition-group(chrome-tabs) { animation: none; }

/* ---------- Layout ---------- */
.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }
.wrap-narrow { width: min(760px, 100% - 40px); margin-inline: auto; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: var(--gap, 20px); grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
@media (max-width: 960px) { .grid { --cols: 2 !important; } }
@media (max-width: 620px) { .grid { --cols: 1 !important; } .grid > * { grid-column: auto !important; } }
.grid > *, .detail-grid > * { min-width: 0; }
.section { padding: clamp(56px, 9vw, 120px) 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.hide-mobile { } @media (max-width: 760px) { .hide-mobile { display: none !important; } }
.only-mobile { display: none; } @media (max-width: 760px) { .only-mobile { display: initial; } }

/* ---------- Tipografía ---------- */
.eyebrow { width: fit-content; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--green-2); background: var(--mint-soft); padding: 7px 14px; border-radius: 999px; }
.display { font-size: clamp(40px, 6.2vw, 80px); letter-spacing: -0.045em; line-height: .98; font-weight: 800; }
.h1 { font-size: clamp(34px, 5vw, 56px); letter-spacing: -0.04em; font-weight: 800; }
.h2 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.035em; font-weight: 800; }
.h3 { font-size: 22px; letter-spacing: -0.02em; font-weight: 750; }
.lead { font-size: clamp(18px, 2vw, 21px); line-height: 1.55; color: var(--muted); }
.gradient-text { background: linear-gradient(100deg, var(--navy) 10%, var(--green) 55%, #1FA883 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Botones ---------- */
.btn {
  --bg-btn: var(--navy); --fg-btn: #fff;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--bg-btn); color: var(--fg-btn); font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
  transition: transform var(--t) var(--spring), box-shadow var(--t) var(--ease-out), background var(--t) var(--ease-out), opacity var(--t);
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--bg-btn) 70%, transparent);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn::after { /* halo que sigue al puntero */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity var(--t);
  background: radial-gradient(160px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.28), transparent 60%);
}
.btn:hover::after { opacity: 1; }
.btn:hover { box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--bg-btn) 80%, transparent); }
.btn:active { transform: scale(.965); transition-duration: 90ms; }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .ico { width: 20px; height: 20px; transition: transform var(--t) var(--spring); }
.btn:hover .ico-arrow { transform: translateX(4px); }
.btn-green { --bg-btn: var(--green); }
.btn-mint { --bg-btn: var(--mint); --fg-btn: var(--navy); }
.btn-ghost { --bg-btn: transparent; --fg-btn: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink-2); background: rgba(11,37,64,.03); }
.btn-ghost::after { background: radial-gradient(160px circle at var(--mx, 50%) var(--my, 50%), rgba(11,37,64,.06), transparent 60%); }
.btn-white { --bg-btn: #fff; --fg-btn: var(--navy); }
.btn-outline-light { --bg-btn: transparent; --fg-btn: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.6); }
.btn-danger { --bg-btn: #A3341F; }
.btn-lg { min-height: 58px; padding: 0 30px; font-size: 17px; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; gap: 6px; }
.btn-sm .ico { width: 16px; height: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; min-height: 44px; padding: 0; border-radius: 14px; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::before { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--fg-btn) 35%, transparent); border-top-color: var(--fg-btn); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { color: var(--green); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Íconos ---------- */
.ico { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-badge { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--mint-soft); color: var(--green); flex: none; }
.ico-badge.navy { background: var(--navy); color: var(--mint); }
.ico-badge.soft { background: #EEF3F9; color: var(--navy); }

/* ---------- Navegación pública (vidrio esmerilado) ---------- */
.app-nav {
  position: sticky; top: 0; z-index: 40; height: var(--nav-h);
  background: color-mix(in srgb, white 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  transition: box-shadow var(--t), background var(--t);
}
.app-nav.scrolled { box-shadow: 0 8px 30px -18px rgba(11,37,64,.35); background: color-mix(in srgb, white 84%, transparent); }
.app-nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--navy); display: grid; place-items: center; transition: transform var(--t-slow) var(--spring-bouncy); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-mark svg { width: 17px; height: 17px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--ink-2); transition: background var(--t-fast), color var(--t-fast); }
.nav-links a:hover { background: rgba(11,37,64,.05); color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); background: rgba(11,37,64,.06); }
@media (max-width: 860px) { .nav-links { display: none; } }

/* ---------- Barra inferior móvil con indicador deslizante ---------- */
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 45;
  display: none; grid-template-columns: repeat(var(--n, 4), 1fr); padding: 6px; border-radius: 24px;
  background: color-mix(in srgb, white 78%, transparent); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  box-shadow: var(--shadow-3), inset 0 0 0 1px rgba(255,255,255,.6); border: 1px solid var(--line);
}
@media (max-width: 760px) { .tabbar { display: grid; } body.has-tabbar { padding-bottom: 96px; } }
.tabbar a { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: 11px; font-weight: 700; color: var(--muted); border-radius: 18px; transition: color var(--t), transform var(--t-fast) var(--spring); }
.tabbar a:active { transform: scale(.92); }
.tabbar a[aria-current="page"] { color: var(--green); }
.tabbar .ico { width: 24px; height: 24px; transition: transform var(--t) var(--spring-bouncy); }
.tabbar a[aria-current="page"] .ico { transform: translateY(-1px) scale(1.08); }
.tabbar .pill { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / var(--n, 4)); border-radius: 18px; background: var(--mint-soft); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform 520ms var(--spring-bouncy); }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card-pad { padding: clamp(18px, 2.4vw, 28px); }
.card-hover { transition: transform var(--t) var(--spring), box-shadow var(--t) var(--ease-out), border-color var(--t); transform-style: preserve-3d; will-change: transform; }
.card-hover:hover { box-shadow: var(--shadow-3); border-color: transparent; }
.card-hover:active { transform: scale(.985); }
.glass { background: color-mix(in srgb, white 70%, transparent); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); border: 1px solid rgba(255,255,255,.6); }
.divider { height: 1px; background: var(--line-2); border: 0; margin: 0; }

/* ---------- Portadas generativas (sin fotos todavía) ---------- */
.cover { position: relative; overflow: hidden; border-radius: var(--r); background: var(--navy); isolation: isolate; }
.cover::before, .cover::after { content: ""; position: absolute; inset: -30%; z-index: -1; filter: blur(30px); animation: drift 18s ease-in-out infinite alternate; }
.cover::after { animation-duration: 24s; animation-direction: alternate-reverse; mix-blend-mode: screen; opacity: .85; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-mini { width: 64px; height: 64px; border-radius: 16px; flex: none; }
.cover .cover-grain { position: absolute; inset: 0; opacity: .14; mix-blend-mode: overlay; background-image: radial-gradient(rgba(255,255,255,.7) .6px, transparent .7px); background-size: 3px 3px; }
@keyframes drift { 0% { transform: translate3d(-4%, -3%, 0) rotate(0deg) scale(1); } 100% { transform: translate3d(5%, 4%, 0) rotate(14deg) scale(1.12); } }
.cover[data-tone="ocean"]::before { background: radial-gradient(40% 50% at 25% 30%, #1F8F7A, transparent 70%), radial-gradient(45% 55% at 80% 70%, #14466F, transparent 70%), linear-gradient(140deg, #0B2540, #0B5E6E); }
.cover[data-tone="ocean"]::after { background: radial-gradient(30% 35% at 70% 25%, #3FD1A5, transparent 70%), radial-gradient(25% 30% at 30% 80%, #2A6FB0, transparent 70%); }
.cover[data-tone="forest"]::before { background: radial-gradient(45% 50% at 30% 35%, #2A8F5E, transparent 70%), radial-gradient(40% 50% at 75% 75%, #0E3B2E, transparent 70%), linear-gradient(140deg, #0C3A2C, #1D6B4F); }
.cover[data-tone="forest"]::after { background: radial-gradient(30% 35% at 65% 30%, #9BE2B8, transparent 70%), radial-gradient(25% 30% at 25% 75%, #3FD1A5, transparent 70%); }
.cover[data-tone="dusk"]::before { background: radial-gradient(45% 50% at 30% 30%, #4C7FB8, transparent 70%), radial-gradient(40% 50% at 75% 70%, #0B2540, transparent 70%), linear-gradient(140deg, #13294B, #34557F); }
.cover[data-tone="dusk"]::after { background: radial-gradient(30% 35% at 70% 30%, #A9C8F0, transparent 70%), radial-gradient(25% 30% at 30% 80%, #5C8FD0, transparent 70%); }
.cover[data-tone="sand"]::before { background: radial-gradient(45% 50% at 30% 35%, #D9A15F, transparent 70%), radial-gradient(40% 50% at 75% 70%, #7A4A22, transparent 70%), linear-gradient(140deg, #4D3320, #A5703F); }
.cover[data-tone="sand"]::after { background: radial-gradient(30% 35% at 65% 30%, #F6D9A8, transparent 70%), radial-gradient(25% 30% at 25% 75%, #E7B172, transparent 70%); }
.cover[data-tone="mint"]::before { background: radial-gradient(45% 50% at 30% 35%, #3FD1A5, transparent 70%), radial-gradient(40% 50% at 75% 70%, #0B7A5E, transparent 70%), linear-gradient(140deg, #0F5A4A, #1E9E7E); }
.cover[data-tone="mint"]::after { background: radial-gradient(30% 35% at 65% 30%, #D2F7EA, transparent 70%), radial-gradient(25% 30% at 25% 75%, #7FE3C3, transparent 70%); }

/* ---------- Progreso ---------- */
.progress { height: 10px; border-radius: 999px; background: #E3EAF2; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--green), #1FA883); position: relative; transition: width 1.2s var(--spring); }
.progress > i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transform: translateX(-100%); animation: shine 2.6s 1.2s ease-in-out infinite; }
.progress.in > i, .no-js .progress > i { width: var(--p); }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }
.ring { --size: 132px; --stroke: 12px; position: relative; width: var(--size); height: var(--size); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: var(--stroke); stroke-linecap: round; }
.ring .track { stroke: #E3EAF2; }
.ring .bar { stroke: url(#ringGrad); stroke-dasharray: var(--c); stroke-dashoffset: var(--c); transition: stroke-dashoffset 1.6s var(--spring); }
.ring.in .bar { stroke-dashoffset: calc(var(--c) * (1 - var(--p) / 100)); }
.ring .ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }

/* ---------- Revelado al hacer scroll ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); filter: blur(6px); transition: opacity 800ms var(--ease-out), transform 900ms var(--spring), filter 800ms var(--ease-out); transition-delay: calc(var(--d, 0) * 70ms); }
.js [data-reveal="scale"] { transform: scale(.94); }
.js [data-reveal="left"] { transform: translateX(-28px); }
.js [data-reveal].in { opacity: 1; transform: none; filter: none; }
.split-word { display: inline-block; overflow: hidden; vertical-align: bottom; padding: .12em 0 .24em; margin: -.12em 0 -.24em; }
.split-word > span { display: inline-block; transform: translateY(105%); transition: transform 1s var(--spring); transition-delay: calc(var(--w) * 60ms + 120ms); }
.split.in .split-word > span, .no-js .split-word > span { transform: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 9vw, 120px) 0 clamp(40px, 6vw, 80px); }
.hero-orbs { position: absolute; inset: 0; z-index: -1; pointer-events: none; transform: translate3d(0, calc(var(--sy, 0) * 0.25px), 0); -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 98%); mask-image: linear-gradient(to bottom, #000 55%, transparent 98%); }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: float 16s ease-in-out infinite alternate; }
.orb.o1 { width: 520px; height: 520px; background: #BFEFDD; top: -160px; right: -120px; }
.orb.o2 { width: 420px; height: 420px; background: #CFE0F5; bottom: -180px; left: -120px; animation-duration: 20s; }
.orb.o3 { width: 260px; height: 260px; background: #E6F7F0; top: 40%; left: 45%; animation-duration: 13s; }
@keyframes float { to { transform: translate3d(40px, 30px, 0) scale(1.08); } }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-card { padding: 14px; border-radius: var(--r-xl); transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 600ms var(--spring); }
.hero-card .cover { height: clamp(220px, 28vw, 300px); border-radius: 22px; }
.float-chip { position: absolute; display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; font-size: 14px; font-weight: 700; box-shadow: var(--shadow-2); animation: bob 5s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* ---------- Chips / filtros ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 650; color: var(--ink-2); cursor: pointer; transition: background var(--t), color var(--t), border-color var(--t), transform var(--t-fast) var(--spring); }
.chip:hover { border-color: var(--ink-2); }
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"], .chip.on { background: var(--navy); border-color: var(--navy); color: #fff; animation: pop 380ms var(--spring-bouncy); }
@keyframes pop { 0% { transform: scale(.92); } 100% { transform: scale(1); } }

/* ---------- Tarjeta de proyecto ---------- */
.pcard { display: flex; flex-direction: column; overflow: hidden; }
.pcard .cover { height: 190px; border-radius: calc(var(--r-lg) - 6px); margin: 6px 6px 0; }
.pcard .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.pcard .cat { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--green-2); }
.pcard h3 { font-size: 20px; line-height: 1.2; }
.pcard .meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.pcard .meta b { color: var(--ink); font-size: 16px; }
.pcard .go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--green); font-size: 15px; }
.pcard:hover .go .ico { transform: translateX(4px); }
.pcard .go .ico { width: 18px; height: 18px; transition: transform var(--t) var(--spring); }
.badge-float { position: absolute; left: 14px; top: 14px; z-index: 2; background: rgba(255,255,255,.92); color: var(--navy); font-size: 12px; font-weight: 800; padding: 6px 11px; border-radius: 999px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: 13px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: 13px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-size: 16px;
  transition: border-color var(--t-fast), box-shadow var(--t), background var(--t);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: #C3D0DF; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mint) 30%, transparent); }
.input[aria-invalid="true"] { border-color: #C0472F; box-shadow: 0 0 0 4px rgba(192,71,47,.12); }
.input-sm { min-height: 40px; padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.field-error { font-size: 13px; color: #A3341F; font-weight: 600; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); line-height: 1.45; cursor: pointer; }
.check input { appearance: none; width: 22px; height: 22px; flex: none; margin: 0; border-radius: 7px; border: 1.8px solid var(--ink-2); display: grid; place-items: center; cursor: pointer; transition: background var(--t), border-color var(--t); }
.check input::after { content: ""; width: 11px; height: 6px; border-left: 2.4px solid #fff; border-bottom: 2.4px solid #fff; transform: rotate(-45deg) scale(0); transition: transform 360ms var(--spring-bouncy); margin-top: -3px; }
.check input:checked { background: var(--green); border-color: var(--green); }
.check input:checked::after { transform: rotate(-45deg) scale(1); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { appearance: none; position: absolute; inset: 0; margin: 0; border-radius: 999px; background: #CBD5E1; cursor: pointer; transition: background var(--t); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform 420ms var(--spring-bouncy); }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(20px); }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

/* Montos */
.amounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.amount { position: relative; }
.amount input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.amount span { display: grid; place-items: center; min-height: 64px; border-radius: 18px; border: 1.5px solid var(--line); background: #fff; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; transition: all var(--t) var(--spring); }
.amount input:checked + span { border-color: var(--green); background: var(--mint-soft); color: var(--green-2); transform: scale(1.03); box-shadow: 0 10px 24px -14px var(--green); }
.amount input:focus-visible + span { outline: 3px solid var(--mint); outline-offset: 2px; }
.amount-display { font-size: clamp(44px, 9vw, 64px); font-weight: 800; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- Pasos ---------- */
.steps { display: flex; gap: 8px; }
.steps .s { flex: 1; height: 5px; border-radius: 999px; background: #E3EAF2; overflow: hidden; }
.steps .s > i { display: block; height: 100%; width: 0; background: var(--green); border-radius: inherit; transition: width 600ms var(--spring); }
.steps .s.done > i, .steps .s.on > i { width: 100%; }
.step-panel { display: none; }
.step-panel.on { display: block; animation: step-in 520ms var(--spring) both; }
.step-panel.on.back { animation-name: step-in-back; }
@keyframes step-in { from { opacity: 0; transform: translateX(36px); } }
@keyframes step-in-back { from { opacity: 0; transform: translateX(-36px); } }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; display: flex; gap: 16px; padding-bottom: 22px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 17px; top: 38px; bottom: 2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li.done::before { background: var(--green); }
.tl-dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; background: #E9EEF5; color: var(--muted); position: relative; z-index: 1; }
.timeline li.done .tl-dot { background: var(--green); color: #fff; }
.timeline li.current .tl-dot { background: var(--navy); color: #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--navy) 14%, transparent); animation: pulse 2.2s ease-in-out infinite; }
.tl-dot .ico { width: 18px; height: 18px; stroke-width: 2.6; }
@keyframes pulse { 50% { box-shadow: 0 0 0 11px color-mix(in srgb, var(--navy) 5%, transparent); } }

/* ---------- Estado / insignias ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 750; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.warn { background: var(--warn-bg); color: var(--warn); }
.status.bad { background: var(--bad-bg); color: var(--bad); }
.status.info { background: var(--info-bg); color: var(--info); }
.status.muted { background: var(--muted-bg); color: var(--muted-fg); }
.status.warn::before { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }
.count-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--warn-bg); color: var(--warn); }

/* ---------- Avisos / toasts ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: 14px; line-height: 1.45; background: var(--info-bg); color: var(--info); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice .ico { width: 20px; height: 20px; margin-top: 1px; }
.toasts { position: fixed; z-index: 90; top: calc(var(--nav-h) + 12px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(440px, 100% - 24px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--navy); color: #fff; font-size: 15px; font-weight: 600; box-shadow: var(--shadow-3); animation: toast-in 600ms var(--spring-bouncy) both; }
.toast.ok .ico { color: var(--mint); } .toast.bad { background: #7A2A18; }
.toast.out { animation: toast-out 300ms var(--ease-in-out) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-20px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-12px) scale(.97); } }

/* ---------- Esqueletos ---------- */
.skeleton { border-radius: 10px; background: linear-gradient(90deg, #EDF1F6 25%, #F7F9FC 50%, #EDF1F6 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r); position: relative; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 750; color: var(--muted); padding: 12px 14px; background: #F6F8FB; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: #F8FAFD; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table a.rowlink { font-weight: 700; }
.empty { display: grid; place-items: center; gap: 10px; text-align: center; padding: 48px 20px; color: var(--muted); width: 100%; min-width: 0; box-sizing: border-box; }
.empty > b, .empty > span { display: block; max-width: 100%; overflow-wrap: anywhere; white-space: normal; text-wrap: balance; }
.empty .ico-badge { width: 60px; height: 60px; border-radius: 20px; }

/* ---------- KPI ---------- */
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi .k-label { font-size: 13px; font-weight: 650; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi .k-label .ico { width: 18px; height: 18px; color: var(--green); }
.kpi .k-value { font-size: clamp(24px, 2.4vw, 30px); font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--muted); }
.kpi .k-sub.up { color: var(--ok); font-weight: 700; }

/* ---------- Gráficos (SVG animado) ---------- */
.chart { width: 100%; height: 220px; overflow: visible; }
.chart .grid-line { stroke: #EEF2F7; }
.chart .axis { font-size: 11px; fill: var(--muted); }
.chart .line { fill: none; stroke: var(--green); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); transition: stroke-dashoffset 1.8s var(--ease-out); }
.chart .area { fill: url(#areaGrad); opacity: 0; transition: opacity 1s .6s; }
.chart.in .line { stroke-dashoffset: 0; } .chart.in .area { opacity: 1; }
.chart .bar { fill: var(--green); transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); transition: transform 900ms var(--spring); transition-delay: calc(var(--i) * 30ms); }
.chart.in .bar { transform: scaleY(1); }
.chart .bar:hover { fill: var(--navy); }
.hbar { height: 8px; border-radius: 99px; background: #E3EAF2; overflow: hidden; }
.hbar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c, var(--green)); transition: width 1.1s var(--spring); }
.in .hbar > i, .hbar.in > i { width: var(--p); }

/* ---------- Pie y secciones públicas ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 120px; color: var(--muted); font-size: 14px; }
@media (min-width: 761px) { .site-footer { padding-bottom: 48px; } }
.site-footer a:hover { color: var(--ink); }
.dual { position: relative; overflow: hidden; border-radius: var(--r-xl); background: var(--navy); color: #fff; display: grid; grid-template-columns: 1fr 1fr; }
.dual > div { padding: clamp(28px, 4vw, 48px); display: flex; flex-direction: column; gap: 14px; position: relative; }
.dual > div + div { border-left: 1px solid rgba(255,255,255,.1); }
@media (max-width: 760px) { .dual { grid-template-columns: 1fr; } .dual > div + div { border-left: 0; border-top: 1px solid rgba(255,255,255,.1); } }
.dual .tag { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--mint); }
.dual p { color: #C4D2E3; }
.dual::before { content: ""; position: absolute; width: 480px; height: 480px; right: -140px; top: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(63,209,165,.35), transparent 65%); animation: float 14s ease-in-out infinite alternate; pointer-events: none; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 4px; font-size: 18px; font-weight: 700; letter-spacing: -0.015em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ico { transition: transform var(--t) var(--spring); color: var(--muted); }
.faq details[open] summary .ico { transform: rotate(45deg); }
.faq details > div { padding: 0 4px 22px; color: var(--muted); animation: faq-in 420ms var(--ease-out); }
@keyframes faq-in { from { opacity: 0; transform: translateY(-6px); } }
.step-card { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.step-num { font-size: 13px; font-weight: 800; color: var(--green); letter-spacing: .06em; }

/* ---------- Detalle de proyecto ---------- */
.detail-hero .cover { height: clamp(260px, 42vw, 480px); border-radius: var(--r-xl); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
@media (max-width: 960px) { .detail-grid { grid-template-columns: 1fr; } }
.sticky-card { position: sticky; top: calc(var(--nav-h) + 20px); }

/* Botón "Volver" general (en todas las páginas, salvo inicio y panel principal) */
.nav-start { display: flex; align-items: center; gap: 10px; min-width: 0; }
.back-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  color: var(--navy, #0b2540); background: color-mix(in srgb, white 90%, transparent);
  box-shadow: 0 0 0 1px var(--line), 0 8px 22px -14px rgba(11,37,64,.45);
  transition: transform var(--t-fast) var(--spring), background var(--t);
}
.back-btn:hover { background: #fff; }
.back-btn:active { transform: scale(.92); }
.back-btn:focus-visible { outline: 3px solid var(--mint, #3ecfa5); outline-offset: 3px; }
.back-btn .ico { width: 20px; height: 20px; }
.panel-main > .back-btn { margin-bottom: 14px; }
.back-btn-float { position: fixed; top: 14px; left: 14px; z-index: 50; }

/* Botón "Volver": se queda visible al bajar; al bajar solo queda la flecha */
.back-bar { position: sticky; top: calc(var(--nav-h) + 12px); z-index: 30; width: max-content; margin-bottom: 16px; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 14px;
  border-radius: 999px; color: var(--green); font-weight: 700; text-decoration: none;
  background: color-mix(in srgb, white 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0 0 1px var(--line), 0 10px 26px -16px rgba(11,37,64,.45);
  transition: padding var(--t) var(--spring), gap var(--t) var(--spring), transform var(--t-fast) var(--spring);
}
.back-link:active { transform: scale(.94); }
.back-link .ico { width: 20px; height: 20px; flex: none; }
.back-text { max-width: 140px; overflow: hidden; white-space: nowrap; opacity: 1; transition: max-width 420ms var(--spring), opacity var(--t); }
.back-bar.is-compact .back-link { width: 44px; padding: 0; justify-content: center; gap: 0; }
.back-bar.is-compact .back-text { max-width: 0; opacity: 0; }
.mobile-cta { position: fixed; left: 12px; right: 12px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 84px); z-index: 44; display: none; animation: rise-in 600ms var(--spring-bouncy) both; }
@media (max-width: 960px) { .mobile-cta { display: block; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(30px); } }
.prose { font-size: 17px; line-height: 1.7; color: var(--ink-2); white-space: pre-line; }
.tabs { display: inline-flex; padding: 4px; border-radius: 14px; background: #E9EEF5; position: relative; max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tabs > * { flex: none; white-space: nowrap; }
.tabs button { position: relative; z-index: 1; border: 0; background: none; padding: 9px 16px; border-radius: 11px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; transition: color var(--t); }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs .tab-pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; border-radius: 11px; background: #fff; box-shadow: var(--shadow-1); transition: left 480ms var(--spring-bouncy), width 480ms var(--spring-bouncy); }
.tab-panel[hidden] { display: none; }
.tab-panel { animation: faq-in 420ms var(--ease-out); }

/* ---------- Éxito ---------- */
.success-mark { width: 120px; height: 120px; margin: 0 auto; position: relative; }
.success-mark svg { width: 100%; height: 100%; }
.success-mark .c { fill: none; stroke: var(--green); stroke-width: 5; stroke-dasharray: 340; stroke-dashoffset: 340; animation: draw 900ms var(--ease-out) forwards; }
.success-mark .k { fill: none; stroke: var(--green); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw 500ms 700ms var(--ease-out) forwards; }
.success-mark::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--mint); opacity: 0; animation: burst 900ms 900ms var(--ease-out); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes burst { 0% { opacity: .5; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.8); } }
.particles { position: absolute; inset: 0; pointer-events: none; }
.particles i { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 2px; background: var(--c); opacity: 0; animation: particle 1.1s 950ms var(--ease-out) forwards; }
@keyframes particle { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(0); } 100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)); } }
.pending-orb { width: 96px; height: 96px; margin: 0 auto; border-radius: 50%; background: conic-gradient(from 0deg, var(--mint), var(--green), var(--navy), var(--mint)); animation: spin 2.4s linear infinite; mask: radial-gradient(circle, transparent 54%, #000 56%); -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%); }

/* ---------- Cámara (foto de cédula) ---------- */
.cam { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #0A1220; aspect-ratio: 4 / 3; }
.cam video, .cam canvas.preview, .cam img { width: 100%; height: 100%; object-fit: cover; }
.cam .frame { position: absolute; inset: 14% 8%; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(10,18,32,.55); pointer-events: none; transition: inset 500ms var(--spring); }
.cam .frame::before, .cam .frame::after, .cam .frame i::before, .cam .frame i::after { content: ""; position: absolute; width: 34px; height: 34px; border: 4px solid var(--mint); animation: corner 2s ease-in-out infinite; }
.cam .frame::before { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-radius: 16px 0 0 0; }
.cam .frame::after { right: -2px; top: -2px; border-left: 0; border-bottom: 0; border-radius: 0 16px 0 0; }
.cam .frame i::before { left: -2px; bottom: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 16px; }
.cam .frame i::after { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-radius: 0 0 16px 0; }
@keyframes corner { 50% { opacity: .55; } }
.cam .cam-hint { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: #fff; font-size: 14px; font-weight: 600; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.cam .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam .flash.go { animation: flash 420ms var(--ease-out); }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }
.cam .placeholder { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; color: #C4D2E3; padding: 20px; }
.cam .placeholder .ico { width: 44px; height: 44px; margin: 0 auto; color: var(--mint); }
.cam.has-photo .frame { inset: 0; box-shadow: none; }
.cam.has-photo .frame::before, .cam.has-photo .frame::after, .cam.has-photo .frame i { display: none; }

/* ---------- Pizarra de firma ---------- */
.sigpad { position: relative; border-radius: 20px; background: #fff; border: 2px dashed #9FB3C9; height: 220px; touch-action: none; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: border-color var(--t), box-shadow var(--t); }
.sigpad.active { border-style: solid; border-color: var(--green); box-shadow: 0 0 0 5px color-mix(in srgb, var(--mint) 25%, transparent); }
.sigpad canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.sigpad .baseline { position: absolute; left: 28px; right: 28px; bottom: 54px; border-bottom: 1.5px solid #C9D6E4; pointer-events: none; }
.sigpad .x-mark { position: absolute; left: 30px; bottom: 60px; font-size: 22px; color: #9FB3C9; pointer-events: none; font-weight: 300; }
.sigpad .sig-hint { position: absolute; inset: 0 0 64px 0; display: grid; place-content: center; gap: 8px; text-align: center; color: #7A8BA0; pointer-events: none; transition: opacity var(--t); }
.sigpad .sig-hint .ico { width: 34px; height: 34px; margin: 0 auto; animation: wiggle 2.4s ease-in-out infinite; }
.sigpad.dirty .sig-hint { opacity: 0; }
@keyframes wiggle { 0%, 100% { transform: translateX(0) rotate(0); } 30% { transform: translateX(10px) rotate(8deg); } 60% { transform: translateX(-6px) rotate(-5deg); } }
.sigpad.signed { animation: stamp 700ms var(--spring-bouncy); border-color: var(--green); border-style: solid; }
@keyframes stamp { 0% { transform: scale(1); } 30% { transform: scale(.97); } 100% { transform: scale(1); } }
.contract-doc { max-height: 420px; overflow: auto; padding: 22px 24px; border-radius: 18px; background: #FBFCFE; border: 1px solid var(--line); font-size: 15px; line-height: 1.65; color: var(--ink-2); white-space: pre-line; scroll-behavior: smooth; }
.contract-doc::-webkit-scrollbar { width: 8px; } .contract-doc::-webkit-scrollbar-thumb { background: #D3DCE7; border-radius: 9px; }
.read-progress { height: 3px; border-radius: 9px; background: #E3EAF2; overflow: hidden; } .read-progress i { display: block; height: 100%; width: var(--p, 0%); background: var(--green); transition: width 120ms linear; }

/* ---------- Paneles (trabajador y administración) ---------- */
.panel-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
@media (max-width: 1024px) { .panel-shell { grid-template-columns: 1fr; } }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 14px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 1024px) { .sidebar { display: none; } }
.sidebar .brand { padding: 0 10px 18px; }
.side-sec { font-size: 11px; font-weight: 800; letter-spacing: .09em; color: #8696AB; padding: 16px 12px 6px; }
.side-link { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--ink-2); transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--spring); }
.side-link:hover { background: #F2F5F9; color: var(--ink); }
.side-link:active { transform: scale(.98); }
.side-link .ico { width: 20px; height: 20px; color: #7A8BA0; transition: color var(--t-fast), transform var(--t) var(--spring-bouncy); }
.side-link:hover .ico { transform: scale(1.1); }
.side-link[aria-current="page"] { background: var(--navy); color: #fff; box-shadow: 0 8px 20px -12px var(--navy); }
.side-link[aria-current="page"] .ico { color: var(--mint); }
.side-link .count-badge { margin-left: auto; }
.panel-main { min-width: 0; padding: clamp(18px, 3vw, 36px); display: flex; flex-direction: column; gap: 24px; }
.panel-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.panel-top h1 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.035em; font-weight: 800; }
.mobile-top { display: none; position: sticky; top: 0; z-index: 40; height: 60px; padding: 0 16px; align-items: center; justify-content: space-between; background: color-mix(in srgb, white 80%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
@media (max-width: 1024px) { .mobile-top { display: flex; } }
.hero-panel { position: relative; overflow: hidden; border-radius: var(--r-xl); background: var(--navy); color: #fff; padding: clamp(22px, 3vw, 34px); }
.hero-panel::before { content: ""; position: absolute; width: 420px; height: 420px; right: -120px; top: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(63,209,165,.35), transparent 65%); animation: float 14s ease-in-out infinite alternate; }
.hero-panel > * { position: relative; }
.hero-panel .muted { color: #A9BBD1; }
.drawer-menu { position: fixed; inset: 0; z-index: 80; display: none; }
.drawer-menu.open { display: block; }
.drawer-menu .scrim { position: absolute; inset: 0; background: rgba(11,37,64,.35); animation: fade-in 300ms both; }
.drawer-menu .sheet { position: absolute; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); background: #fff; padding: 20px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; animation: sheet-in 520ms var(--spring) both; box-shadow: var(--shadow-3); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translateX(-100%); } }

/* Kanban de solicitudes */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: #EDF1F6; border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.kcol-h { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 6px; font-size: 14px; font-weight: 800; }
.kcard { display: block; background: #fff; border-radius: 14px; padding: 13px 14px; border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform var(--t) var(--spring), box-shadow var(--t); }
.kcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }

/* Visor protegido de cédula */
.secure-viewer { position: relative; border-radius: 18px; overflow: hidden; background: #0A1220; user-select: none; -webkit-user-select: none; }
.secure-viewer canvas { width: 100%; height: auto; }
.secure-viewer .wm { position: absolute; inset: 0; pointer-events: none; background-image: var(--wm); background-repeat: repeat; opacity: .9; }

/* QR */
.qr-box { width: 168px; height: 168px; padding: 12px; border-radius: 20px; background: #fff; border: 1px solid var(--line); flex: none; transition: transform var(--t) var(--spring); }
.qr-box:hover { transform: scale(1.04) rotate(-1deg); }
.qr-box svg { width: 100%; height: 100%; }
.copy-field { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px; border-radius: 16px; background: #F3F6FA; border: 1px solid var(--line); }
.copy-field code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-family: var(--mono); color: var(--ink-2); }

/* Login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.auth-card { width: min(440px, 100%); padding: clamp(26px, 4vw, 40px); border-radius: var(--r-xl); }

/* Paginación */
.pager { display: flex; gap: 8px; justify-content: flex-end; align-items: center; font-size: 14px; color: var(--muted); }

/* Utilidad de inclinación 3D */
[data-tilt] { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0); transition: transform 500ms var(--spring); }

/* Botón magnético */
[data-magnetic] { transform: translate3d(var(--tx, 0), var(--ty, 0), 0); }
[data-magnetic]:active { transform: translate3d(var(--tx, 0), var(--ty, 0), 0) scale(.965); }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; filter: none; }
  .split-word > span { transform: none; }
  .progress > i { width: var(--p); }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Filas que no deben partirse (título + monto) */
.row-tight { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.row-tight > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-tight > :last-child { flex: none; }

/* Control segmentado (estilo iOS) */
.segmented { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 2px; padding: 4px; border-radius: 14px; background: #E9EEF5; }
.segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 11px; background: transparent; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; transition: background var(--t), color var(--t), box-shadow var(--t), transform var(--t-fast) var(--spring); white-space: nowrap; }
.segmented button .ico { width: 18px; height: 18px; }
.segmented button:active { transform: scale(.96); }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-1), 0 4px 12px -6px rgba(11,37,64,.25); }
@media (max-width: 380px) { .segmented button .ico { display: none; } }

/* ---------- SINPE Móvil ---------- */
.sinpe-card { padding: 4px 20px; border-color: color-mix(in srgb, var(--green) 38%, var(--line)); box-shadow: var(--shadow-2, 0 10px 30px rgba(11,37,64,.08)); }
.sinpe-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.sinpe-row + .sinpe-row { border-top: 1px solid var(--line-2); }
.sinpe-value { display: block; font-size: 22px; letter-spacing: -.01em; margin-top: 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sinpe-code { font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-weight: 800; letter-spacing: .14em; font-size: 17px; }
.proof-img { display: block; max-width: 100%; max-height: 420px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }

/* ------------------------------------------------------------------ Ruleta de premios (3D con CSS) */
.prize-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
@media (max-width: 960px) { .prize-grid { grid-template-columns: 1fr; } }
.prize-notice { text-decoration: none; }
.roulette-card { overflow: hidden; background: radial-gradient(120% 80% at 50% 0%, #F2FBF7 0%, #fff 60%); }
.roulette { position: relative; width: min(100%, 440px); aspect-ratio: 1 / 1.04; margin: 4px auto 0; user-select: none; -webkit-user-select: none; }
.roulette-stage { position: absolute; inset: 0; perspective: 1100px; perspective-origin: 50% 0%; }
.roulette-tilt { position: absolute; inset: 7% 4% 3%; transform-style: preserve-3d; transform: rotateX(24deg); animation: roulette-bob 5s ease-in-out infinite; }
.roulette.spinning .roulette-tilt, .roulette.won .roulette-tilt { animation: none; }
@keyframes roulette-bob { 50% { transform: rotateX(24deg) translateY(-6px); } }
.roulette-rim { position: absolute; inset: 0; transform-style: preserve-3d; }
.roulette-rim span { position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(150deg, #F7DE9C 0%, #C9973B 45%, #7A5418 100%); transform: translateZ(calc(var(--z) * -2.4px)); }
.roulette-rim span:last-child { box-shadow: 0 26px 40px -12px rgba(11, 37, 64, .55); }
.roulette-wheel { position: absolute; inset: 2.6%; border-radius: 50%; overflow: hidden; transform: translateZ(1px) rotate(var(--rot, 0deg)); transition: transform var(--dur, 6s) cubic-bezier(.11, .67, .08, 1); will-change: transform; box-shadow: 0 0 0 3px #0A1F35; }
.roulette-wheel svg { display: block; width: 100%; height: 100%; }
.roulette-wheel text { font-family: inherit; }
.roulette-gloss { position: absolute; inset: 2.6%; border-radius: 50%; transform: translateZ(2px); pointer-events: none; background: radial-gradient(circle at 32% 22%, rgba(255,255,255,.42), rgba(255,255,255,0) 42%), radial-gradient(circle, rgba(0,0,0,0) 62%, rgba(0,0,0,.28) 100%); }
.roulette-hub { position: absolute; left: 50%; top: 50%; width: 19%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%) translateZ(28px); display: grid; place-items: center; color: #0B2540; background: radial-gradient(circle at 34% 28%, #FFF5D0 0%, #E9C46A 42%, #9C6B1E 100%); box-shadow: 0 14px 22px -6px rgba(0,0,0,.45), inset 0 -5px 10px rgba(0,0,0,.25), inset 0 3px 6px rgba(255,255,255,.6); }
.roulette-hub::after { content: ""; position: absolute; inset: -9%; border-radius: 50%; border: 3px solid rgba(11, 37, 64, .85); }
.roulette-hub .ico { width: 42%; height: 42%; }
.roulette-pointer { position: absolute; left: 50%; top: 0; width: 13%; transform: translateX(-50%); transform-origin: 50% 32%; z-index: 2; filter: drop-shadow(0 8px 8px rgba(11, 37, 64, .4)); }
.roulette-pointer svg { display: block; width: 100%; }
.roulette.spinning .roulette-pointer { animation: roulette-tick .11s ease-in-out infinite alternate; }
@keyframes roulette-tick { from { transform: translateX(-50%) rotate(-9deg); } to { transform: translateX(-50%) rotate(5deg); } }
.roulette-floor { position: absolute; left: 12%; right: 12%; bottom: -1%; height: 11%; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(11, 37, 64, .32), rgba(11, 37, 64, 0) 70%); filter: blur(4px); }
.roulette .bulb { fill: #FFF2C2; }
.roulette.spinning .bulb { animation: roulette-bulb .45s steps(1) infinite; animation-delay: calc(var(--i) * -37ms); }
.roulette.won .bulb { animation: roulette-bulb .3s steps(1) 6; }
@keyframes roulette-bulb { 50% { fill: #E9C46A; opacity: .45; } }
.roulette.won .roulette-tilt { animation: roulette-win 900ms var(--spring-bouncy); }
@keyframes roulette-win { 0% { transform: rotateX(24deg) scale(1); } 35% { transform: rotateX(18deg) scale(1.04); } 100% { transform: rotateX(24deg) scale(1); } }
.roulette-btn[disabled] { opacity: .5; }
.roulette-result { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 16px; border-radius: 18px; background: var(--mint-soft); animation: pop 520ms var(--spring-bouncy); }
.roulette-result b { font-size: 22px; letter-spacing: -0.02em; color: var(--green-2); }
.roulette-result.jackpot { background: linear-gradient(135deg, #FFF3C4, #E9C46A); }
.roulette-result.jackpot b { color: #0B2540; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; left: var(--x); background: var(--c); animation: confetti-fall var(--d) cubic-bezier(.2, .6, .4, 1) forwards; animation-delay: var(--delay); transform: rotate(var(--r)); }
@keyframes confetti-fall { to { transform: translate3d(var(--dx), 105vh, 0) rotate(calc(var(--r) + 720deg)); opacity: .9; } }
.prize-row { flex-wrap: nowrap; align-items: flex-start; --gap: 10px; } .prize-row > span { min-width: 0; } .prize-row > b { white-space: nowrap; }
