/* Модальное окно авторизации */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.auth-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.auth-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.auth-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Вкладки */
.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.auth-tab.active {
    color: var(--color-secondary, #ff6b6b);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-secondary, #ff6b6b);
}

/* Формы */
.auth-form h2 {
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-secondary, #ff6b6b);
}

.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--color-secondary, #ff6b6b);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.auth-error {
    margin-top: 15px;
    padding: 12px;
    background: #ffe6e6;
    color: #d32f2f;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.auth-error.show {
    display: block;
}

.hidden {
    display: none;
}

/* Кнопка входа в шапке */
.auth-btn {
    padding: 10px 20px;
    background: var(--color-secondary, #ff6b6b);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

/* Профиль пользователя */
.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: #f5f5f5;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-profile-btn:hover {
    background: #e0e0e0;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--color-secondary, #ff6b6b);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-name {
    font-weight: 600;
    color: #333;
}

.logout-btn {
    padding: 8px 15px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

/* На главной странице шапка тёмная - делаем телефон белым */
body.home-page .nav-contact a.phone-simple,
body.home-page .nav-contact {
    color: white !important;
}

/* Если шапка имеет класс header-transparent или похожий */
.header-transparent .nav-contact a.phone-simple,
.header-transparent .phone-simple {
    color: white !important;
}

/* Улучшенный профиль пользователя */
#auth-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-email {
    font-weight: 600;
    color: white;
    font-size: 14px;
    line-height: 1.2;
}

.user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logout-btn-small {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

/* Для светлой шапки (на внутренних страницах) */
.header:not(.header-transparent) .user-profile-wrapper {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.header:not(.header-transparent) .user-email {
    color: #333;
}

.header:not(.header-transparent) .user-role {
    color: #666;
}

/* Кнопка «Выйти» оформлена в css/buttons.css */
/* Стили для светлой шапки - принудительно */
.header .user-profile-wrapper {
    background: #1f1f24 !important;
    border-color: transparent !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18) !important;
}

.header .user-avatar {
    background: rgba(255, 255, 255, 0.2) !important;
    box-shadow: none !important;
}

.header .user-email {
    color: white !important;
}

.header .user-role {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Кнопки «Выйти» и «Войти» оформлены в css/buttons.css */
.auth-sms-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 11px;
    border: 1px solid #d8d8dc;
    border-radius: 9px;
    background: #fff;
    color: #1d1d1f;
    font-size: 14px;
    cursor: pointer;
}
