/* static/assets/css/pages/auth.css */

/* КРАСИВЫЙ СВЕТЛЫЙ ГРАДИЕНТ */
body.auth-page {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 50%, #e8ebff 100%);
    position: relative;
    overflow-x: hidden;
}

/* ТОНКАЯ ТЕКСТУРА ПОВЕРХ ГРАДИЕНТА */
body.auth-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 15% 85%, rgba(102, 108, 255, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 85% 15%, rgba(90, 97, 224, 0.08) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

/* Убираем transition только для полей ввода */
body.auth-page .form-control,
body.auth-page .input-group,
body.auth-page .input-group-text,
body.auth-page .alert {
    transition-property: none !important;
}

/* БЕЙДЖ БЕТА */
.beta-badge {
    position: fixed;
    bottom: 15px;
    right: 15px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 6px 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 12px;
    color: #666cff;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 4px 15px rgba(102, 108, 255, 0.15);
}

.beta-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #666cff;
    border-radius: 50%;
    display: block;
}

/* COOKIES */
.m-wrapper-cookies {
    position: fixed;
    bottom: 30px;
    left: 0;
    right: 0;
    z-index: 1500;
    margin: 0 auto;
    width: 39%;
    max-width: 600px;
    min-width: 300px;
    display: none;
    border-radius: 14px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    background: white;
    border: 1px solid rgba(102, 108, 255, 0.2);
}

.m-wrapper__wrapper-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    gap: 20px;
}

.m-wrapper__text {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

.m-wrapper__text a {
    color: #666cff;
    text-decoration: none;
    font-weight: 500;
}

.m-wrapper__text a:hover {
    text-decoration: underline;
}

.m-wrapper__button {
    background: #666cff !important;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 108, 255, 0.3);
}

/* ОСНОВНАЯ КАРТОЧКА */
.auth-card {
    background: #ffffff !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(102, 108, 255, 0.1) !important;
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 0 auto;
    padding: 25px !important;
}

/* КНОПКИ КАК В АДМИНКЕ - БЕЗ ПРЫЖКОВ И БЕЗ ГРАДИЕНТОВ */
.auth-card .btn {
    --bs-btn-padding-x: 1.375rem !important;
    --bs-btn-padding-y: 0.75rem !important;
    --bs-btn-font-size: 0.9375rem !important;
    --bs-btn-font-weight: 500 !important;
    --bs-btn-line-height: 1.375 !important;
    --bs-btn-border-radius: 0.5rem !important;
    --bs-btn-box-shadow: 0 0.125rem 0.375rem 0 rgba(38, 43, 67, 0.14) !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    letter-spacing: 0.4px !important;
    padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x) !important;
    font-size: var(--bs-btn-font-size) !important;
    font-weight: var(--bs-btn-font-weight) !important;
    line-height: var(--bs-btn-line-height) !important;
    color: var(--bs-btn-color) !important;
    text-align: center !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    user-select: none !important;
    border: var(--bs-btn-border-width, 1px) solid var(--bs-btn-border-color, transparent) !important;
    border-radius: var(--bs-btn-border-radius) !important;
    background-color: var(--bs-btn-bg, transparent) !important;
    box-shadow: var(--bs-btn-box-shadow) !important;
    transition: all 0.2s ease-in-out !important;
    width: 100% !important;
    height: auto !important;
    min-height: 45px !important;
}

/* КНОПКИ 45px - ВХОД И РЕГИСТРАЦИЯ */
.auth-card .btn-primary,
.auth-card .btn-outline-primary {
    height: 45px !important;
    min-height: 45px !important;
}

/* КНОПКИ 34px - СОЦСЕТИ */
.auth-card .btn-telegram,
.auth-card .btn-vk {
    height: 34px !important;
    min-height: 34px !important;
    --bs-btn-padding-y: 0.5rem !important;
}

/* ВОЛНОВОЙ ЭФФЕКТ КАК В АДМИНКЕ */
.auth-card .waves-effect {
    position: relative !important;
    overflow: hidden !important;
    cursor: pointer !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* ЭФФЕКТ ПРИ НАВЕДЕНИИ - ТОЧНО КАК В АДМИНКЕ (без прыжков!) */
.auth-card .btn:hover {
    box-shadow: 0 0.375rem 1rem 0 rgba(38, 43, 67, 0.28) !important;
    filter: brightness(0.95) !important;
}

/* КНОПКА ВХОДА - как btn-primary в админке (БЕЗ ГРАДИЕНТА) */
.auth-card .btn-primary {
    color: #fff !important;
    background-color: #666cff !important;
    border-color: #666cff !important;
}

/* КНОПКА РЕГИСТРАЦИИ - как btn-outline-primary в админке */
.auth-card .btn-outline-primary {
    color: #666cff !important;
    background-color: transparent !important;
    border-color: #666cff !important;
}

/* КНОПКИ СОЦСЕТЕЙ (БЕЗ ГРАДИЕНТОВ) */
.auth-card .btn-telegram {
    color: #fff !important;
    background-color: #27a7e7 !important;
    border-color: #27a7e7 !important;
}

.auth-card .btn-vk {
    color: #fff !important;
    background-color: #0077ff !important;
    border-color: #0077ff !important;
}

/* КРАСИВОЕ ПОЛЕ ПАРОЛЯ С КНОПКОЙ ПОКАЗАТЬ/СКРЫТЬ */
.auth-card .password-field-group {
    position: relative;
    width: 100%;
}

.auth-card .password-field-group .form-control {
    width: 100%;
    border: 2px solid rgba(102, 108, 255, 0.2) !important;
    background: white !important;
    border-radius: 10px !important;
    padding: 14px 50px 14px 16px !important;
    font-size: 15px !important;
    height: 52px !important;
    transition: none !important;
}

.auth-card .password-field-group .form-control:focus {
    border-color: #666cff !important;
    box-shadow: 0 0 0 4px rgba(102, 108, 255, 0.15) !important;
}

/* КНОПКА ГЛАЗА - КРАСИВАЯ И ПРАВИЛЬНАЯ */
.auth-card .password-toggle-btn {
    position: absolute;
    right: 2px;
    top: 2px;
    bottom: 2px;
    width: 48px;
    background: transparent !important;
    border: none !important;
    border-radius: 0 8px 8px 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6c757d !important;
    transition: color 0.15s ease-in-out !important;
    z-index: 5;
    padding: 0;
    margin: 0;
}

.auth-card .password-toggle-btn:hover {
    background: rgba(102, 108, 255, 0.05) !important;
    color: #666cff !important;
}

.auth-card .password-toggle-btn:active {
    background: rgba(102, 108, 255, 0.1) !important;
}

.auth-card .password-toggle-btn i {
    font-size: 18px !important;
    line-height: 1;
}

/* ОБЫЧНЫЕ ПОЛЯ ФОРМЫ */
.auth-card .form-control:not(.password-field-group .form-control) {
    border: 2px solid rgba(102, 108, 255, 0.2) !important;
    background: white !important;
    border-radius: 10px !important;
    padding: 14px 16px !important;
    font-size: 15px !important;
    height: 52px !important;
}

.auth-card .form-control:not(.password-field-group .form-control):focus {
    border-color: #666cff !important;
    box-shadow: 0 0 0 4px rgba(102, 108, 255, 0.15) !important;
}

.auth-card .form-label {
    font-weight: 500 !important;
    font-size: 14px !important;
    margin-bottom: 8px !important;
    color: #444 !important;
}

/* СЕТКА КНОПОК СОЦСЕТЕЙ */
.social-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 1rem;
}

.authentication-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.authentication-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
}

.authentication-image {
    display: none !important;
}

/* DIVIDER */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(102, 108, 255, 0.2);
}

.divider-text {
    padding: 0 15px;
    color: #666cff;
    font-size: 13px;
    font-weight: 500;
}

/* CHECKBOX */
.auth-card .form-check-input:checked {
    background-color: #666cff !important;
    border-color: #666cff !important;
}

/* АДАПТИВ */
@media (max-width: 768px) {
    .auth-card {
        padding: 20px 15px !important;
        margin: 15px !important;
    }

    .beta-badge {
        bottom: 10px;
        right: 10px;
        padding: 5px 12px;
        font-size: 11px;
    }

    .social-buttons-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .m-wrapper-cookies {
        width: 90%;
        bottom: 20px;
    }

    .m-wrapper__wrapper-text {
        flex-direction: column;
        text-align: center;
        padding: 15px;
        gap: 15px;
    }

    .m-wrapper__button {
        width: 100%;
    }
}

/* Анимации для cookies */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

#m-wrapper-cookies-bWqOvmX {
    animation: fadeIn 0.5s ease forwards;
}

/* ========== ОБЩИЙ СТИЛЬ ДЛЯ ВСЕХ ALERTS ========== */
.auth-card .alert {
    all: unset !important;
    border-radius: 12px !important;
    padding: 16px 40px 16px 20px !important;
    margin-bottom: 20px !important;
    position: relative !important;
    animation: slideIn 0.3s ease-out !important;
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    min-height: 60px !important;
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.auth-card .alert i {
    display: none !important;
}

.auth-card .alert small {
    font-size: 13px !important;
    line-height: 1.5 !important;
    opacity: 0.9;
    display: block !important;
    padding-right: 30px !important;
    position: relative !important;
    z-index: 1 !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.auth-card .alert .btn-close {
    position: absolute !important;
    right: 12px !important;
    top: 12px !important;
    width: 12px !important;
    height: 12px !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    z-index: 1 !important;
    background: none !important;
    color: inherit !important;
    border: none !important;
    background-image: none !important;
    --bs-btn-close-bg: none !important;
}

/* Используем SVG для крестика */
.auth-card .alert .btn-close::before {
    content: '' !important;
    width: 12px !important;
    height: 12px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill='currentColor' d='M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z'/%3E%3C/svg%3E") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    display: block !important;
}

.auth-card .alert .btn-close:hover {
    transform: scale(1.1) !important;
    background-color: rgba(0, 0, 0, 0.05) !important;
}

.auth-card .alert .btn-close:active {
    transform: scale(0.95) !important;
}

/* ========== GREEN ALERT (SUCCESS) ========== */
.auth-card .alert.alert-success {
    background: rgba(212, 237, 218, 0.3) !important;
    color: #198754 !important;
}

.auth-card .alert.alert-success .btn-close::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill='%23198754' d='M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z'/%3E%3C/svg%3E") !important;
    opacity: 0.7 !important;
}

.auth-card .alert.alert-success .btn-close:hover::before {
    opacity: 1 !important;
}

.auth-card .alert.alert-success .btn-close:hover {
    background-color: rgba(25, 135, 84, 0.1) !important;
}

/* ========== RED ALERT (DANGER) ========== */
.auth-card .alert.alert-danger {
    background: rgba(248, 215, 218, 0.3) !important;
    color: #dc3545 !important;
}

.auth-card .alert.alert-danger .btn-close::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill='%23dc3545' d='M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z'/%3E%3C/svg%3E") !important;
    opacity: 0.7 !important;
}

.auth-card .alert.alert-danger .btn-close:hover::before {
    opacity: 1 !important;
}

.auth-card .alert.alert-danger .btn-close:hover {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

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

@media (max-width: 768px) {
    .auth-card .alert {
        padding: 14px 35px 14px 20px !important;
        min-height: 55px !important;
    }

    .auth-card .alert .btn-close {
        right: 10px !important;
        top: 10px !important;
        width: 18px !important;
        height: 18px !important;
    }

    .auth-card .alert .btn-close::before {
        width: 10px !important;
        height: 10px !important;
    }

    .auth-card .alert small {
        padding-right: 25px !important;
    }
}

/* ФИКС ДЛЯ УБРАНИЯ BORDER У ALERTS */
.auth-card .alert.alert-success,
.auth-card .alert.alert-danger,
.auth-card .alert.alert-info {
    border: none !important;
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}