.lfa-overlay, .lfa-modal, .lfa-modal * { box-sizing: border-box; }

.lfa-modal {
    --a-primary: #2196f3;
    --a-primary-hover: #1976d2;
    --a-primary-soft: rgba(33, 150, 243, .1);
    --a-text: #1a202c;
    --a-text-2: #4a5568;
    --a-text-3: #718096;
    --a-muted: #94a3b8;
    --a-bg: #ffffff;
    --a-field: #ffffff;
    --a-soft: #f8fafc;
    --a-chip: rgba(148, 163, 184, .14);
    --a-border: #e2e8f0;
    --a-border-2: #edf2f7;
    --a-input-border: #dbe3ec;
    --a-input-hover: #c3cfdc;
    --a-error: #ef4444;
    --a-success: #10b981;
    --a-ease: cubic-bezier(.22, 1, .36, 1);
}
html.lf-dark .lfa-modal {
    --a-primary: #42a5f5;
    --a-primary-hover: #64b5f6;
    --a-primary-soft: rgba(66, 165, 245, .14);
    --a-text: #ffffff;
    --a-text-2: #a3aebe;
    --a-text-3: #7c8798;
    --a-muted: #64748b;
    --a-bg: #0a0a0a;
    --a-field: #121212;
    --a-soft: #141414;
    --a-chip: rgba(255, 255, 255, .07);
    --a-border: rgba(255, 255, 255, .1);
    --a-border-2: rgba(255, 255, 255, .07);
    --a-input-border: #262626;
    --a-input-hover: #333333;
    --a-error: #f87171;
}

.lfa-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(15, 23, 42, .55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}
.lfa-overlay.active { opacity: 1; visibility: visible; }

.lfa-modal {
    position: fixed;
    z-index: 1051;
    display: flex;
    overflow: hidden;
    background: var(--a-bg);
    color: var(--a-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    visibility: hidden;
}
.lfa-modal.active { visibility: visible; }
.lfa-modal button { font-family: inherit; }
.lfa-modal button:focus:not(:focus-visible) { outline: none; }
.lfa-modal :focus-visible { outline: 2px solid var(--a-primary); outline-offset: 2px; }
.lfa-modal input:focus-visible { outline: none; }

.lfa-side {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px;
    overflow: hidden;
    color: #fff;
    isolation: isolate;
    background:
        radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.5px) 0 0 / 18px 18px,
        linear-gradient(155deg, #42a5f5 0%, #2196f3 45%, #1565c0 100%);
}
.lfa-side::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 65%;
    z-index: -1;
    background: linear-gradient(180deg, transparent, rgba(13, 71, 161, .55));
}

.lfa-balloon {
    position: absolute;
    z-index: -1;
    border-radius: 50% 50% 48% 52% / 55% 55% 45% 45%;
    background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .85) 0 6%, rgba(255, 255, 255, .28) 22%, rgba(255, 255, 255, .08) 60%, rgba(255, 255, 255, .02) 100%);
    box-shadow: inset -8px -12px 24px rgba(13, 71, 161, .25);
    animation: lfaFloat 7s ease-in-out infinite;
}
.lfa-balloon::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    width: 1px;
    height: 70px;
    background: linear-gradient(rgba(255, 255, 255, .45), transparent);
}
.lfa-b1 { width: 120px; height: 140px; right: -18px; top: 70px; }
.lfa-b2 { width: 74px; height: 88px; right: 96px; top: 34px; animation-delay: -2.5s; animation-duration: 8s; }
.lfa-b3 { width: 52px; height: 62px; right: 40px; top: 210px; animation-delay: -4s; animation-duration: 6s; opacity: .8; }
@keyframes lfaFloat { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }

.lfa-side-logo {
    align-self: flex-start;
    display: inline-flex;
    padding: 9px 13px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 20px -8px rgba(13, 71, 161, .5);
}
.lfa-side-logo img { height: 26px; width: auto; display: block; }
.lfa-side-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .9);
}
.lfa-side-eyebrow i { color: #fcd34d; }
.lfa-side h3 { margin: 0 0 10px; font-size: 25px; line-height: 1.2; font-weight: 800; letter-spacing: -.4px; }
.lfa-side p { margin: 0; font-size: 13.5px; line-height: 1.55; color: rgba(255, 255, 255, .85); }
.lfa-perks { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lfa-perks li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .16);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    font-size: 13px;
    font-weight: 600;
}
.lfa-perks li span {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #fff;
    color: #1976d2;
    font-size: 11px;
}

.lfa-panel { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.lfa-handle { display: none; }

.lfa-top {
    position: absolute;
    top: 18px;
    left: 24px;
    right: 18px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}
.lfa-top > * { pointer-events: auto; }
.lfa-top-logo { display: none; }
.lfa-top-logo img { height: 24px; width: auto; display: block; }
.lfa-modal .lf-logo-dark { display: none; }
html.lf-dark .lfa-modal .lf-logo-light { display: none; }
html.lf-dark .lfa-modal .lf-logo-dark { display: block; }

.lfa-icon-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--a-chip);
    color: var(--a-text-3);
    font-size: 15px;
    cursor: pointer;
    transition: color .2s, background-color .2s, transform .3s var(--a-ease);
}
.lfa-close { margin-left: auto; }
.lfa-close:hover { color: var(--a-text); transform: rotate(90deg); }
.lfa-back { visibility: hidden; font-size: 14px; }
.lfa-back:hover { color: var(--a-primary); background: var(--a-primary-soft); }
.lfa-modal[data-step="otp"] .lfa-back { visibility: visible; }

.lfa-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px 36px 28px;
}
.lfa-body::-webkit-scrollbar { display: none; }

.lfa-step { display: none; flex-direction: column; animation: lfaIn .35s var(--a-ease); }
.lfa-modal[data-step="mobile"] .lfa-step-mobile,
.lfa-modal[data-step="otp"] .lfa-step-otp,
.lfa-modal[data-step="profile"] .lfa-step-profile { display: flex; }
@keyframes lfaIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.lfa-title-wrap { margin-bottom: 20px; }
.lfa-title { margin: 0; font-size: 25px; line-height: 1.2; font-weight: 800; letter-spacing: -.5px; color: var(--a-text); }
.lfa-sub { margin: 7px 0 0; font-size: 14px; line-height: 1.55; color: var(--a-text-3); }
.lfa-sub strong { color: var(--a-text); font-weight: 700; white-space: nowrap; }
.lfa-link { border: 0; background: none; padding: 0; margin-left: 4px; color: var(--a-primary); font-size: inherit; font-weight: 700; cursor: pointer; }
.lfa-link:hover { text-decoration: underline; }

.lfa-step-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 14px;
    background: var(--a-primary-soft);
    color: var(--a-primary);
    font-size: 18px;
}
.lfa-step-icon-ok { background: rgba(16, 185, 129, .12); color: var(--a-success); }

.lfa-field { margin-bottom: 12px; }
.lfa-label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--a-text-2); }

.lfa-input {
    position: relative;
    display: flex;
    align-items: center;
    height: 48px;
    border: 1.5px solid var(--a-input-border);
    border-radius: 12px;
    background: var(--a-field);
    transition: border-color .2s, box-shadow .2s;
}
.lfa-input:hover { border-color: var(--a-input-hover); }
.lfa-input:focus-within { border-color: var(--a-primary); box-shadow: 0 0 0 4px var(--a-primary-soft); }
.lfa-input-ico { position: absolute; left: 16px; color: var(--a-muted); font-size: 15px; pointer-events: none; transition: color .2s; }
.lfa-input:focus-within .lfa-input-ico { color: var(--a-primary); }
.lfa-input input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 16px 0 44px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--a-text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
}
.lfa-input input::placeholder { color: var(--a-muted); font-weight: 400; }
.lfa-input-phone input { padding-left: 12px; letter-spacing: .3px; }

.lfa-prefix {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 24px;
    padding: 0 12px 0 15px;
    border-right: 1px solid var(--a-border);
    color: var(--a-text);
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
}
.lfa-flag { position: relative; width: 20px; height: 14px; border-radius: 3px; background: linear-gradient(#ff9933 0 33.3%, #fff 33.3% 66.6%, #138808 66.6%); box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.lfa-flag::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; border: 1px solid #000080; }

.lfa-valid { margin-right: 15px; color: var(--a-success); font-size: 17px; opacity: 0; transform: scale(.5); transition: opacity .2s, transform .3s var(--a-ease); }
.lfa-input.is-valid .lfa-valid { opacity: 1; transform: scale(1); }
.lfa-input.is-invalid { border-color: var(--a-error); box-shadow: 0 0 0 4px rgba(239, 68, 68, .1); }

.lfa-error { margin: 5px 2px 0; font-size: 12px; font-weight: 500; color: var(--a-error); }
.lfa-error:empty { display: none; }
.lfa-error-center { text-align: center; margin: -6px 0 12px; }

.lfa-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 48px;
    margin-top: 4px;
    border: 0;
    border-radius: 12px;
    background: #2196f3;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 24px -12px rgba(33, 150, 243, .8), inset 0 1px 0 rgba(255, 255, 255, .18);
    transition: background-color .2s, transform .2s, box-shadow .2s;
}
.lfa-btn i { font-size: 13px; transition: transform .25s var(--a-ease); }
.lfa-btn:hover { background: #1976d2; }
.lfa-btn:hover i { transform: translateX(3px); }
.lfa-btn:active { transform: scale(.985); }
.lfa-spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: lfaSpin .7s linear infinite; }
.lfa-btn.loading { pointer-events: none; }
.lfa-btn.loading .lfa-btn-txt, .lfa-btn.loading i { display: none; }
.lfa-btn.loading .lfa-spinner { display: block; }
@keyframes lfaSpin { to { transform: rotate(360deg); } }

.lfa-divider { display: flex; align-items: center; gap: 14px; margin: 16px 0; color: var(--a-muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.lfa-divider::before, .lfa-divider::after { content: ''; flex: 1; height: 1px; background: var(--a-border-2); }

.lfa-social { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lfa-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 44px;
    border: 1.5px solid var(--a-input-border);
    border-radius: 12px;
    background: var(--a-field);
    color: var(--a-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .2s, border-color .2s;
}
.lfa-social-btn i { font-size: 17px; }
.lfa-social-btn:hover { background: var(--a-soft); border-color: var(--a-input-hover); }

.lfa-terms { margin: 0; padding-top: 18px; text-align: center; font-size: 12px; line-height: 1.6; color: var(--a-muted); }
.lfa-terms a { color: var(--a-text-2); font-weight: 600; text-decoration: underline; text-decoration-color: var(--a-border); text-underline-offset: 3px; }
.lfa-terms a:hover { color: var(--a-primary); }

.lfa-otp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.lfa-otp input {
    width: 100%;
    height: 58px;
    border: 1.5px solid var(--a-input-border);
    border-radius: 14px;
    background: var(--a-field);
    color: var(--a-text);
    text-align: center;
    font-family: inherit;
    font-size: 24px;
    font-weight: 700;
    outline: 0;
    caret-color: var(--a-primary);
    transition: border-color .2s, box-shadow .2s;
}
.lfa-otp input:focus { border-color: var(--a-primary); box-shadow: 0 0 0 4px var(--a-primary-soft); }
.lfa-otp input.filled { border-color: var(--a-primary); }
.lfa-otp.shake { animation: lfaShake .4s; }
.lfa-otp.shake input { border-color: var(--a-error); }
@keyframes lfaShake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.lfa-resend { margin: 14px 0 0; text-align: center; font-size: 13.5px; color: var(--a-text-3); }
.lfa-resend button { border: 0; background: none; padding: 0; color: var(--a-primary); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.lfa-resend button:disabled { color: var(--a-text-2); font-weight: 600; cursor: default; }

.lfa-skip { margin-top: 12px; padding: 6px; border: 0; background: none; color: var(--a-text-3); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.lfa-skip:hover { color: var(--a-primary); }

html.lfa-open, html.lfa-open body { overflow: hidden; }

@media (min-width: 769px) {
    .lfa-modal {
        top: 50%;
        left: 50%;
        width: calc(100% - 48px);
        max-width: 850px;
        height: 70vh;
        min-height: min(520px, calc(100vh - 32px));
        max-height: calc(100vh - 32px);
        border-radius: 24px;
        box-shadow: 0 40px 80px -24px rgba(15, 23, 42, .45);
        opacity: 0;
        transform: translate(-50%, -47%) scale(.97);
        transition: transform .4s var(--a-ease), opacity .3s, visibility .3s;
    }
    html.lf-dark .lfa-modal { box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .07); }
    .lfa-modal.active { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    .lfa-side { width: 42%; flex-shrink: 0; }
    .lfa-panel { flex: 1; }
}

@media (min-width: 769px) and (max-height: 700px) {
    .lfa-side p { display: none; }
    .lfa-perks { margin-top: 12px; }
}

@media (max-width: 768px) {
    .lfa-overlay { bottom: calc(var(--lf-bnav-h, 64px) + env(safe-area-inset-bottom)); }
    .lfa-modal {
        left: 0;
        right: 0;
        bottom: calc(var(--lf-bnav-h, 64px) + env(safe-area-inset-bottom));
        width: 100%;
        max-height: calc(92dvh - var(--lf-bnav-h, 64px));
        flex-direction: column;
        border-radius: 24px 24px 0 0;
        background:
            radial-gradient(130% 55% at 50% -8%, rgba(33, 150, 243, .13), transparent 62%),
            var(--a-bg);
        box-shadow: 0 -18px 40px -10px rgba(15, 23, 42, .28);
        transform: translateY(calc(100% + var(--lf-bnav-h, 64px) + env(safe-area-inset-bottom)));
        transition: transform .42s var(--a-ease), visibility .42s;
    }
    html.lf-dark .lfa-modal { background: radial-gradient(130% 55% at 50% -8%, rgba(66, 165, 245, .14), transparent 62%), var(--a-bg); }
    .lfa-modal.active { transform: translateY(0); }
    .lfa-modal.dragging { transition: none; }
    .lfa-side { display: none; }
    .lfa-panel { flex: 1; }

    .lfa-handle { display: flex; justify-content: center; padding: 8px 0 0; flex-shrink: 0; touch-action: none; cursor: grab; }
    .lfa-handle span { width: 40px; height: 5px; border-radius: 10px; background: var(--a-border); }

    .lfa-top { position: static; padding: 8px 14px 0 20px; flex-shrink: 0; gap: 10px; }
    .lfa-top-logo { display: inline-flex; }
    .lfa-back { display: none; }
    .lfa-modal[data-step="otp"] .lfa-back { display: inline-flex; }
    .lfa-modal[data-step="otp"] .lfa-top-logo { display: none; }
    .lfa-icon-btn { width: 32px; height: 32px; font-size: 13px; }

    .lfa-body { justify-content: flex-start; padding: 16px 20px 16px; }
    .lfa-title { font-size: 22px; }
    .lfa-sub { font-size: 13px; margin-top: 5px; }
    .lfa-title-wrap { margin-bottom: 16px; }
    .lfa-label { font-size: 12px; margin-bottom: 5px; }
    .lfa-input { height: 46px; background: var(--a-bg); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
    .lfa-input input, .lfa-prefix { font-size: 16px; }
    .lfa-btn { height: 46px; }
    .lfa-divider { margin: 14px 0; font-size: 11px; }
    .lfa-social-btn { height: 40px; font-size: 13.5px; background: var(--a-bg); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
    .lfa-social-btn i { font-size: 16px; }

    .lfa-terms { padding-top: 14px; font-size: 11.5px; }
    .lfa-otp { gap: 10px; }
    .lfa-otp input { height: 54px; font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .lfa-modal, .lfa-modal *, .lfa-overlay { transition: none !important; animation: none !important; }
}