/* Layout fixes for project edit page with embedded chat */
.lk-project-edit {
    overflow-y: auto;
    max-height: 100vh;
}

/* Make chat bottom bar adapt inside form (overrides fixed position from main.min.css) */
.lk-project-edit .chat--in-form .chat__bottom {
    position: static;
    left: auto;
    width: auto;
    height: auto;
}

.lk-project-edit .chat--in-form .chat__messages {
    max-height: 50vh;
}

.chat__messages {
    word-wrap: break-word;
}

.lk-project-edit .chat--in-form .chat__inputs {
    width: 100%;
}

/* Align chat input and buttons on one row and keep spacing */
.lk-project-edit .chat--in-form .chat__inputs {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.lk-project-edit .chat--in-form .chat__text {
    flex: 1 1 auto;
}

.lk-project-edit .chat--in-form .send-button {
    margin-left: 8px;
    white-space: nowrap;
}

.lk-project-edit .chat--in-form .chat__admin-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lk-project-edit .chat--in-form .chat__admin-tools .btn {
    white-space: nowrap;
}

/* Global fallback for LK chat where wrappers may be absent */
.chat .chat__inputs {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.chat .chat__file { flex: 0 0 auto; }
.chat .chat__text { flex: 1 1 auto; }
.chat .send-button { white-space: nowrap; }
.chat .chat__admin-tools { display: flex; align-items: center; gap: 8px; flex-direction: column;}
.chat .chat__admin-tools .btn { white-space: nowrap; }

/* Attachments preview */
.attach { display: inline-flex; align-items: center; gap: 8px; margin: 6px 8px 0 0; }
.attach__thumb { position: relative; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: #f2f2f2; display: inline-block; flex: 0 0 auto; }
.attach__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach__thumb_file { display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #666; }
.attach__file_icon { width: 24px; height: 24px; display: inline-block; background: #ccc; border-radius: 4px; }
.attach__remove { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: none; border-radius: 50%; background: #000; cursor: pointer; }
.attach__remove:before, .attach__remove:after { content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; background: #fff; transform-origin: center; }
.attach__remove:before { transform: translate(-50%, -50%) rotate(45deg); }
.attach__remove:after { transform: translate(-50%, -50%) rotate(-45deg); }
.attach__name { display: none; }

/* Поле ввода как колоночный контейнер: сверху текст, снизу вложения */
.chat .chat__text { display: flex; flex-direction: column; gap: 8px; background: #fff; border: none; border-radius: 0; }
.chat .chat__text textarea { width: 100%; display: block; border: none !important; background: transparent !important; box-shadow: none !important; outline: none !important; padding: 0; margin: 0; }
/* Усиливаем правило для возможных общих классов */
.chat .chat__text textarea.js-autosize,
.chat .chat__text textarea.decor-scroll,
.chat .chat__text .js-autosize.decor-scroll { border: none !important; background: transparent !important; box-shadow: none !important; outline: none !important; }
.chat .chat__text .attach-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; width: 100%; }

/* Фикс "скачков": резервируем размеры превью внутри ленты */
.message-thumb { display: block; width: 240px; height: 160px; object-fit: cover; border-radius: 8px; background: #eee; }

.chat .chat__bottom { background: #fff; }


.hide { display: none; }

/* Переопределения для форм авторизации и регистрации */
.login {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
    flex: 1 0 0;
    overflow-y: auto;
}

.login__block {
    flex: 1 0 0;
    max-width: 800px;
    padding: 20px;
    margin-bottom: 50px;
}

.login__title {
    font-weight: 600;
    font-size: 30px;
    color: #000;
    margin: 0;
    margin-bottom: 12px;
}

.form-group_password {
    position: relative;
}

.form-group_password input {
    padding-right: 60px;
}

.form-group_password .eye-button {
    top: calc(50% - 12px);
    right: 20px;
    position: absolute;
}

.forget-password {
    margin-top: 20px;
}

.forget-password__title {
    margin-bottom: 10px;
    cursor: pointer;
}

.login__form {
    max-width: 350px;
}

/* Стили для пошаговой регистрации */
.js_register_step_1,
.js_register_step_2,
.js_register_step_3 {
    display: none;
}

.js_register_step_1 {
    display: block;
}

/* Стили для сообщений */
.js_result {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.js_result:empty {
    display: none;
}

/* Success message */
.js_result div[style*="color: #155724"] {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Error message */
.js_result div[style*="color: #721c24"] {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Фикс размера логотипа в сайдбаре: не уменьшаем на мобильных */
.aside .logo {
    width: 147px !important;
}
@media only screen and (max-width: 900px) {
    .aside .logo {
        width: 147px !important;
    }
}

/* Адаптивность для мобильных устройств */
@media only screen and (max-width: 900px) {
    .login {
        padding: 20px 0;
        height: auto;
        overflow: hidden;
        flex: none;
    }
    
    .login__block {
        max-width: 800px;
        padding: 20px 10px 0;
        margin-bottom: 0;
    }
    
    .login__title {
        font-size: 24px;
        margin-bottom: 12px;
    }
    
    .form-group_password input {
        padding-right: 60px;
    }
    
    .form-group_password .eye-button {
        top: calc(50% - 12px);
        right: 20px;
    }
    
    .forget-password {
        margin-top: 20px;
    }
    
    .forget-password__title {
        margin-bottom: 10px;
    }
    
    .login__form {
        max-width: 350px;
        margin-bottom: 40px;
    }
}

/* Минимальные отступы для формы в чате */
.form--create-nftc .form-group label { margin-bottom: 8px; display: block; }
.form--create-nftc .form-help-text { margin-bottom: 8px; }

/* Убираем внутренние отступы у сообщения, если внутри форма */
.js_msg_block.msg--form { padding: 0 !important; }

/* Единые размеры шрифтов формы как в верстке */
.form--create-nftc .form__title {
    font-size: 18px !important;
}
.form--create-nftc .form-group label,
.form--create-nftc .form-group input,
.form--create-nftc .form-group textarea,
.form--create-nftc .form-help-text { font-size: 14px !important; }

/* Только мобильные: все тексты формы как form__title */
@media only screen and (max-width: 900px) {
    .form--create-nftc .form__title,
    .form--create-nftc .form-group label,
    .form--create-nftc .form-group input,
    .form--create-nftc .form-group textarea,
    .form--create-nftc .form-help-text,
    .form--create-nftc .button {
        font-size: 18px !important;
    }
}

/* Стили для ошибки валидации */
#project-name-input.error {
    border-color: #ff4444 !important;
    box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.2) !important;
}

.LB_edit {
    visibility: hidden;
}

/* Project header images visibility */
.project__img img.desktop { display: block; }
.project__img img.mobile { display: none; }
@media only screen and (max-width: 900px) {
    .project__img img.desktop { display: none; }
    .project__img img.mobile { display: block; }
}