/* lucky-login.css — Login de Sedda (envíos y CRM) con Lucky. Mismo archivo en app.sedda.co y crm.sedda.co.
   Formulario a la izquierda y escena azul con Lucky a la derecha; en celular la escena va arriba y Lucky
   se asoma sobre el formulario. Tema por html[data-theme="light|dark"]. */
.lg {
  --lg-bg: #15171c; --lg-fg: #eef0f6; --lg-muted: #9ca3b4; --lg-line: #2a2e38; --lg-field: #1d2028; --lg-field-line: #2f3440;
  --lg-tab: #1f222a; --lg-tab-on: #2b2f3a; --lg-link: #8a9bff; --lg-mal: #f87171; --lg-azul: #2a4fff; --lg-ok: #16a34a;
  --lg-ease: cubic-bezier(.22,1,.36,1); --lg-rebote: cubic-bezier(.3,1.5,.5,1);
  container-type: inline-size; position: relative; min-height: 100vh; min-height: 100dvh; width: 100%;
  background: var(--lg-bg); color: var(--lg-fg); font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  transition: background .3s, color .3s;
}
html[data-theme="light"] .lg {
  --lg-bg: #ffffff; --lg-fg: #0b1024; --lg-muted: #5d6478; --lg-line: #e1e4ee; --lg-field: #f6f7fb; --lg-field-line: #dde1ec;
  --lg-tab: #eef0f7; --lg-tab-on: #ffffff; --lg-link: #2a4fff; --lg-mal: #dc2626;
}
.lg *, .lg *::before, .lg *::after { box-sizing: border-box; }
.lg [hidden] { display: none !important; }
.lg-grid { display: grid; grid-template-columns: minmax(380px, 46%) 1fr; min-height: 100vh; min-height: 100dvh; }

/* --- formulario --- */
.lg-form { display: flex; flex-direction: column; padding: 32px clamp(28px, 5cqi, 72px) 24px; gap: 24px; min-width: 0; }
.lg-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lg-logo { display: block; height: 48px; width: auto; color: var(--lg-fg); }
.lg-logo .punto { fill: #5870ff; }
html[data-theme="light"] .lg-logo .punto { fill: #2a4fff; }
.lg-logo-img { height: 48px; width: auto; display: block; }
.lg-logo-img.claro { display: none; }
html[data-theme="light"] .lg-logo-img.claro { display: block; }
html[data-theme="light"] .lg-logo-img.oscuro { display: none; }
.lg-logo-img.blanco { display: none; }
.lg-tema { width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--lg-line); background: transparent; color: var(--lg-muted);
  display: grid; place-items: center; cursor: pointer; transition: transform .3s var(--lg-ease), border-color .2s, color .2s; }
.lg-tema:hover { transform: rotate(30deg); border-color: var(--lg-link); color: var(--lg-fg); }
.lg-tema .sol { display: none; } html[data-theme="light"] .lg-tema .sol { display: block; } html[data-theme="light"] .lg-tema .luna { display: none; }
.lg-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 20px; max-width: 390px; width: 100%; margin: 0 auto; }
.lg-hola { display: flex; flex-direction: column; gap: 6px; }
.lg-hola h1 { font-family: 'Bricolage Grotesque', 'DM Sans', sans-serif; font-weight: 700; font-size: 34px; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.lg-hola p { color: var(--lg-muted); font-size: 15px; margin: 0; }
.lg-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--lg-tab); padding: 4px; border-radius: 12px; }
.lg-tabs::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px; background: var(--lg-tab-on);
  box-shadow: 0 1px 2px rgba(11,16,36,.10), 0 2px 8px rgba(11,16,36,.08); transition: transform .32s var(--lg-ease); }
.lg-tabs[data-activa="codigo"]::before { transform: translateX(100%); }
.lg-tabs button { position: relative; font: 600 13.5px 'DM Sans', sans-serif; color: var(--lg-muted); background: transparent; border: 0; border-radius: 9px;
  padding: 9px 6px; white-space: nowrap; cursor: pointer; min-height: 44px; transition: color .2s; }
.lg-tabs button[aria-selected="true"] { color: var(--lg-fg); }
.lg-campos { display: flex; flex-direction: column; gap: 14px; }
.lg-campos.entra { animation: lgCampos .32s var(--lg-ease) both; }
@keyframes lgCampos { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
.lg-campo { display: flex; flex-direction: column; gap: 6px; }
.lg-campo .fila { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lg-campo label { font-size: 13.5px; font-weight: 600; transition: color .2s; }
.lg-campo:focus-within label { color: var(--lg-link); }
.lg a { color: var(--lg-link); text-decoration: none; font-weight: 600; }
.lg a:hover { text-decoration: underline; }
.lg-campo .fila a { font-size: 13px; }
.lg-input { position: relative; }
.lg-input input { width: 100%; height: 50px; border-radius: 12px; border: 1px solid var(--lg-field-line); background: var(--lg-field);
  color: var(--lg-fg); font: 16px 'DM Sans', sans-serif; padding: 0 14px; transition: border-color .2s, box-shadow .2s, background .2s; }
.lg-input input.con-ojo { padding-right: 52px; }
.lg-input input::placeholder { color: var(--lg-muted); opacity: .75; }
.lg-input input:focus { outline: none; border-color: var(--lg-azul); background: var(--lg-bg); box-shadow: 0 0 0 4px rgba(42,79,255,.18); }
.lg-input input.codigo { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 22px; letter-spacing: .5em; text-align: center; }
.lg-ojo { position: absolute; right: 3px; top: 3px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--lg-muted); border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.lg-ojo:hover { color: var(--lg-fg); }
.lg-ayuda { font-size: 13.5px; color: var(--lg-muted); line-height: 1.45; margin: 0; }
.lg-ayuda strong { color: var(--lg-fg); font-weight: 600; }
.lg-ayuda a[aria-disabled="true"] { color: var(--lg-muted); pointer-events: none; font-weight: 500; }
.lg-error { display: none; gap: 8px; align-items: flex-start; color: var(--lg-mal); font-size: 13.5px; font-weight: 500; margin: 0; }
.lg-error.show { display: flex; }
.lg-error svg { flex: none; margin-top: 2px; }
.lg.con-error .lg-campos:not([hidden]) input { border-color: var(--lg-mal); }
.lg.con-error .lg-campos:not([hidden]) { animation: lgTiembla .42s cubic-bezier(.36,.07,.19,.97); }
@keyframes lgTiembla { 15% { transform: translateX(-7px) } 35% { transform: translateX(6px) } 55% { transform: translateX(-4px) } 75% { transform: translateX(3px) } 100% { transform: none } }
.lg-entrar { position: relative; overflow: hidden; width: 100%; height: 52px; border: 0; border-radius: 12px; background: var(--lg-azul); color: #fff;
  font: 700 15.5px 'DM Sans', sans-serif; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 8px 20px rgba(42,79,255,.30); transition: transform .15s, background .2s, box-shadow .2s, opacity .2s; }
.lg-entrar::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; transform: skewX(-20deg);
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.28), rgba(255,255,255,0)); transition: left .6s var(--lg-ease); }
.lg-entrar:hover { background: #2242e8; box-shadow: 0 10px 26px rgba(42,79,255,.38); }
.lg-entrar:hover::after { left: 120%; }
.lg-entrar:active { transform: scale(.98); }
.lg-entrar:disabled, .lg-entrar.loading { cursor: progress; opacity: .85; }
.lg-entrar.loading::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: lgGiro .7s linear infinite; }
.lg-entrar.listo { background: var(--lg-ok); box-shadow: 0 8px 20px rgba(22,163,74,.3); }
@keyframes lgGiro { to { transform: rotate(360deg) } }
.lg-alt { text-align: center; color: var(--lg-muted); font-size: 14px; margin: 0; }
.lg-alt a { font-weight: 700; }
.lg-pie { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--lg-muted); }
.lg-pie a { color: inherit; font-weight: 500; }
#cf-turnstile:not([hidden]) { display: flex; justify-content: center; }
.lg-viva .lg-top, .lg-viva .lg-body > *, .lg-viva .lg-pie { animation: lgSube .55s var(--lg-ease) both; animation-delay: calc(var(--i, 0) * 50ms + 50ms); }
.lg-body > :nth-child(1) { --i: 1 } .lg-body > :nth-child(2) { --i: 2 } .lg-body > :nth-child(3) { --i: 3 } .lg-body > :nth-child(4) { --i: 3 }
.lg-body > :nth-child(5) { --i: 4 } .lg-body > :nth-child(6) { --i: 5 } .lg-body > :nth-child(7) { --i: 6 } .lg-body > :nth-child(8) { --i: 6 } .lg-pie { --i: 7 }
@keyframes lgSube { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }

/* --- escena --- */
.lg-escena { position: relative; overflow: hidden; color: #fff; margin: 12px; border-radius: 22px; min-height: 0; --mx: 0; --my: 0; --caida: 900px;
  background: radial-gradient(85% 65% at 66% 54%, #5273ff 0%, #2a4fff 40%, #1735d6 74%, #0f27a8 100%); }
.lg-capa { transform: translate3d(calc(var(--mx) * var(--prof, 0) * 1px), calc(var(--my) * var(--prof, 0) * 1px), 0); will-change: transform; }
.lg-rutas { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); --prof: 7; }
.lg-rutas .linea { fill: none; stroke: rgba(255,255,255,.24); stroke-width: 1.4; stroke-dasharray: 2 9; stroke-linecap: round; }
.lg-rutas .nodo { fill: rgba(255,255,255,.6); }
.lg-rutas .pulso { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1.2; transform-box: fill-box; transform-origin: center; animation: lgPulso 2.8s var(--lg-ease) infinite; }
.lg-rutas .paquete { fill: #fff; }
@keyframes lgPulso { 0% { transform: scale(.6); opacity: .9 } 100% { transform: scale(2.8); opacity: 0 } }
.lg-nieve { position: absolute; inset: 0; pointer-events: none; --prof: 18; }
.lg-nieve i { position: absolute; top: -14px; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%; background: #fff; opacity: var(--o);
  animation: lgNieve var(--d) linear var(--r) infinite; }
@keyframes lgNieve { to { transform: translate3d(var(--dx), var(--caida), 0) } }
.lg-copy { position: absolute; left: 44px; top: 44px; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100% - 88px)); }
.lg-copy > * { margin: 0; animation: lgSube .7s var(--lg-ease) both; }
.lg-copy > :nth-child(2) { animation-delay: .12s } .lg-copy > :nth-child(3) { animation-delay: .24s }
.lg-copy .eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: rgba(255,255,255,.76); }
.lg-copy h2 { font-family: 'Bricolage Grotesque', 'DM Sans', sans-serif; font-weight: 800; font-size: clamp(30px, 3.4cqi, 44px); line-height: 1.04; letter-spacing: -0.025em; }
.lg-copy p { color: rgba(255,255,255,.86); font-size: 15.5px; max-width: 34ch; line-height: 1.5; }

/* Lucky en la escena */
.lg-lucky { --t: min(460px, 36cqi); position: absolute; left: 64%; top: 55%; width: var(--t); height: var(--t); margin: calc(var(--t) * -.62) 0 0 calc(var(--t) * -.5); opacity: 0; }
.lg-lucky.visible { opacity: 1; }
.lg-lucky .halo { position: absolute; left: 50%; top: 62%; width: 78%; height: 78%; margin: -39% 0 0 -39%; border-radius: 50%; --prof: 4;
  background: radial-gradient(closest-side, rgba(255,255,255,.15), rgba(255,255,255,0)); }
.lg-lucky .sombra { position: absolute; left: 50%; top: 96%; width: 34%; height: 5%; margin-left: -17%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(6,14,70,.5), rgba(6,14,70,0)); animation: lgSombra 4.2s ease-in-out infinite; }
@keyframes lgSombra { 0%,100% { transform: scale(1); opacity: .9 } 50% { transform: scale(.86); opacity: .6 } }
.lg-lucky .entra, .lg-lucky .sigue, .lg-lucky .inclina, .lg-lucky .gesto, .lg-lucky .flota { width: 100%; height: 100%; }
.lg-lucky .sigue { transform: perspective(700px) translate3d(calc(var(--mx) * 12px), calc(var(--my) * 8px), 0) rotateY(calc(var(--mx) * 9deg)) rotateX(calc(var(--my) * -6deg)); will-change: transform; }
.lg-lucky .inclina { transition: transform .5s var(--lg-ease); transform-origin: 50% 80%; }
.lg.mira .lg-lucky .inclina { transform: translateX(-14px) rotate(-5deg); }
.lg-lucky .flota { animation: lgFlota 4.2s ease-in-out infinite; will-change: transform; transform-origin: 50% 70%; }
@keyframes lgFlota { 0%,100% { transform: translate3d(0,0,0) rotate(-.7deg) } 50% { transform: translate3d(0,-10px,0) rotate(.7deg) } }
.lg-lucky.llegando .entra { animation: lgLlegada 1.1s cubic-bezier(.2,.85,.25,1) both; }
@keyframes lgLlegada {
  0% { transform: translate(420px,-190px) rotate(-10deg) scale(.66); opacity: 0 } 10% { opacity: 1 }
  68% { transform: translate(-12px,8px) rotate(-3deg) scale(1.02) } 84% { transform: translate(0,12px) scale(1.06,.93) } 100% { transform: none } }
.lg-lucky.niega .gesto { animation: lgNiega .62s ease-in-out; }
@keyframes lgNiega { 0%,100% { transform: none } 18% { transform: translateX(-13px) rotate(-7deg) } 40% { transform: translateX(12px) rotate(7deg) } 62% { transform: translateX(-9px) rotate(-5deg) } 82% { transform: translateX(6px) rotate(3deg) } }
.lg-lucky.brinco .gesto { animation: lgBrinco .5s var(--lg-rebote); }
@keyframes lgBrinco { 0%,100% { transform: none } 35% { transform: translateY(-16px) scale(.97,1.04) } 70% { transform: translateY(0) scale(1.05,.95) } }
.lg-lucky .lucky { position: relative; display: block; width: 100%; height: 100%; }
.lg-lucky .lucky img, .lg-lucky .lucky canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lg-lucky .lucky.lk-listo img { visibility: hidden; }
.lg-lucky .toque { position: absolute; left: 24%; top: 26%; width: 54%; height: 70%; border: 0; padding: 0; background: transparent; cursor: pointer; border-radius: 30px; }
.lg-lucky .pildora { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 8px); white-space: nowrap; display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #fff; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 99px; opacity: 0; transition: opacity .25s, transform .35s var(--lg-ease); pointer-events: none; }
.lg-lucky.de-espaldas .pildora { opacity: 1; transform: translate(-50%, 0); }

/* tarjeta viva */
.lg-tarjeta-w { position: absolute; left: 36px; bottom: 92px; width: 256px; max-width: calc(100% - 72px); --prof: 12; }
.lg-tarjeta { background: rgba(255,255,255,.97); color: #0b1024; border-radius: 16px; padding: 14px 16px; box-shadow: 0 18px 40px rgba(6,14,70,.35);
  display: flex; flex-direction: column; gap: 10px; animation: lgTarjeta .7s var(--lg-ease) 1.2s both; }
@keyframes lgTarjeta { from { opacity: 0; transform: translateY(16px) scale(.97) } to { opacity: 1; transform: none } }
.lg-tarjeta .t1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: #5d6478; }
.lg-tarjeta .t1 b { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 600; color: #0b1024; font-variant-numeric: tabular-nums; }
.lg-tarjeta .t1 img { height: 13px; width: auto; }
.lg-tarjeta .estado { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; min-height: 24px; }
.lg-tarjeta .estado i { flex: none; width: 18px; height: 18px; border-radius: 50%; background: #e8ecff; display: grid; place-items: center; transition: background .3s; position: relative; }
.lg-tarjeta .estado i::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2a4fff; transition: opacity .2s; }
.lg-tarjeta .estado i svg { position: absolute; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .35s var(--lg-rebote); }
.lg-tarjeta.ok .estado i { background: #16a34a; } .lg-tarjeta.ok .estado i::before { opacity: 0; } .lg-tarjeta.ok .estado i svg { opacity: 1; transform: none; }
.lg-tarjeta .cambia { display: inline-block; transition: opacity .22s, transform .22s var(--lg-ease); }
.lg-tarjeta .cambia.sale { opacity: 0; transform: translateY(-5px); }
.lg-tarjeta .pasos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.lg-tarjeta .pasos span { height: 4px; border-radius: 4px; background: #dfe3f0; overflow: hidden; position: relative; }
.lg-tarjeta .pasos span::after { content: ""; position: absolute; inset: 0; background: #2a4fff; transform: scaleX(0); transform-origin: left; transition: transform .6s var(--lg-ease), background .3s; }
.lg-tarjeta .pasos span.on::after { transform: scaleX(1); }
.lg-tarjeta.ok .pasos span::after { background: #16a34a; }
.lg-tarjeta .t3 { font-size: 12.5px; color: #5d6478; min-height: 19px; }
.lg-tarjeta .burbuja { background: #eef1ff; border-radius: 12px 12px 12px 4px; padding: 9px 11px; font-size: 13.5px; }
.lg-carriers { position: absolute; left: 36px; right: 36px; bottom: 32px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; animation: lgSube .7s var(--lg-ease) 1.4s both; }
.lg-carriers small { font-size: 12px; color: rgba(255,255,255,.8); margin-right: 4px; }
.lg-carriers span { background: #fff; border-radius: 9px; height: 32px; padding: 0 11px; display: grid; place-items: center; }
.lg-carriers img { height: 15px; width: auto; display: block; }

/* tableta / ventana angosta: sin tarjeta, Lucky centrado */
@container (max-width: 1080px) {
  .lg-tarjeta-w { display: none; }
  .lg-lucky { left: 50%; top: 60%; }
  .lg-copy { left: 32px; top: 32px; }
  .lg-carriers { left: 32px; right: 32px; }
}
/* celular: escena arriba, Lucky asomado sobre el formulario */
@container (max-width: 760px) {
  .lg-grid { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .lg-escena { order: -1; margin: 0; border-radius: 0; height: 250px; --caida: 320px; }
  .lg-copy, .lg-tarjeta-w, .lg-carriers, .lg-lucky .pildora, .lg-lucky .sombra { display: none; }
  .lg-lucky { --t: 250px; left: 50%; top: 14px; margin: 0 0 0 -125px; }
  .lg-lucky.llegando .entra { animation-name: lgLlegadaCel; }
  .lg-form { position: relative; z-index: 3; margin-top: -26px; background: var(--lg-bg); border-radius: 24px 24px 0 0; padding: 30px 22px 24px; gap: 22px; }
  .lg-top { position: absolute; top: -210px; left: 20px; right: 20px; }
  .lg-logo { height: 40px; color: #fff; } .lg-logo .punto, html[data-theme="light"] .lg-logo .punto { fill: #fff; }
  .lg-logo-img.claro, .lg-logo-img.oscuro, html[data-theme="light"] .lg-logo-img.claro { display: none; }
  .lg-logo-img.blanco { display: block; height: 40px; }
  .lg-tema { border-color: rgba(255,255,255,.35); color: #fff; }
  .lg-hola h1 { font-size: 28px; }
}
@keyframes lgLlegadaCel {
  0% { transform: translate(260px,-70px) rotate(-10deg) scale(.7); opacity: 0 } 10% { opacity: 1 }
  68% { transform: translate(-8px,6px) rotate(-3deg) scale(1.02) } 84% { transform: translate(0,10px) scale(1.06,.93) } 100% { transform: none } }

@media (prefers-reduced-motion: reduce) {
  .lg *, .lg *::before, .lg *::after { animation: none !important; transition: none !important; }
  .lg-lucky { opacity: 1; }
  .lg-rutas .paquete, .lg-nieve { display: none; }
}
