/* ============================================================
   avanzaPI · Main app login
   Component scoped to .login-v3
   Adaptación del login de AvanzaPRL con la paleta verde de marca
   ============================================================ */

.login-v3 {
    --lv3-ink: #1b3a21;
    --lv3-ink-2: #2d5a35;
    --lv3-ink-3: #142a18;
    --lv3-green: #5f9a2c;
    --lv3-green-dark: #4d8022;
    --lv3-lime: #a7d265;
    --lv3-paper: #f5f8f4;
    --lv3-text: #1c2b20;
    --lv3-muted: #6b7a6e;
    --lv3-border: #dde6da;
    --lv3-on-dark: #eaf6ea;
    --lv3-on-dark-muted: rgba(234, 246, 234, 0.65);
    /* Seam ribbon: arcoíris anclado en verdes; primer y último tono coinciden para que sea un bucle perfecto */
    --lv3-ribbon: linear-gradient(
        180deg,
        #e0a55d, #d9c95d, #a7d265, #5dc98a,
        #4fb3a0, #5f9a2c, #8dc043, #e0a55d
    );
    --lv3-ribbon-x: linear-gradient(
        90deg,
        #e0a55d, #d9c95d, #a7d265, #5dc98a,
        #4fb3a0, #5f9a2c, #8dc043, #e0a55d
    );

    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--lv3-paper);
    color: var(--lv3-text);
    font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ============================================================
   Brand / product column (left)
   ============================================================ */

.login-v3 .lv3-brand-col {
    flex: 1 1 56%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    padding: clamp(24px, 3.5vw, 52px);
    /* Dot mesh + warm glow over the slate gradient: keeps the brand
       panel from feeling too corporate */
    background:
        radial-gradient(rgba(167, 210, 101, 0.16) 1.5px, transparent 1.6px) 0 0 / 28px 28px,
        radial-gradient(rgba(255, 190, 92, 0.10) 1.3px, transparent 1.4px) 14px 14px / 28px 28px,
        radial-gradient(620px 500px at 74% 34%, rgba(255, 190, 92, 0.13), transparent 65%),
        linear-gradient(160deg, var(--lv3-ink-2) 0%, var(--lv3-ink) 55%, var(--lv3-ink-3) 100%);
    color: var(--lv3-on-dark);
}

/* Ambient glows */
.login-v3 .lv3-brand-col::before,
.login-v3 .lv3-brand-col::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.login-v3 .lv3-brand-col::before {
    width: 520px;
    height: 520px;
    top: -180px;
    left: -140px;
    background: radial-gradient(circle, rgba(167, 210, 101, 0.14), transparent 70%);
}

.login-v3 .lv3-brand-col::after {
    width: 640px;
    height: 640px;
    bottom: -240px;
    right: -160px;
    background: radial-gradient(circle, rgba(95, 154, 44, 0.20), transparent 70%);
}

.login-v3 .lv3-brand-col > * {
    position: relative;
    z-index: 1;
}

/* Wordmark: the real logotype (.brand-logo, avanza-brand.css)
   recolored for the dark panel: AVANZA light + PRL cyan */
.login-v3 .lv3-wordmark {
    font-size: 19px;
    color: var(--lv3-on-dark);
}

.login-v3 .lv3-wordmark strong {
    color: var(--lv3-lime);
}

.login-v3 .lv3-env-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffd166;
    background: rgba(255, 209, 102, 0.12);
    border: 1px solid rgba(255, 209, 102, 0.35);
    border-radius: 999px;
    padding: 4px 12px;
    vertical-align: middle;
}

/* Main brand area: copy left, mockup + stores right */
.login-v3 .lv3-brand-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: clamp(24px, 3vw, 48px);
    margin-top: clamp(24px, 4vh, 48px);
}

.login-v3 .lv3-brand-copy {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 560px;
    align-self: center;
    padding-bottom: clamp(8px, 2vh, 24px);
}

.login-v3 .lv3-hero-title {
    font-size: clamp(25px, 2.4vw, 35px);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.015em;
    color: #ffffff;
    margin: 0 0 clamp(20px, 3.5vh, 36px);
    max-width: 22ch;
}

.login-v3 .lv3-hero-title em {
    font-style: normal;
    color: var(--lv3-lime);
}

/* Feature cards 2x2 */
.login-v3 .lv3-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.login-v3 .lv3-feature {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 3px solid var(--fc);
    border-radius: 14px;
    padding: 16px 18px;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

/* Each card takes a color from the ribbon rainbow */
.login-v3 .lv3-feature:nth-child(1) { --fc: #e8b26a; }
.login-v3 .lv3-feature:nth-child(2) { --fc: #5dc98a; }
.login-v3 .lv3-feature:nth-child(3) { --fc: #a7d265; }
.login-v3 .lv3-feature:nth-child(4) { --fc: #4fb3a0; }

@media (hover: hover) and (pointer: fine) {
    .login-v3 .lv3-feature {
        transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    }

    .login-v3 .lv3-feature:hover {
        transform: translateY(-3px);
        border-color: var(--fc);
        background: rgba(255, 255, 255, 0.1);
    }
}

.login-v3 .lv3-feature-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.login-v3 .lv3-feature-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 15px;
    color: var(--fc);
    background: color-mix(in srgb, var(--fc) 16%, transparent);
}

.login-v3 .lv3-feature-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.login-v3 .lv3-feature-text {
    font-size: 12.5px;
    line-height: 1.55;
    color: rgba(234, 246, 234, 0.8);
    margin: 0;
}

/* Centered variant for panels without a mockup (2FA guidance) */
.login-v3 .lv3-brand-main--center {
    justify-content: center;
}

.login-v3 .lv3-brand-main--center .lv3-brand-copy {
    flex: 0 1 auto;
    text-align: center;
}

.login-v3 .lv3-brand-main--center .lv3-hero-title {
    margin-left: auto;
    margin-right: auto;
}

.login-v3 .lv3-brand-main--center .lv3-steps {
    text-align: left;
    margin: 0 auto;
    max-width: 430px;
}

/* Hero badge above the steps title: the page's icon inside a circle,
   with a reduced sonar ripple echoing the form column's ambience */
.login-v3 .lv3-hero-badge {
    position: relative;
    width: 86px;
    height: 86px;
    margin: 0 auto clamp(18px, 3vh, 30px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 32px;
    color: var(--lv3-lime);
    background: rgba(167, 210, 101, 0.12);
    border: 1px solid rgba(167, 210, 101, 0.35);
    box-shadow: 0 0 34px rgba(167, 210, 101, 0.18);
}

.login-v3 .lv3-hero-badge-ripples,
.login-v3 .lv3-hero-badge-ripples span {
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    pointer-events: none;
}

.login-v3 .lv3-hero-badge-ripples span {
    border: 1.5px solid rgba(167, 210, 101, 0.35);
    opacity: 0;
    animation: lv3-badge-ripple 4.5s ease-out infinite;
}

.login-v3 .lv3-hero-badge-ripples span:nth-child(2) { animation-delay: 1.5s; }
.login-v3 .lv3-hero-badge-ripples span:nth-child(3) { animation-delay: 3s; }

@keyframes lv3-badge-ripple {
    0% {
        transform: scale(1);
        opacity: 0;
    }
    25% {
        opacity: 0.75;
    }
    100% {
        transform: scale(1.85);
        opacity: 0;
    }
}

/* Step-by-step guidance (2FA panel) */
.login-v3 .lv3-steps {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 460px;
}

.login-v3 .lv3-step {
    position: relative;
    display: flex;
    gap: 16px;
}

/* Dotted path connecting the step badges */
.login-v3 .lv3-step:not(:last-child)::before {
    content: '';
    position: absolute;
    top: 42px;
    left: 17px;
    bottom: -26px;
    border-left: 2px dotted rgba(234, 246, 234, 0.25);
}

.login-v3 .lv3-step-num {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--sc);
    color: var(--sc);
    background: color-mix(in srgb, var(--sc) 12%, transparent);
    font-size: 15px;
    font-weight: 700;
    transition: background 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.login-v3 .lv3-step-num i {
    display: none;
    font-size: 14px;
}

/* Live progress states, driven by the code inputs */
.login-v3 .lv3-step {
    opacity: 0.55;
    transition: opacity 0.25s ease;
}

.login-v3 .lv3-step.is-active,
.login-v3 .lv3-step.is-done {
    opacity: 1;
}

.login-v3 .lv3-step.is-active .lv3-step-num {
    background: color-mix(in srgb, var(--sc) 26%, transparent);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--sc) 14%, transparent);
}

.login-v3 .lv3-step.is-done .lv3-step-num {
    background: var(--sc);
    color: #1b3a21;
}

.login-v3 .lv3-step.is-done .lv3-step-n {
    display: none;
}

.login-v3 .lv3-step.is-done .lv3-step-num i {
    display: inline;
}

/* The dotted path solidifies behind completed steps */
.login-v3 .lv3-step.is-done:not(:last-child)::before {
    border-left: 2px solid color-mix(in srgb, var(--sc) 55%, transparent);
}

.login-v3 .lv3-step:nth-child(1) { --sc: #e8b26a; }
.login-v3 .lv3-step:nth-child(2) { --sc: #a7d265; }
.login-v3 .lv3-step:nth-child(3) { --sc: #5dc98a; }

.login-v3 .lv3-step-title {
    font-size: 15.5px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 5px;
    padding-top: 6px;
}

.login-v3 .lv3-step-text {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(234, 246, 234, 0.8);
    margin: 0;
}

/* Side column: mockup with the store badges underneath.
   Fixed width: a wrapping flex row (stores) would otherwise
   inflate the column to its single-line max-content width. */
.login-v3 .lv3-brand-side {
    flex: 0 0 clamp(250px, 19vw, 300px);
    width: clamp(250px, 19vw, 300px);
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Store badges */
.login-v3 .lv3-stores {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.login-v3 .lv3-stores-label {
    flex: 0 0 100%;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    color: var(--lv3-on-dark-muted);
    margin-bottom: 2px;
}

.login-v3 .lv3-stores img {
    height: 34px;
    width: auto;
    border-radius: 8px;
    display: block;
}

.login-v3 .lv3-stores a {
    transition: transform 0.15s ease, opacity 0.15s ease;
    opacity: 0.92;
}

.login-v3 .lv3-stores a:hover {
    transform: translateY(-2px);
    opacity: 1;
}

/* Product mockup */
.login-v3 .lv3-mockup-wrap {
    width: min(100%, 260px);
    position: relative;
    perspective: 900px;
}

/* Inner layer driven by the pointer-tilt script */
.login-v3 .lv3-mockup-tilt {
    position: relative;
    border-radius: 26px;
    transform-style: preserve-3d;
    transition: transform 0.25s ease-out;
    will-change: transform;
}

/* Specular shine sweeping the screen */
.login-v3 .lv3-mockup-tilt::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 26px;
    background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.16) 50%, transparent 58%);
    background-size: 240% 100%;
    background-position: 130% 0;
    animation: lv3-shine 7s ease-in-out infinite;
    pointer-events: none;
}

@keyframes lv3-shine {
    0%, 55% { background-position: 130% 0; }
    75%, 100% { background-position: -60% 0; }
}

.login-v3 .lv3-mockup-wrap::before {
    content: '';
    position: absolute;
    inset: -12% -22%;
    background: radial-gradient(closest-side, rgba(167, 210, 101, 0.22), transparent 75%);
    pointer-events: none;
}

.login-v3 .lv3-mockup {
    position: relative;
    width: 100%;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 30px 60px -18px rgba(4, 20, 10, 0.65);
    animation: lv3-float 7s ease-in-out infinite;
}

@keyframes lv3-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}

.login-v3 .lv3-brand-footer {
    font-size: 12px;
    color: rgba(234, 246, 234, 0.5);
    margin-top: clamp(18px, 3vh, 28px);
}

/* ============================================================
   Form column (right)
   ============================================================ */

.login-v3 .lv3-form-col {
    flex: 1 1 44%;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 28px clamp(24px, 4vw, 64px);
    background:
        radial-gradient(560px 300px at 100% 0%, rgba(95, 154, 44, 0.10), transparent 65%),
        radial-gradient(480px 280px at 0% 100%, rgba(167, 210, 101, 0.10), transparent 60%),
        #eef4ea;
}

/* Sonar ripples breathing out of the bottom-right corner.
   The container spans the column and clips the rings so they
   never create page overflow. */
.login-v3 .lv3-ripples {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.login-v3 .lv3-ripples span {
    position: absolute;
    right: 0;
    bottom: 0;
    border: 2px solid rgba(95, 154, 44, 0.14);
    border-radius: 50%;
    transform: translate(50%, 50%);
    animation: lv3-ripple 12s ease-out infinite;
}

.login-v3 .lv3-ripples span:nth-child(1) {
    width: 340px;
    height: 340px;
}

.login-v3 .lv3-ripples span:nth-child(2) {
    width: 680px;
    height: 680px;
    border-color: rgba(95, 154, 44, 0.12);
    animation-delay: -4s;
}

.login-v3 .lv3-ripples span:nth-child(3) {
    width: 1020px;
    height: 1020px;
    border-color: rgba(95, 154, 44, 0.10);
    animation-delay: -8s;
}

@keyframes lv3-ripple {
    0% {
        transform: translate(50%, 50%) scale(0.55);
        opacity: 0;
    }
    30% {
        opacity: 0.9;
    }
    100% {
        transform: translate(50%, 50%) scale(1.12);
        opacity: 0;
    }
}

.login-v3 .lv3-form-header,
.login-v3 .lv3-form-footer {
    position: relative;
    z-index: 1;
}

/* Signature: thin rainbow ribbon between panels, slowly drifting.
   One gradient period (420px) per animation cycle keeps the loop seamless. */
.login-v3 .lv3-form-col::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 2;
    width: 3px;
    background: var(--lv3-ribbon);
    background-size: 100% 420px;
    animation: lv3-tape-y 9s linear infinite;
}

@keyframes lv3-tape-y {
    to { background-position: 0 420px; }
}

@keyframes lv3-tape-x {
    to { background-position: 420px 0; }
}

.login-v3 .lv3-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Header logo: the logotype in text with its brand colors,
   same prominent size on every auth page */
.login-v3 .lv3-logo {
    height: 34px;
    width: auto;
}

.login-v3 .lv3-form-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    margin: auto;
    padding: clamp(28px, 4vh, 40px) clamp(24px, 2.5vw, 36px) clamp(30px, 4vh, 42px);
    background: #ffffff;
    border: 1px solid rgba(221, 230, 218, 0.9);
    border-radius: 20px;
    box-shadow:
        0 28px 60px -32px rgba(27, 58, 33, 0.30),
        0 4px 14px -8px rgba(27, 58, 33, 0.10);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* The card lifts slightly while the user is filling it in */
.login-v3 .lv3-form-box:focus-within {
    transform: translateY(-2px);
    border-color: rgba(95, 154, 44, 0.35);
    box-shadow:
        0 34px 68px -32px rgba(27, 58, 33, 0.36),
        0 6px 18px -8px rgba(95, 154, 44, 0.16);
}

.login-v3 .lv3-title {
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--lv3-text);
    margin: 0 0 6px;
}

.login-v3 .lv3-subtitle {
    font-size: 14.5px;
    color: var(--lv3-muted);
    line-height: 1.5;
    margin: 0 0 26px;
}

/* Fields */
.login-v3 .lv3-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--lv3-text);
    margin-bottom: 6px;
}

.login-v3 .form-control.lv3-input {
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    color: var(--lv3-text);
    background: #ffffff;
    border: 1.5px solid var(--lv3-border);
    border-radius: 12px;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-v3 .form-control.lv3-input::placeholder {
    color: #9aab9c;
}

.login-v3 .form-control.lv3-input:focus {
    border-color: var(--lv3-green);
    box-shadow: 0 0 0 4px rgba(95, 154, 44, 0.14);
    outline: 0;
}

.login-v3 .form-control.lv3-input.is-invalid {
    border-color: #dc3545;
}

/* Missing required field on submit: red border + quick shake */
.login-v3 .form-control.lv3-input.lv3-shake {
    border-color: #dc3545;
    animation: lv3-shake 0.4s ease;
}

.login-v3 .form-control.lv3-input.lv3-shake:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.14);
}

@keyframes lv3-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.login-v3 .invalid-feedback {
    font-size: 12.5px;
}

.login-v3 .lv3-field {
    margin-bottom: 18px;
}

.login-v3 .lv3-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
}

.login-v3 .lv3-label-row .lv3-label {
    margin-bottom: 0;
}

.login-v3 .lv3-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--lv3-green);
    text-decoration: none;
}

.login-v3 .lv3-link:hover {
    color: var(--lv3-green-dark);
    text-decoration: underline;
}

/* Password visibility toggle */
.login-v3 .lv3-password-wrapper {
    position: relative;
}

.login-v3 .lv3-password-wrapper .form-control.lv3-input {
    padding-right: 48px;
}

.login-v3 .lv3-password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    height: 48px;
    width: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: #8a9a8c;
    font-size: 15px;
    cursor: pointer;
}

.login-v3 .lv3-password-toggle:hover {
    color: var(--lv3-green);
}

/* Leading field icons: quick visual anchor for each input.
   The icon sits after the input in the DOM (absolute anyway)
   so sibling selectors can tint it on error states. */
.login-v3 .lv3-input-wrap {
    position: relative;
}

.login-v3 .lv3-field-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 44px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8a9a8c;
    font-size: 15px;
    pointer-events: none;
    transition: color 0.15s ease;
}

.login-v3 .lv3-input-wrap .form-control.lv3-input {
    padding-left: 44px;
}

.login-v3 .lv3-input-wrap .lv3-decipher {
    padding-left: 44px;
}

.login-v3 .lv3-input-wrap:focus-within .lv3-field-icon {
    color: var(--lv3-green);
}

.login-v3 .form-control.lv3-input.is-invalid ~ .lv3-field-icon,
.login-v3 .form-control.lv3-input.lv3-shake ~ .lv3-field-icon {
    color: #dc3545;
}

/* ============================================================
   Two-factor verification code boxes
   ============================================================ */

.login-v3 .lv3-code-group {
    display: flex;
    gap: 10px;
}

.login-v3 .form-control.lv3-code-input {
    flex: 1 1 0;
    min-width: 0;
    height: 52px;
    padding: 0;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--lv3-text);
    background: #ffffff;
    border: 1.5px solid var(--lv3-border);
    border-radius: 12px;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-v3 .form-control.lv3-code-input:focus {
    border-color: var(--lv3-green);
    box-shadow: 0 0 0 4px rgba(95, 154, 44, 0.14);
    outline: 0;
}

.login-v3 .form-control.lv3-code-input.is-invalid {
    border-color: #dc3545;
}

/* A filled box pops briefly */
.login-v3 .form-control.lv3-code-input.lv3-pop {
    animation: lv3-pop 0.22s ease;
}

@keyframes lv3-pop {
    0%, 100% { transform: scale(1); }
    45% { transform: scale(1.08); }
}

/* Empty boxes shake red on incomplete submit, shares lv3-shake keyframes */
.login-v3 .form-control.lv3-code-input.lv3-shake {
    border-color: #dc3545;
    animation: lv3-shake 0.4s ease;
}

/* Full code: boxes cascade to green, submit button pulses twice */
.login-v3 .form-control.lv3-code-input.lv3-complete {
    border-color: #34a06a;
}

.login-v3 .form-control.lv3-code-input.lv3-complete:nth-child(2) { transition-delay: 0.05s; }
.login-v3 .form-control.lv3-code-input.lv3-complete:nth-child(3) { transition-delay: 0.1s; }
.login-v3 .form-control.lv3-code-input.lv3-complete:nth-child(4) { transition-delay: 0.15s; }
.login-v3 .form-control.lv3-code-input.lv3-complete:nth-child(5) { transition-delay: 0.2s; }
.login-v3 .form-control.lv3-code-input.lv3-complete:nth-child(6) { transition-delay: 0.25s; }

.login-v3 .lv3-btn.lv3-ready {
    animation: lv3-ready-pulse 1.4s ease 2;
}

@keyframes lv3-ready-pulse {
    0%, 100% {
        box-shadow: 0 10px 22px -10px rgba(95, 154, 44, 0.65);
    }
    50% {
        box-shadow:
            0 10px 22px -10px rgba(95, 154, 44, 0.65),
            0 0 0 9px rgba(95, 154, 44, 0.15);
    }
}

.login-v3 .lv3-code-help {
    font-size: 12.5px;
    color: var(--lv3-muted);
    line-height: 1.5;
    margin: 10px 0 0;
}

/* Resend row */
.login-v3 .lv3-resend {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 22px;
}

.login-v3 .lv3-link-btn {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.login-v3 .lv3-link-btn:disabled {
    color: var(--lv3-muted);
    cursor: default;
    text-decoration: none;
}

.login-v3 .lv3-resend-success {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #1e7e4e;
}

/* Decipher overlay: paints the scramble while the real value stays put */
.login-v3 .lv3-decipher {
    display: none;
    position: absolute;
    inset: 1.5px;
    align-items: center;
    padding: 0 48px 0 16px;
    font-size: 15px;
    color: var(--lv3-text);
    white-space: nowrap;
    overflow: hidden;
    pointer-events: none;
}

.login-v3 .lv3-decipher.lv3-decipher-on {
    display: flex;
}

.login-v3 .form-control.lv3-input.lv3-decoding {
    color: transparent;
    /* Chrome autofill paints text via text-fill-color, hide that too */
    -webkit-text-fill-color: transparent;
    caret-color: transparent;
}

/* The eye blinks while the icon swaps mid-animation */
.login-v3 .lv3-password-toggle.lv3-blink i {
    animation: lv3-blink 0.32s ease;
}

@keyframes lv3-blink {
    0%, 100% { transform: scaleY(1); }
    45% { transform: scaleY(0.12); opacity: 0.55; }
}

/* Remember me, custom switch */
.login-v3 .lv3-remember {
    margin: 4px 0 22px;
}

.login-v3 .lv3-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.login-v3 .lv3-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.login-v3 .lv3-switch-track {
    flex: 0 0 auto;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: #d3ddd0;
    position: relative;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.login-v3 .lv3-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(27, 58, 33, 0.35);
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-v3 .lv3-switch:hover .lv3-switch-track {
    background: #c2cfbe;
}

.login-v3 .lv3-switch input:checked ~ .lv3-switch-track {
    background: var(--lv3-green);
}

.login-v3 .lv3-switch:hover input:checked ~ .lv3-switch-track {
    background: var(--lv3-green-dark);
}

.login-v3 .lv3-switch input:checked ~ .lv3-switch-track .lv3-switch-thumb {
    transform: translateX(18px);
}

.login-v3 .lv3-switch input:focus-visible ~ .lv3-switch-track {
    box-shadow: 0 0 0 4px rgba(95, 154, 44, 0.18);
}

.login-v3 .lv3-switch-text {
    font-size: 13.5px;
    color: var(--lv3-muted);
}

/* CTA */
.login-v3 .lv3-btn {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #ffffff;
    background: linear-gradient(180deg, var(--lv3-green) 0%, var(--lv3-green-dark) 100%);
    box-shadow: 0 10px 22px -10px rgba(95, 154, 44, 0.65);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.login-v3 .lv3-btn i {
    font-size: 14px;
}

/* Shine sweep on hover */
.login-v3 .lv3-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.22) 50%, transparent 60%);
    transform: translateX(-120%);
    transition: transform 0.55s ease;
    pointer-events: none;
}

.login-v3 .lv3-btn:hover::after {
    transform: translateX(120%);
}

/* While the credentials are being checked */
.login-v3 .lv3-btn.lv3-btn-loading {
    pointer-events: none;
    filter: saturate(0.85) brightness(0.97);
}

.login-v3 .lv3-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 14px 26px -10px rgba(95, 154, 44, 0.7);
    color: #ffffff;
}

.login-v3 .lv3-btn:active {
    transform: translateY(0);
}

.login-v3 .lv3-btn:focus-visible {
    outline: 3px solid rgba(95, 154, 44, 0.45);
    outline-offset: 2px;
}

/* On desktop the brand column already carries the copyright */
.login-v3 .lv3-form-footer {
    display: none;
    text-align: center;
    font-size: 12px;
    color: var(--lv3-muted);
}

/* Fingerprint helpers stay functional but invisible */
.login-v3 .lv3-hidden {
    display: none !important;
}

/* ============================================================
   Entry animation
   ============================================================ */

/* backwards, not both: holding the final keyframe forever would
   override transforms like the card focus lift */
.login-v3 .lv3-anim {
    animation: lv3-up 0.55s ease backwards;
}

.login-v3 .lv3-anim-1 { animation-delay: 0.05s; }
.login-v3 .lv3-anim-2 { animation-delay: 0.14s; }
.login-v3 .lv3-anim-3 { animation-delay: 0.23s; }
.login-v3 .lv3-anim-4 { animation-delay: 0.32s; }

@keyframes lv3-up {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-v3 .lv3-anim {
        animation: none;
    }
    .login-v3 .lv3-mockup,
    .login-v3 .lv3-mockup-tilt::after,
    .login-v3 .lv3-form-col::before,
    .login-v3 .lv3-form-col::after {
        animation: none;
    }
    .login-v3 .lv3-password-toggle.lv3-blink i {
        animation: none;
    }
    .login-v3 .lv3-ripples span {
        animation: none;
        opacity: 0.45;
    }
    .login-v3 .lv3-hero-badge-ripples span {
        animation: none;
        opacity: 0.4;
        transform: scale(1.2);
    }
    .login-v3 .lv3-hero-badge-ripples span:nth-child(2),
    .login-v3 .lv3-hero-badge-ripples span:nth-child(3) {
        display: none;
    }
    .login-v3 .form-control.lv3-input.lv3-shake,
    .login-v3 .form-control.lv3-code-input.lv3-shake,
    .login-v3 .form-control.lv3-code-input.lv3-pop,
    .login-v3 .lv3-btn.lv3-ready {
        animation: none;
    }
    .login-v3 .lv3-step,
    .login-v3 .lv3-step-num,
    .login-v3 .form-control.lv3-code-input.lv3-complete {
        transition: none;
    }
    .login-v3 .lv3-stores a,
    .login-v3 .lv3-btn,
    .login-v3 .lv3-btn::after,
    .login-v3 .lv3-feature,
    .login-v3 .lv3-mockup-tilt,
    .login-v3 .lv3-form-box,
    .login-v3 .lv3-switch-track,
    .login-v3 .lv3-switch-thumb {
        transition: none;
    }
    .login-v3 .lv3-feature:hover,
    .login-v3 .lv3-form-box:focus-within {
        transform: none;
    }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1399.98px) {
    .login-v3 .lv3-mockup-wrap {
        display: none;
    }

    /* Without the mockup, the stores flow under the copy */
    .login-v3 .lv3-brand-main {
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: clamp(18px, 3vh, 28px);
    }

    .login-v3 .lv3-brand-copy {
        align-self: stretch;
        padding-bottom: 0;
    }

    .login-v3 .lv3-brand-side {
        flex-basis: auto;
        width: auto;
        align-self: flex-start;
        align-items: flex-start;
    }

    .login-v3 .lv3-stores {
        justify-content: flex-start;
    }

    .login-v3 .lv3-stores-label {
        text-align: left;
    }
}

@media (max-width: 991.98px) {
    .login-v3 {
        flex-direction: column;
    }

    /* Form first; slightly shorter than the viewport so the animated
       seam and the top of the dark panel peek above the fold */
    .login-v3 .lv3-form-col {
        order: -1;
        flex: 0 0 auto;
        min-height: 90vh;
        min-height: 90svh;
    }

    .login-v3 .lv3-form-footer {
        display: block;
    }

    .login-v3 .lv3-brand-footer {
        display: none;
    }

    /* Seam becomes horizontal, at the bottom edge of the form column */
    .login-v3 .lv3-form-col::before {
        display: none;
    }

    .login-v3 .lv3-form-col::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2;
        height: 3px;
        background: var(--lv3-ribbon-x);
        background-size: 420px 100%;
        animation: lv3-tape-x 9s linear infinite;
    }

    .login-v3 .lv3-brand-col {
        flex: 0 0 auto;
    }

    .login-v3 .lv3-brand-main {
        align-items: stretch;
    }

    .login-v3 .lv3-brand-copy {
        max-width: none;
        padding-bottom: 0;
    }

    /* The phone returns on stacked layouts, centered with its stores */
    .login-v3 .lv3-mockup-wrap {
        display: block;
        width: min(100%, 220px);
    }

    .login-v3 .lv3-brand-side {
        align-self: center;
        align-items: center;
    }

    .login-v3 .lv3-stores {
        justify-content: center;
    }

    .login-v3 .lv3-stores-label {
        text-align: center;
    }
}

/* Tablet: copy and phone share a row when there is room */
@media (min-width: 768px) and (max-width: 991.98px) {
    .login-v3 .lv3-brand-main {
        flex-direction: row;
        align-items: center;
    }

    .login-v3 .lv3-brand-copy {
        flex: 1 1 auto;
        min-width: 0;
    }

    .login-v3 .lv3-brand-side {
        flex: 0 0 240px;
        width: 240px;
    }
}

@media (max-width: 575.98px) {
    .login-v3 .lv3-features {
        grid-template-columns: 1fr;
    }

    .login-v3 .lv3-form-col {
        min-height: 88vh;
        min-height: 88svh;
        padding: 18px 18px 26px;
    }

    .login-v3 .lv3-form-box {
        padding: 26px 22px 28px;
        border-radius: 18px;
        box-shadow:
            0 20px 40px -26px rgba(27, 58, 33, 0.28),
            0 3px 10px -6px rgba(27, 58, 33, 0.10);
    }

    .login-v3 .lv3-title {
        font-size: 24px;
    }

    .login-v3 .lv3-mockup-wrap {
        width: min(100%, 200px);
    }

    .login-v3 .lv3-ripples span:nth-child(1) { width: 260px; height: 260px; }
    .login-v3 .lv3-ripples span:nth-child(2) { width: 520px; height: 520px; }
    .login-v3 .lv3-ripples span:nth-child(3) { width: 780px; height: 780px; }

    .login-v3 .lv3-code-group {
        gap: 7px;
    }

    .login-v3 .form-control.lv3-code-input {
        height: 46px;
        font-size: 17px;
    }
}

/* ============================================================
   Password reset pages
   ============================================================ */

/* Status banner (link sent) */
.login-v3 .lv3-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    line-height: 1.5;
    border-radius: 12px;
    padding: 12px 14px;
    margin: 0 0 20px;
}

.login-v3 .lv3-alert i {
    font-size: 15px;
    margin-top: 2px;
}

.login-v3 .lv3-alert-success {
    color: #1e6b46;
    background: #e9f7f0;
    border: 1px solid #bfe6d2;
}

.login-v3 .lv3-alert-danger {
    color: #b03e37;
    background: #fcece9;
    border: 1px solid #f0c9c5;
}

/* Live password requirements checklist, mirrors the backend rules */
.login-v3 .lv3-reqs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.login-v3 .lv3-req {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--lv3-muted);
    transition: color 0.2s ease;
}

.login-v3 .lv3-req i {
    font-size: 13px;
    color: #b7c4b4;
    transition: color 0.2s ease;
}

.login-v3 .lv3-req.is-ok {
    color: #1e7e4e;
}

.login-v3 .lv3-req.is-ok i {
    color: #34a06a;
}

/* Read-only inputs (prefilled email on obligatory/portal resets) */
.login-v3 .form-control.lv3-input[readonly] {
    background: #f2f6ef;
    color: var(--lv3-muted);
}

/* Back to login link under the card's CTA, separated by a hairline */
.login-v3 .lv3-back {
    text-align: center;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--lv3-border);
}

.login-v3 .lv3-back .lv3-link i {
    font-size: 12px;
    margin-right: 4px;
}

@media (max-width: 575.98px) {
    .login-v3 .lv3-reqs {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-v3 .lv3-req,
    .login-v3 .lv3-req i,
    .login-v3 .lv3-field-icon {
        transition: none;
    }
}