/* Login v2 — rediseño completo, moderno y dinámico. Clases propias (lg2-*)
   para no chocar con el .login-* viejo de academy.css. */

.lg2-page {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background: var(--bg);
    position: relative;
}

.lg2-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.lg2-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .55;
    animation: lg2-float 22s var(--ease, ease-in-out) infinite;
    /* --px/--py los mueve el JS de parallax (suma con el transform de la
       animación en vez de pisarlo, por eso van en `translate`, no en `transform`). */
    translate: var(--px, 0px) var(--py, 0px);
}

.lg2-orb-a {
    width: 46vw;
    height: 46vw;
    max-width: 620px;
    max-height: 620px;
    top: -14vw;
    right: -12vw;
    background: radial-gradient(circle at 30% 30%, var(--bull, #059669), transparent 70%);
}

.lg2-orb-b {
    width: 36vw;
    height: 36vw;
    max-width: 480px;
    max-height: 480px;
    bottom: -14vw;
    left: -10vw;
    background: radial-gradient(circle at 60% 40%, var(--gold, #b8860b), transparent 70%);
    animation-delay: -11s;
    animation-duration: 26s;
}

html[data-theme="dark"] .lg2-orb { opacity: .32; }

@keyframes lg2-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-3%, 4%) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .lg2-orb { animation: none; }
}

.lg2-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
}

.lg2-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4vw 4vw 4vw 6vw;
    position: relative;
}

.lg2-candles {
    position: absolute;
    top: 2vh;
    right: 0;
    width: min(46%, 480px);
    height: auto;
    opacity: .5;
    pointer-events: none;
}

html[data-theme="dark"] .lg2-candles { opacity: .38; }

.lg2-candles .wick { stroke: var(--muted); stroke-width: 2; }
.lg2-candles .body.up { fill: var(--bull); }
.lg2-candles .body.down { fill: var(--bear, #dc2626); opacity: .85; }

.lg2-candle-group rect,
.lg2-candle-group line {
    opacity: 0;
    animation: lg2-candle-in .5s var(--ease) forwards;
    transform-origin: bottom center;
}
.lg2-candle-group line:nth-of-type(1), .lg2-candle-group rect:nth-of-type(1) { animation-delay: .1s; }
.lg2-candle-group line:nth-of-type(2), .lg2-candle-group rect:nth-of-type(2) { animation-delay: .18s; }
.lg2-candle-group line:nth-of-type(3), .lg2-candle-group rect:nth-of-type(3) { animation-delay: .26s; }
.lg2-candle-group line:nth-of-type(4), .lg2-candle-group rect:nth-of-type(4) { animation-delay: .34s; }
.lg2-candle-group line:nth-of-type(5), .lg2-candle-group rect:nth-of-type(5) { animation-delay: .42s; }
.lg2-candle-group line:nth-of-type(6), .lg2-candle-group rect:nth-of-type(6) { animation-delay: .5s; }
.lg2-candle-group line:nth-of-type(7), .lg2-candle-group rect:nth-of-type(7) { animation-delay: .58s; }
.lg2-candle-group line:nth-of-type(8), .lg2-candle-group rect:nth-of-type(8) { animation-delay: .66s; }
.lg2-candle-group line:nth-of-type(9), .lg2-candle-group rect:nth-of-type(9) { animation-delay: .74s; }
.lg2-candle-group line:nth-of-type(10), .lg2-candle-group rect:nth-of-type(10) { animation-delay: .82s; }

@keyframes lg2-candle-in {
    from { opacity: 0; transform: scaleY(.4); }
    to { opacity: 1; transform: scaleY(1); }
}

.lg2-priceline {
    fill: none;
    stroke: var(--gold);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 620;
    stroke-dashoffset: 620;
    animation: lg2-draw 1.8s var(--ease) .3s forwards;
}

@keyframes lg2-draw {
    to { stroke-dashoffset: 0; }
}

.lg2-live-dot {
    fill: var(--gold);
    opacity: 0;
    animation: lg2-dot-in .3s ease-out 2.1s forwards;
}

.lg2-live-dot-ring {
    fill: none;
    stroke: var(--gold);
    stroke-width: 1.5;
    opacity: 0;
    transform-origin: 480px 57px;
    animation: lg2-dot-in .3s ease-out 2.1s forwards, lg2-dot-ring 1.8s ease-out 2.4s infinite;
}

@keyframes lg2-dot-in { to { opacity: 1; } }

@keyframes lg2-dot-ring {
    0% { transform: scale(1); opacity: .7; }
    100% { transform: scale(3.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .lg2-candle-group rect, .lg2-candle-group line, .lg2-priceline {
        animation: none;
        opacity: 1;
        transform: none;
        stroke-dashoffset: 0;
    }
    .lg2-live-dot { animation: none; opacity: 1; }
    .lg2-live-dot-ring { animation: none; opacity: 0; }
}

@media (max-width: 980px) {
    .lg2-candles { display: none; }
}

.lg2-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 2.6rem;
}

.lg2-brand .logo { width: 38px; height: 38px; flex-shrink: 0; }

.lg2-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--bull);
    background: var(--bull-soft);
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 1.1rem;
}

.lg2-eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bull);
    box-shadow: 0 0 0 0 rgba(5, 150, 105, .55);
    animation: lg2-pulse 2s infinite;
}

@keyframes lg2-pulse {
    0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, .5); }
    70% { box-shadow: 0 0 0 7px rgba(5, 150, 105, 0); }
    100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

.lg2-hero h1 {
    font-family: var(--display);
    font-size: clamp(2rem, 3.4vw, 3.1rem);
    line-height: 1.1;
    font-weight: 500;
    color: var(--ink);
    max-width: 13ch;
    margin-bottom: 1rem;
}

.lg2-hero h1 em {
    font-style: normal;
    background: linear-gradient(90deg, var(--bull), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lg2-lede {
    color: var(--muted);
    font-size: 1rem;
    max-width: 42ch;
    margin-bottom: 2.2rem;
}

.lg2-stats {
    display: flex;
    gap: 2.2rem;
    margin-bottom: 2.2rem;
    padding-bottom: 2.2rem;
    border-bottom: 1px solid var(--line);
}

.lg2-stat strong,
.lg2-stat-static strong {
    display: block;
    font-family: var(--display);
    font-size: 2.1rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1;
    margin-bottom: .3rem;
}

.lg2-stat span,
.lg2-stat-static span {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    font-weight: 600;
}

.lg2-features {
    display: grid;
    gap: .9rem;
    max-width: 30rem;
}

.lg2-feature {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding: .85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}

.lg2-feature:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.lg2-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1rem;
    transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}

.lg2-feature:hover .lg2-feature-icon {
    background: var(--bull);
    color: #fff;
    transform: scale(1.1) rotate(-4deg);
}

.lg2-feature strong {
    display: block;
    font-size: .88rem;
    color: var(--ink);
    margin-bottom: .15rem;
}

.lg2-feature p {
    font-size: .8rem;
    color: var(--muted);
    line-height: 1.4;
}

.lg2-form-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4vw;
    position: relative;
}

.lg2-form-tools {
    position: absolute;
    top: 2rem;
    right: 2rem;
}

.lg2-card {
    width: 100%;
    max-width: 380px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.2rem 2rem;
}

.lg2-card-eyebrow {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: .5rem;
}

.lg2-card h2 {
    font-family: var(--display);
    font-size: 1.7rem;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: .3rem;
}

.lg2-card .sub {
    color: var(--muted);
    font-size: .88rem;
    margin-bottom: 1.6rem;
}

.lg2-field { margin-bottom: 1rem; }

.lg2-field label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: .4rem;
}

.lg2-field input {
    width: 100%;
    padding: .75rem .9rem;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-size: .92rem;
    font-family: var(--font);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.lg2-field input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.lg2-pass-wrap { position: relative; }

.lg2-pass-wrap input { padding-right: 2.6rem; }

.lg2-pass-toggle {
    position: absolute;
    top: 50%;
    right: .55rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 6px;
    transition: color .15s var(--ease), background .15s var(--ease);
}

.lg2-pass-toggle:hover { color: var(--ink); background: var(--surface-2); }

.lg2-submit {
    width: 100%;
    padding: .85rem;
    margin-top: .4rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-family: var(--font);
    font-weight: 700;
    font-size: .92rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), opacity .2s var(--ease);
    box-shadow: 0 8px 20px -8px rgba(12, 35, 64, .5);
}

.lg2-submit:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(12, 35, 64, .55); }
.lg2-submit:active { transform: translateY(0); }
.lg2-submit:disabled { opacity: .75; cursor: default; transform: none; }

.lg2-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lg2-spin .7s linear infinite;
}

@keyframes lg2-spin {
    to { transform: rotate(360deg); }
}

.lg2-alert {
    background: rgba(220, 38, 38, .1);
    border: 1px solid rgba(220, 38, 38, .3);
    color: #dc2626;
    font-size: .84rem;
    padding: .7rem .9rem;
    border-radius: 10px;
    margin-bottom: 1.1rem;
}
.lg2-alert-success {
    background: var(--bull-soft);
    border-color: rgba(5, 150, 105, .3);
    color: var(--bull);
}

.lg2-cancel {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: .82rem;
    color: var(--muted);
}

.lg2-ticker {
    position: relative;
    z-index: 1;
    overflow: hidden;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    padding: .7rem 0;
    white-space: nowrap;
}

.lg2-ticker-track {
    display: inline-block;
    animation: lg2-marquee 34s linear infinite;
}

.lg2-ticker-track span {
    display: inline-block;
    padding: 0 1.4rem;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .03em;
    color: var(--muted);
}

@keyframes lg2-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Entrada escalonada */
.lg2-anim { opacity: 0; animation: lg2-in .6s var(--ease) forwards; }
.lg2-anim:nth-child(1) { animation-delay: .05s; }
.lg2-anim:nth-child(2) { animation-delay: .12s; }
.lg2-anim:nth-child(3) { animation-delay: .19s; }
.lg2-anim:nth-child(4) { animation-delay: .26s; }
@keyframes lg2-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
    .lg2-shell { grid-template-columns: 1fr; }
    .lg2-hero { padding: 6vw 6vw 2vw; text-align: left; }
    .lg2-features { display: none; }
    .lg2-form-side { padding: 4vw 6vw 8vw; }
    .lg2-form-tools { top: 1.2rem; right: 1.2rem; }
}

@media (max-width: 520px) {
    .lg2-hero h1 { font-size: 1.7rem; max-width: none; }
    .lg2-stats { gap: 1.4rem; }
    .lg2-stat strong, .lg2-stat-static strong { font-size: 1.6rem; }
    .lg2-card { padding: 1.6rem 1.3rem; }
}
