
/* AUTH MODAL */
.auth-modal-overlay{
    position:fixed;
    inset:0;
    background:rgba(5,8,12,.78);
    backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:16px;
    z-index:9999;
    overflow-y:auto;
}

.auth-modal-card{
    width:min(100%, 720px);
    max-height:calc(100dvh - 32px);
    overflow-y:auto;
    overflow-x:hidden;
    border-radius:24px;
    position:relative;
    border:1px solid rgba(255,255,255,.08);
    background:linear-gradient(180deg, rgba(24,28,37,.98) 0%, rgba(13,16,22,.99) 100%);
    box-shadow:0 30px 80px rgba(0,0,0,.42);
    padding:22px 22px 18px;
    display:flex;
    flex-direction:column;
    -webkit-overflow-scrolling:touch;
}

.auth-modal-card::before{
    content:"";
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:4px;
    background:linear-gradient(90deg, var(--orange-3), var(--orange), var(--orange-2));
    border-radius:24px 24px 0 0;
}

.auth-modal-top{
    flex-shrink:0;
}

.auth-modal-logo-wrap{
    display:flex;
    justify-content:center;
    margin-bottom:14px;
}

.auth-modal-logo{
    width:64px;
    height:64px;
    border-radius:18px;
    object-fit:cover;
    border:1px solid rgba(255,140,0,.24);
    box-shadow:0 12px 28px rgba(255,140,0,.16);
}

.auth-view{
    display:none;
    width:100%;
}

.auth-view.active{
    display:flex;
    flex-direction:column;
}

.auth-head{
    text-align:center;
    margin-bottom:14px;
}

.auth-title{
    margin:0 0 6px;
    font-size:1.45rem;
    color:var(--text-main);
    font-weight:800;
    line-height:1.3;
}

.auth-subtitle{
    margin:0;
    color:var(--text-muted);
    font-size:.93rem;
    line-height:1.55;
}

.auth-form{
    display:flex;
    flex-direction:column;
    gap:12px;
    width:100%;
}

.auth-form-login{
    width:100%;
    max-width:470px;
    margin:0 auto;
}

.auth-form-register{
    width:100%;
}

.auth-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:12px 14px;
    width:100%;
}

.full-width{
    grid-column:1 / -1;
}

.auth-form-group{
    min-width:0;
}

.auth-form-group label{
    display:block;
    margin-bottom:7px;
    font-size:.87rem;
    font-weight:700;
    color:var(--text-main);
}

.auth-input-wrap{
    position:relative;
    width:100%;
}

.auth-input-wrap i{
    position:absolute;
    left:12px;
    top:50%;
    transform:translateY(-50%);
    color:rgba(255,255,255,.55);
    z-index:2;
    pointer-events:none;
}

.auth-input-wrap input, .auth-input-wrap select{
    width:100%;
    height:48px;
    border:1px solid rgba(255,255,255,.08);
    background:rgba(255,255,255,.04);
    color:var(--text-main);
    border-radius:14px;
    outline:none;
    font-size:.94rem;
    padding:0 14px 0 40px;
    transition:.25s ease;
}

.auth-input-wrap input::placeholder{
    color:rgba(255,255,255,.45);
}

.auth-input-wrap input:focus, .auth-input-wrap select:focus{
    border-color:rgba(255,140,0,.38);
    box-shadow:0 0 0 4px rgba(255,140,0,.08);
    background:rgba(255,255,255,.055);
}

.auth-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    margin-top:2px;
}

.auth-check{
    display:flex;
    align-items:center;
    gap:8px;
    color:rgba(255,255,255,.75);
    font-size:.88rem;
}

.auth-check input, .auth-check select{
    margin:0;
}

.auth-link,
.switch-auth-link{
    color:var(--orange-2);
    text-decoration:none;
    background:none;
    border:none;
    padding:0;
    font-weight:700;
    cursor:pointer;
}

.auth-submit-btn{
    min-height:48px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    font-weight:800;
    border:none;
    width:100%;
    margin-top:4px;
    cursor:pointer;
    transition:.25s ease;
}

.auth-submit-btn:hover{
    transform:translateY(-1px);
}

.auth-submit-btn.primary-btn{
    background:linear-gradient(135deg, var(--orange), var(--orange-2));
    color:#111;
}

.auth-bottom-text{
    text-align:center;
    margin-top:12px;
    color:rgba(255,255,255,.65);
    font-size:.89rem;
    line-height:1.55;
}

/* TABLET */
@media (max-width: 991.98px){
    
    .auth-modal-overlay{
        padding:12px;
    }

    .auth-modal-card{
        width:min(100%, 640px);
        padding:18px;
        border-radius:22px;
    }

    .auth-title{
        font-size:1.2rem;
    }
}
/* MOBILE */
@media (max-width: 767.98px){

    .auth-modal-overlay{
        padding:8px;
        align-items:flex-start;
    }

    .auth-modal-card{
        width:100%;
        max-width:100%;
        max-height:calc(100dvh - 16px);
        border-radius:18px;
        padding:16px 14px 14px;
        margin:auto;
    }

    .auth-modal-card::before{
        border-radius:18px 18px 0 0;
    }

    .auth-modal-logo{
        width:54px;
        height:54px;
        border-radius:15px;
    }

    .auth-modal-logo-wrap{
        margin-bottom:10px;
    }

    .auth-head{
        margin-bottom:10px;
    }

    .auth-title{
        font-size:1.05rem;
    }

    .auth-subtitle{
        font-size:.84rem;
    }

    .auth-form{
        gap:10px;
    }

    .auth-grid{
        grid-template-columns:1fr;
        gap:10px;
    }

    .full-width{
        grid-column:auto;
    }

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

    .auth-form-group label{
        font-size:.82rem;
        margin-bottom:5px;
    }

    .auth-input-wrap input, .auth-input-wrap select{
        height:44px;
        font-size:14px;
        padding:0 10px 0 36px;
        border-radius:12px;
    }

    .auth-input-wrap i{
        left:11px;
        font-size:.9rem;
    }

    

    .auth-submit-btn{
        min-height:44px;
        font-size:.92rem;
        border-radius:12px;
    }

    .auth-bottom-text{
        margin-top:8px;
        font-size:.82rem;
    }
}

/* VERY SMALL MOBILE */
@media (max-width: 420px){
    
    .auth-modal-overlay{
        padding:6px;
    }

    .auth-modal-card{
        max-height:calc(100dvh - 12px);
        padding:14px 12px 12px;
        border-radius:16px;
    }

    .auth-title{
        font-size:.98rem;
    }

    .auth-subtitle{
        font-size:.8rem;
    }

    .auth-form-group label{
        font-size:.79rem;
    }

    .auth-input-wrap input, .auth-input-wrap select{
        height:42px;
        font-size:13px;
    }

    .auth-submit-btn{
        min-height:42px;
        font-size:.88rem;
    }

    .auth-bottom-text{
        font-size:.78rem;
    }
}

.auth-message{
    display:flex;
    align-items:center;
    gap:10px;
    width:100%;
    padding:12px 14px;
    border-radius:12px;
    font-size:.9rem;
    margin-bottom:12px;
    line-height:1.45;
    border:1px solid transparent;
    animation:fadeInDown .28s ease;
    position:relative;
    box-shadow:0 10px 25px rgba(0,0,0,.12);
}

.auth-message i{
    font-size:1rem;
    flex-shrink:0;
}

.auth-message span{
    flex:1;
    min-width:0;
    word-break:break-word;
}

.auth-message-close{
    border:none;
    background:transparent;
    color:inherit;
    width:28px;
    height:28px;
    border-radius:8px;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    flex-shrink:0;
    opacity:.8;
    transition:.2s ease;
}

.auth-message-close:hover{
    opacity:1;
    background:rgba(255,255,255,.08);
}

.auth-message.success{
    background:rgba(32,193,90,.12);
    border-color:rgba(32,193,90,.28);
    color:#3ad26e;
}

.auth-message.error{
    background:rgba(255,80,80,.12);
    border-color:rgba(255,80,80,.28);
    color:#ff6b6b;
}

.auth-message.info{
    background:rgba(61,165,255,.12);
    border-color:rgba(61,165,255,.28);
    color:#59b5ff;
}

.auth-message.hide{
    animation:fadeOutUp .3s ease forwards;
}

@keyframes fadeInDown{
    from{
        opacity:0;
        transform:translateY(-10px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

@keyframes fadeOutUp{
    from{
        opacity:1;
        transform:translateY(0);
        max-height:120px;
        margin-bottom:12px;
    }
    to{
        opacity:0;
        transform:translateY(-8px);
        max-height:0;
        margin-bottom:0;
        padding-top:0;
        padding-bottom:0;
        border-width:0;
    }
}

@media (max-width: 767px){
    .auth-message{
        font-size:.84rem;
        padding:10px 12px;
        border-radius:10px;
        gap:8px;
    }

    .auth-message-close{
        width:26px;
        height:26px;
    }
}


.empty-chat-state{
    width: 100%;
    margin:auto;
    text-align: center;
    padding: 32px 24px;
}

.empty-chat-title{
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
}

.empty-chat-text{
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255,255,255,0.72);
    margin-bottom: 24px;
}

@media (max-width: 991.98px){
    .empty-chat-state{
        padding: 20px 10px;
    }

    .empty-chat-title{
        font-size: 22px;
    }

    .empty-chat-text{
        font-size: 14px;
    }
}


.chat-protected,
.chat-protected *{
    -webkit-user-select:none;
    user-select:none;
    -webkit-touch-callout:none;
}

.chat-protected img,
.chat-protected video{
    -webkit-user-drag:none;
    user-drag:none;
}

#chatScreenGuard{
    position:fixed;
    inset:0;
    z-index:2147483200;
    display:none;
    align-items:center;
    justify-content:center;
    background:rgba(7,10,14,.96);
    backdrop-filter:blur(8px);
    -webkit-backdrop-filter:blur(8px);
    padding:24px;
}

#chatScreenGuard.active{
    display:flex;
}

.chat-screen-guard-card{
    max-width:420px;
    width:min(100%,420px);
    padding:24px;
    border-radius:22px;
    border:1px solid rgba(255,255,255,.08);
    background:linear-gradient(180deg, rgba(24,28,37,.98) 0%, rgba(13,16,22,.99) 100%);
    color:#fff;
    text-align:center;
    font-weight:700;
    box-shadow:0 24px 56px rgba(0,0,0,.38);
}
