/* ===== Login premium: escena 3D, tarjeta de vidrio y microinteracciones ===== */
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.stage { position: fixed; inset: 0; overflow: hidden; background: #0b0806; color: #f4efe6; isolation: isolate; --gold: #c9a15a; --ember: #ff7a22; }
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s ease; z-index: 0; }
.stage.ready .stage-canvas { opacity: 1; }
.stage-glow { position: absolute; inset: -20%; z-index: 0; background: radial-gradient(55% 50% at 28% 72%, rgba(255, 110, 30, .22), transparent 70%), radial-gradient(45% 40% at 85% 8%, rgba(153, 19, 19, .32), transparent 70%), radial-gradient(40% 40% at 60% 100%, rgba(201, 161, 90, .10), transparent 70%); animation: drift 16s ease-in-out infinite alternate; }
.stage[data-mode='3d'].ready .stage-glow { opacity: .5; }
.embers-css { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.stage[data-mode='3d'].ready .embers-css { display: none; }
.embers-css span { position: absolute; bottom: -12px; width: var(--s); height: var(--s); border-radius: 50%; background: radial-gradient(circle, #ffd08a, #ff5a14 60%, transparent 70%); opacity: 0; animation: rise var(--d) linear var(--dl) infinite; }
.stage-vignette { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(120% 90% at 35% 58%, transparent 42%, rgba(0, 0, 0, .7) 100%); }
.stage-grain { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .09; mix-blend-mode: overlay; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.stage-flash { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0; background: radial-gradient(circle at 34% 56%, #fff3d6 0%, #ff9a3c 34%, #3a1305 100%); transition: opacity .9s cubic-bezier(.6, 0, .4, 1) .4s; }
.stage.leaving .stage-flash { opacity: 1; }
.stage.leaving .auth-card { opacity: 0 !important; transform: translateY(-50%) scale(.96) !important; transition: opacity .45s ease, transform .6s ease; }
.stage.leaving .stage-brand, .stage.leaving .stage-foot { opacity: 0; transition: opacity .4s; }

.stage-brand { position: absolute; z-index: 3; top: 28px; left: clamp(22px, 4vw, 56px); display: flex; align-items: center; gap: 14px; animation: fade-down .9s .2s both; }
.stage-brand img { width: 128px; filter: brightness(0) invert(1); opacity: .95; }
.stage-brand span { font: 700 11px Manrope, sans-serif; letter-spacing: .32em; color: var(--gold); padding: 4px 9px; border: 1px solid rgba(201, 161, 90, .45); border-radius: 99px; }
.stage-foot { position: absolute; z-index: 3; left: clamp(22px, 4vw, 56px); bottom: 26px; display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .04em; color: rgba(244, 239, 230, .6); animation: fade-up 1s .6s both; }
.stage-foot .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 0 rgba(255, 122, 34, .7); animation: ping 2.4s infinite; }

.auth-card { position: absolute; z-index: 3; right: clamp(20px, 7vw, 120px); top: 50%; width: min(440px, calc(100vw - 32px)); padding: 38px 36px 28px; border-radius: 26px; --mx: 50%; --my: 0; --rx: 0deg; --ry: 0deg;
  transform: translateY(-50%) perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s ease-out, opacity .3s;
  background: linear-gradient(145deg, rgba(255, 244, 230, .11), rgba(255, 244, 230, .035)); -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 235, 210, .07), inset 0 1px 0 rgba(255, 255, 255, .14); animation: card-in 1s cubic-bezier(.2, .8, .2, 1) .15s both; }
.auth-card::before { content: ''; position: absolute; inset: -1px; border-radius: 27px; padding: 1.5px; pointer-events: none; animation: spin 7s linear infinite;
  background: conic-gradient(from var(--ang), transparent 0 55%, rgba(201, 161, 90, .95) 75%, rgba(255, 122, 34, .95) 88%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.auth-card::after { content: ''; position: absolute; inset: 0; border-radius: 26px; pointer-events: none; background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 205, 150, .13), transparent 60%); }
.auth-card.swap-out > * { opacity: 0; transform: translateY(8px); transition: opacity .16s, transform .16s; }
.auth-card.shake { animation: shake .5s cubic-bezier(.36, .07, .19, .97); }
.auth-card > * { position: relative; z-index: 1; animation: rise-in .7s cubic-bezier(.2, .8, .2, 1) calc(var(--i, 0) * 80ms + 250ms) both; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 700 11px Manrope, sans-serif; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.auth-card h1 { font: 600 36px/1.08 'Playfair Display', Georgia, serif; letter-spacing: -.01em; margin: 14px 0 8px; color: #fff7ea; }
.auth-card h1 .w { display: inline-block; animation: word-in .8s cubic-bezier(.2, .8, .2, 1) calc(var(--wi) * 110ms + 450ms) both; }
.auth-card .sub { margin: 0 0 24px; color: rgba(244, 239, 230, .68); font-size: 14.5px; }
.ico, .ico-sm, .ico-btn, .ico-check, .ico-cta, .ico-ok { width: 20px; height: 20px; }
.ico-sm { width: 14px; height: 14px; }

.fl { position: relative; margin-bottom: 14px; }
.fl input { width: 100%; height: 58px; padding: 22px 48px 8px 46px; font: 500 15.5px Inter, sans-serif; color: #fff; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 235, 210, .14); border-radius: 15px; outline: none; transition: border-color .2s, box-shadow .25s, background .2s; }
.fl input:hover { border-color: rgba(255, 235, 210, .28); }
.fl input:focus { border-color: rgba(201, 161, 90, .85); background: rgba(0, 0, 0, .42); box-shadow: 0 0 0 4px rgba(201, 161, 90, .14), 0 0 28px rgba(255, 122, 34, .2); }
.fl label { position: absolute; left: 46px; top: 19px; pointer-events: none; transform-origin: left top; color: rgba(244, 239, 230, .55); font-size: 15px; transition: transform .22s cubic-bezier(.2, .8, .2, 1), color .2s; }
.fl input:focus + label, .fl input:not(:placeholder-shown) + label { transform: translateY(-12px) scale(.76); color: var(--gold); }
.fl > .ico { position: absolute; left: 15px; top: 19px; color: rgba(244, 239, 230, .5); transition: color .2s; }
.fl input:focus ~ .ico { color: var(--gold); }
.fl.err input { border-color: #ff6b5e; box-shadow: 0 0 0 4px rgba(255, 107, 94, .14); }
.fl input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px #1b1411 inset; -webkit-text-fill-color: #fff; caret-color: #fff; }
.eye { position: absolute; right: 8px; top: 9px; width: 40px; height: 40px; border: 0; border-radius: 11px; background: transparent; color: rgba(244, 239, 230, .6); cursor: pointer; display: grid; place-items: center; transition: background .2s, color .2s; }
.eye:hover, .eye:focus-visible { background: rgba(255, 255, 255, .08); color: #fff; outline: none; }
.caps { font-size: 12px; color: #ffb454; margin: -4px 0 10px 4px; } .caps.hidden { display: none; }

.check { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; font-size: 13.5px; color: rgba(244, 239, 230, .75); cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box { width: 20px; height: 20px; border-radius: 6px; border: 1px solid rgba(255, 235, 210, .3); display: grid; place-items: center; color: transparent; transition: all .2s; }
.check input:checked + .box { background: linear-gradient(135deg, #c9a15a, #a97b2c); border-color: transparent; color: #1a1109; }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(201, 161, 90, .4); }
.check .ico-check { width: 13px; height: 13px; stroke-width: 3; }

.cta { position: relative; overflow: hidden; width: 100%; height: 56px; border: 0; border-radius: 15px; cursor: pointer; color: #fff; font: 700 15.5px Manrope, sans-serif; letter-spacing: .02em; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, #c21b1b 0%, #8a1010 55%, #b9561a 100%); box-shadow: 0 14px 36px rgba(153, 19, 19, .5), inset 0 1px 0 rgba(255, 255, 255, .28); transition: transform .18s ease-out, box-shadow .25s, filter .2s; }
.cta::before { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%); transform: translateX(-130%); transition: transform .8s ease; }
.cta:hover:not(:disabled)::before { transform: translateX(130%); } .cta:hover:not(:disabled) { box-shadow: 0 18px 44px rgba(194, 27, 27, .6), inset 0 1px 0 rgba(255, 255, 255, .3); }
.cta:active:not(:disabled) { transform: scale(.985) !important; } .cta:focus-visible { outline: 3px solid rgba(201, 161, 90, .7); outline-offset: 3px; }
.cta:disabled { cursor: progress; filter: saturate(.8); }
.cta .ico-ok, .cta .spin { position: absolute; opacity: 0; } .cta .ico-cta { transition: transform .25s; } .cta:hover:not(:disabled) .ico-cta { transform: translateX(4px); }
.cta .spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: rot .8s linear infinite; }
.cta.loading .label, .cta.loading .ico-cta { opacity: 0; } .cta.loading .spin { opacity: 1; }
.cta.ok { background: linear-gradient(135deg, #2e9a5c, #1d6b3f); } .cta.ok .label, .cta.ok .ico-cta { opacity: 0; } .cta.ok .ico-ok { opacity: 1; width: 26px; height: 26px; stroke-width: 3; animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
.auth-msg { min-height: 20px; margin-top: 12px; font-size: 13.5px; color: #ff8c80; text-align: center; }
.secure { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 235, 210, .09); font-size: 11.5px; color: rgba(244, 239, 230, .5); }
.row-links { display: flex; justify-content: space-between; margin-top: 12px; }
.link { background: none; border: 0; padding: 4px 2px; color: var(--gold); font: 600 13px Inter, sans-serif; cursor: pointer; border-bottom: 1px solid transparent; transition: border-color .2s; } .link:hover, .link:focus-visible { border-color: var(--gold); outline: none; }

.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; margin-bottom: 18px; } .otp.hidden, .rec.hidden { display: none; }
.otp-i { height: 62px; width: 100%; text-align: center; font: 700 26px Manrope, sans-serif; color: #fff; caret-color: var(--gold); background: rgba(0, 0, 0, .32); border: 1px solid rgba(255, 235, 210, .16); border-radius: 14px; outline: none; transition: all .2s; }
.otp-i:focus { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 0 0 4px rgba(201, 161, 90, .14), 0 10px 24px rgba(255, 122, 34, .18); }
.otp-i.on { border-color: rgba(201, 161, 90, .6); background: rgba(201, 161, 90, .1); } .otp-i.bad { border-color: #ff6b5e; animation: shake-x .5s; }
.rec { width: 100%; height: 58px; margin-bottom: 18px; text-align: center; letter-spacing: .12em; font: 600 18px ui-monospace, Consolas, monospace; color: #fff; background: rgba(0, 0, 0, .32); border: 1px solid rgba(255, 235, 210, .16); border-radius: 14px; outline: none; }
.rec:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 161, 90, .14); }

.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 2px 0 12px; } .meter i { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); transition: background .3s; }
.meter i.on.s1 { background: #ff6b5e; } .meter i.on.s2 { background: #ffb454; } .meter i.on.s3 { background: #d6c85a; } .meter i.on.s4 { background: #4fd18b; }
.rules { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 12.5px; color: rgba(244, 239, 230, .55); }
.rules li { display: flex; align-items: center; gap: 7px; transition: color .25s; } .rules .ico-check { width: 14px; height: 14px; opacity: .25; stroke-width: 3; transition: all .25s; } .rules li.ok { color: #c9f0d8; } .rules li.ok .ico-check { opacity: 1; color: #4fd18b; }

@keyframes spin { to { --ang: 360deg; } } @keyframes rot { to { transform: rotate(360deg); } }
@keyframes drift { from { transform: translate3d(-2%, 1%, 0) scale(1); } to { transform: translate3d(2%, -2%, 0) scale(1.06); } }
@keyframes rise { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: .9; } 100% { transform: translate(var(--dx), -105vh); opacity: 0; } }
@keyframes card-in { from { opacity: 0; transform: translateY(-46%) scale(.97); filter: blur(8px); } to { opacity: 1; transform: translateY(-50%); filter: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes word-in { from { opacity: 0; transform: translateY(.5em) rotateX(40deg); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } } @keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes shake { 10%, 90% { transform: translateY(-50%) translateX(-2px); } 20%, 80% { transform: translateY(-50%) translateX(4px); } 30%, 50%, 70% { transform: translateY(-50%) translateX(-7px); } 40%, 60% { transform: translateY(-50%) translateX(7px); } }
@keyframes shake-x { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(255, 122, 34, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 122, 34, 0); } }
@keyframes pop { from { transform: scale(.3); } to { transform: scale(1); } }
.app { animation: app-in .7s ease both; } @keyframes app-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 899px) {
  .auth-card { position: relative; right: auto; top: auto; margin: 0 auto; transform: none; width: min(460px, calc(100vw - 28px)); animation: rise-in .9s both; padding: 30px 24px 24px; }
  .auth-card.shake { animation: shake-x .5s; }
  .stage { overflow-y: auto; display: flex; flex-direction: column; justify-content: center; padding: 96px 0 70px; } .stage.leaving .auth-card { transform: scale(.96) !important; }
  .auth-card h1 { font-size: 30px; } .stage-foot { display: none; } .rules { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .stage *, .stage *::before, .stage *::after, .app { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .embers-css span { display: none; }
}
