/* Полноэкранный popup: не зависит от контейнера/виджета темы */
.vston-popup-bg{
    position:fixed !important;
    top:0 !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;
    width:100vw !important;
    height:100vh !important;
    max-width:none !important;
    max-height:none !important;
    margin:0 !important;
    transform:none !important;
    z-index:2147483647 !important;
}

.vston-popup-bg.vston-open{
    display:flex !important;
    visibility:visible !important;
    opacity:1 !important;
}

.vston-popup{
    z-index:2147483647 !important;
    max-height:calc(100vh - 40px);
}

.vston-popup-panel{
    min-width:0;
}

.vston-popup-bg{
    position:fixed;
    inset:0;
    width:100%;
    height:100%;
    display:none;
    align-items:center;
    justify-content:center;
    padding:20px;
    background:rgba(15,23,42,.72);
    box-sizing:border-box;
    z-index:999990 !important;
}

.vston-popup-bg.vston-open{
    display:flex !important;
}

.vston-popup{
    position:relative;
    width:100%;
    max-width:1040px;
    min-height:620px;
    display:flex;
    background:#ffffff;
    border:1px solid rgba(226,232,240,.9);
    border-radius:24px;
    overflow:visible;
    box-shadow:0 24px 60px rgba(15,23,42,.20);
    z-index:999991 !important;
}

.vston-popup *{
    box-sizing:border-box;
}

.vston-popup-media{
    flex:0 0 44%;
    min-height:620px;
    background-size:cover;
    background-position:center;
    background-repeat:no-repeat;
    position:relative;
    overflow:hidden;
    border-radius:24px 0 0 24px;
}

.vston-popup-media:after{
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(180deg, rgba(15,23,42,.06), rgba(15,23,42,.22));
}

.vston-popup-panel{
    position:relative;
    z-index:2;
    flex:1 1 auto;
    padding:52px 42px 38px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    background:
        radial-gradient(circle at top right, rgba(99,102,241,.07), transparent 34%),
        #ffffff;
    overflow:visible;
    border-radius:0 24px 24px 0;
}

.vston-popup-label{
    margin:0 0 12px;
    font-size:12px;
    line-height:1.2;
    letter-spacing:.16em;
    text-transform:uppercase;
    color:#7b8497;
    font-weight:700;
}

.vston-popup-panel h3{
    margin:0 0 12px;
    font-size:40px;
    line-height:1.08;
    color:#0f172a;
    font-weight:800;
    letter-spacing:-.02em;
}

.vston-popup-subtitle{
    margin:0 0 24px;
    font-size:18px;
    line-height:1.65;
    color:#5b6478;
    max-width:540px;
}

.vston-popup-close{
    position:absolute;
    top:16px;
    right:16px;
    width:42px;
    height:42px;
    border:1px solid rgba(226,232,240,.9);
    border-radius:999px;
    background:#ffffff;
    color:#0f172a;
    font-size:24px;
    line-height:1;
    cursor:pointer;
    z-index:10;
    box-shadow:0 8px 20px rgba(15,23,42,.08);
    transition:background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.vston-popup-close:hover{
    background:#f8fafc;
    transform:rotate(90deg);
    box-shadow:0 12px 24px rgba(15,23,42,.12);
}

/* формы в popup */
.vston-auth-form{
    margin:0;
    width:100%;
    max-width:430px;
    position:relative;
    z-index:3;
}

.vston-auth-form input[type="text"],
.vston-auth-form input[type="email"],
.vston-auth-form input[type="password"]{
    width:100%;
    margin:0 0 12px;
    padding:15px 16px;
    border:1px solid #d7ddea;
    border-radius:14px;
    background:#fff;
    color:#0f172a;
    font-size:16px;
    outline:none;
    transition:border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.vston-auth-form input::placeholder{
    color:#94a3b8;
}

.vston-auth-form input[type="text"]:focus,
.vston-auth-form input[type="email"]:focus,
.vston-auth-form input[type="password"]:focus{
    border-color:#6366f1;
    box-shadow:0 0 0 4px rgba(99,102,241,.10);
    background:#fff;
}

.vston-auth-form label{
    display:flex;
    align-items:center;
    gap:8px;
    margin:8px 0 14px;
    color:#475569;
    font-size:14px;
    line-height:1.4;
}

.vston-auth-form input[type="checkbox"]{
    width:18px;
    height:18px;
    margin:0;
    accent-color:#4f46e5;
}

.vston-auth-submit{
    width:100%;
    appearance:none;
    border:0;
    border-radius:14px;
    padding:15px 18px;
    background:linear-gradient(135deg,#4f46e5,#6366f1) !important;
    color:#fff !important;
    cursor:pointer;
    font-size:16px;
    font-weight:700;
    box-shadow:0 12px 24px rgba(79,70,229,.18);
    transition:transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.vston-auth-submit:hover{
    transform:translateY(-1px);
    box-shadow:0 16px 28px rgba(79,70,229,.24);
    filter:brightness(1.03);
}

.vston-auth-submit[disabled]{
    opacity:.7;
    cursor:not-allowed;
    transform:none;
    box-shadow:none;
}

.vston-auth-message{
    display:none;
    margin:0 0 12px;
    padding:11px 12px;
    border-radius:12px;
    font-size:13px;
    line-height:1.45;
}

.vston-auth-message.vston-error{
    display:block;
    background:#fff1f2;
    color:#b42318;
    border:1px solid #fecdd3;
}

.vston-auth-message.vston-success{
    display:block;
    background:#ecfdf3;
    color:#067647;
    border:1px solid #b7ebc6;
}

.vston-popup-switch{
    margin-top:14px;
    font-size:15px;
    line-height:1.55;
    color:#667085;
}

.vston-popup-switch button{
    appearance:none;
    border:0;
    background:none !important;
    padding:0;
    margin:0;
    color:#4f46e5 !important;
    cursor:pointer;
    font-size:15px;
    font-weight:700;
    box-shadow:none !important;
    border-radius:0 !important;
    transition:color .18s ease;
}

.vston-popup-switch button:hover{
    color:#4338ca !important;
    text-decoration:underline;
}

/* reCAPTCHA внутри popup */
.vston-recaptcha-wrap{
    margin:8px 0 16px;
    width:100%;
    overflow:visible;
    position:relative;
    z-index:3;
}

.vston-recaptcha-wrap .g-recaptcha{
    display:inline-block;
    max-width:100%;
    position:relative;
    z-index:3;
    transform:none !important;
    transform-origin:left top;
}

.vston-recaptcha-wrap iframe{
    position:relative;
    z-index:3 !important;
}

body.vston-popup-lock{
    overflow:hidden !important;
}

/* кнопки вне popup */
.vston-auth-buttons{
    display:flex;
    gap:12px;
    align-items:center;
    flex-wrap:wrap;
}

.vston-auth-buttons .vston-auth-btn{
    appearance:none;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:52px !important;
    padding:14px 22px !important;
    border:0 !important;
    border-radius:14px !important;
    cursor:pointer;
    font-size:16px !important;
    font-weight:700;
    line-height:1.2;
    white-space:nowrap;
    transition:transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.vston-auth-buttons .vston-login-btn{
    background:linear-gradient(135deg,#4f46e5,#6366f1 58%,#38bdf8) !important;
    color:#fff !important;
    box-shadow:0 12px 28px rgba(79,70,229,.28) !important;
}

.vston-auth-buttons .vston-login-btn:hover{
    transform:translateY(-2px);
    box-shadow:0 18px 34px rgba(79,70,229,.34) !important;
    filter:brightness(1.04);
}

.vston-auth-buttons .vston-register-btn{
    background:linear-gradient(135deg,#f59e0b,#fbbf24 58%,#fde68a) !important;
    color:#2c2100 !important;
    box-shadow:0 10px 22px rgba(245,158,11,.24) !important;
}

.vston-auth-buttons .vston-register-btn:hover{
    transform:translateY(-2px);
    box-shadow:0 14px 26px rgba(245,158,11,.30) !important;
    filter:brightness(1.02);
}

.vston-auth-buttons .vston-auth-btn:active{
    transform:translateY(0);
}

/* карточка пользователя */
.vston-auth-user-card{
    position:relative;
    border-radius:20px;
    overflow:hidden;
    background:
        radial-gradient(circle at top right, rgba(99,102,241,.18), transparent 36%),
        linear-gradient(180deg,#111827 0%, #0f172a 100%);
    border:1px solid rgba(255,255,255,.08);
    box-shadow:0 18px 40px rgba(15,23,42,.18);
    color:#fff;
    width:100%;
}

.vston-auth-user-card:before{
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;
    background:linear-gradient(135deg, rgba(255,255,255,.05), rgba(255,255,255,0));
}

.vston-auth-user-card-inner{
    position:relative;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:14px;
    width:100%;
}

.vston-auth-user-avatar-wrap{
    position:relative;
    flex:0 0 62px;
    width:62px;
    height:62px;
    min-width:62px;
    border-radius:50%;
    overflow:hidden;
    background:linear-gradient(135deg,#6366f1,#38bdf8);
    padding:2px;
    box-shadow:0 10px 24px rgba(79,70,229,.24);
}

.vston-auth-avatar-img{
    display:block;
    width:100%;
    height:100%;
    border-radius:50%;
    object-fit:cover;
    background:#0f172a;
}

.vston-auth-user-actions{
    display:flex;
    gap:8px;
    align-items:center;
    justify-content:flex-end;
    flex:1 1 auto;
    min-width:0;
    flex-wrap:wrap;
}

.vston-auth-user-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    min-height:36px;
    padding:8px 12px;
    border-radius:12px;
    text-decoration:none;
    font-size:12px;
    font-weight:700;
    line-height:1.2;
    transition:transform .2s ease, box-shadow .2s ease, filter .2s ease;
    border:1px solid transparent;
    white-space:nowrap;
}

.vston-auth-user-btn-primary{
    background:linear-gradient(135deg,#f59e0b,#fbbf24 58%,#fde68a);
    color:#2c2100;
    box-shadow:0 10px 22px rgba(245,158,11,.22);
}

.vston-auth-user-btn-primary:hover{
    transform:translateY(-1px);
    box-shadow:0 14px 26px rgba(245,158,11,.28);
    filter:brightness(1.02);
    color:#2c2100;
}

.vston-auth-user-btn-danger{
    background:linear-gradient(135deg,#dc2626,#ef4444 58%,#f87171);
    color:#fff;
    box-shadow:0 10px 22px rgba(220,38,38,.22);
}

.vston-auth-user-btn-danger:hover{
    transform:translateY(-1px);
    box-shadow:0 14px 26px rgba(220,38,38,.28);
    filter:brightness(1.02);
    color:#fff;
}

.vston-auth-user-btn-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:14px;
    height:14px;
    font-size:16px;
    line-height:1;
    font-weight:700;
    margin-top:-1px;
}

/* mobile */
@media (max-width: 991px){
    .vston-popup{
        max-width:940px;
        min-height:560px;
    }

    .vston-popup-media{
        min-height:560px;
    }

    .vston-popup-panel{
        padding:40px 32px 32px;
    }

    .vston-popup-panel h3{
        font-size:34px;
    }

    .vston-popup-subtitle{
        font-size:17px;
    }
}

@media (max-width: 767px){
    .vston-popup-bg{
        padding:14px;
    }

    .vston-popup{
        flex-direction:column;
        max-width:100%;
        min-height:auto;
        border-radius:18px;
        overflow:visible;
    }

    .vston-popup-media{
        flex:none;
        width:100%;
        min-height:220px;
        border-radius:18px 18px 0 0;
    }

    .vston-popup-panel{
        padding:24px 18px 20px;
        border-radius:0 0 18px 18px;
    }

    .vston-popup-panel h3{
        font-size:28px;
    }

    .vston-popup-subtitle{
        margin-bottom:20px;
        font-size:16px;
        line-height:1.6;
    }

    .vston-popup-close{
        top:10px;
        right:10px;
        width:38px;
        height:38px;
        font-size:22px;
    }

    .vston-auth-form{
        max-width:100%;
    }

    .vston-recaptcha-wrap{
        overflow-x:auto;
    }
}

@media (max-width: 640px){
    .vston-auth-buttons{
        flex-direction:column;
        align-items:stretch;
    }

    .vston-auth-buttons .vston-auth-btn{
        width:100%;
    }

    .vston-auth-user-card-inner{
        gap:10px;
        padding:12px;
    }

    .vston-auth-user-avatar-wrap{
        flex:0 0 56px;
        width:56px;
        height:56px;
        min-width:56px;
    }

    .vston-auth-user-actions{
        justify-content:flex-start;
    }

    .vston-auth-user-btn{
        min-height:34px;
        padding:7px 10px;
        font-size:11px;
    }
}