/* ===== ОСНОВНЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 80%;
    min-height: 80vh;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
}

/* Фон для главной страницы */
body.main-page {
    background: url('/local/templates/hf_egpu_flow/images/background.png') no-repeat center center fixed;
    background-size: cover;
}

body.main-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: lightsteelblue;
    z-index: -1;
}

/* ===== ХЕДЕР ===== */
.site-header {
    background: white;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    border-bottom: 3px solid #ff6b35;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.site-header-transparent {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 107, 53, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.site-header-transparent .header-title h1 {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.site-header-unauthorized {
    background: rgba(0, 0, 0, 0.2) !important;
    border-bottom: 1px solid rgba(255, 107, 53, 0.3);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Логотип */
.header-logo {
    flex: 0 0 auto;
}

.header-logo img {
    height: 50px;
    width: auto;
    transition: transform 0.2s;
}

.header-logo img:hover {
    transform: scale(1.05);
}

/* Заголовок страницы по центру */
.header-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}

.header-title h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.5px;
}

/* Меню под шапкой */
.header-menu {
    background: #f8f9fa;
    border-top: 1px solid rgba(255,107,53,0.1);
}

.header-menu-transparent {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.header-menu-transparent .menu-item a {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-menu-transparent .menu-item a i {
    color: #ff6b35;
}

.header-menu-transparent .menu-item.active a {
    color: #ff6b35;
    border-bottom-color: #ff6b35;
}

.menu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Стили для меню */
.menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

.menu-item {
    position: relative;
}

.menu-item a {
    display: block;
    padding: 15px 0;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.menu-item a i {
    margin-right: 8px;
    color: #ff6b35;
    font-size: 14px;
}

.menu-item:hover a {
    color: #ff6b35;
}

.menu-item.active a {
    color: #ff6b35;
    border-bottom-color: #ff6b35;
}

/* Блок пользователя в меню */
.user-menu-item {
    margin-left: auto !important;
}

.menu-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.logout-link {
    color: #a0a0a0 !important;
}

.logout-link:hover {
    color: #ff6b35 !important;
}

/* ===== БЛОК ПОЛЬЗОВАТЕЛЯ (единый стиль) ===== */
.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f9fa;
    padding: 5px 15px 5px 5px;
    border-radius: 40px;
    border: 1px solid rgba(255,107,53,0.2);
    transition: all 0.2s;
}

.header-user:hover {
    border-color: #ff6b35;
    box-shadow: 0 2px 10px rgba(255,107,53,0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ff6b35;
    background: white;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.logout-btn {
    color: #a0a0a0;
    font-size: 16px;
    transition: all 0.2s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: white;
}

.logout-btn:hover {
    color: #ff6b35;
    background: #fff1ed;
    transform: rotate(90deg);
}

/* ===== ФОРМА АВТОРИЗАЦИИ ===== */
.auth-wrapper {
    min-height: calc(100vh - 315px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 40px 35px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    height: 60px;
    width: auto;
    margin-bottom: 25px;
}

.auth-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.auth-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.auth-body {
    margin-bottom: 20px;
}

.auth-error {
    background: #fee2e2;
    border-left: 3px solid #ef4444;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 14px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.auth-form .form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s;
    background: white;
}

.auth-form .form-input:focus {
    border-color: #ff6b35;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

.auth-form .form-checkbox {
    display: flex;
    align-items: center;
}

.auth-form .form-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
    font-weight: normal;
}

.auth-form .form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ff6b35;
}

/* ===== CAPTCHA СТИЛИ ===== */
.captcha-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.captcha-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.captcha-image-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-image-wrapper img {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    max-width: 180px;
    height: auto;
    transition: all 0.2s;
}

.captcha-image-wrapper img:hover {
    border-color: #ff6b35;
}

.captcha-refresh {
    background: none;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    color: #666;
}

.captcha-refresh:hover {
    background: #e9ecef;
    border-color: #ff6b35;
    color: #ff6b35;
}

/* ===== ПАРОЛЬ ===== */
.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.password-toggle:hover {
    opacity: 1;
}

.password-toggle.active {
    opacity: 1;
    color: #ff6b35;
}

/* ===== КНОПКИ ===== */
.auth-btn {
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255,107,53,0.3);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255,107,53,0.5);
    background: linear-gradient(135deg, #ff7b4a 0%, #ff9c6a 100%);
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(255,107,53,0.3);
}

.auth-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== ФУТЕР ===== */
.auth-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.forgot-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #ff6b35;
    text-decoration: underline;
}

.register-link {
    margin-left: 15px;
    padding-left: 15px;
    border-left: 1px solid #ddd;
    color: #ff6b35;
    text-decoration: none;
    font-size: 14px;
}

.register-link:hover {
    text-decoration: underline;
}

/* ===== ПОДВАЛ САЙТА ===== */
.site-footer {
    background: #1e2b3c;
    color: #fff;
    padding: 20px 0;
    border-top: 3px solid #ff6b35;
    margin-top: 40px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-contacts-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    padding: 10px 0;
}

.footer-contacts-row .contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e0e0e0;
    font-size: 14px;
}

.footer-contacts-row .contact-item i {
    color: #ff6b35;
    font-size: 14px;
}

.footer-contacts-row .email-link {
    color: #4a9eff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.footer-contacts-row .email-link:hover {
    border-bottom-color: #4a9eff;
}

.footer-contacts-row .map-link {
    color: white;
    text-decoration: none;
    padding: 5px 12px;
    background: rgba(255,107,53,0.2);
    border-radius: 20px;
    transition: all 0.2s;
}

.footer-contacts-row .map-link:hover {
    background: #ff6b35;
}

.footer-bottom {
    text-align: center;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
    color: #a0b8cc;
}

/* ===== МЕДИА-ЗАПРОСЫ (сгруппированы) ===== */
@media (max-width: 768px) {
    /* Хедер */
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-title {
        position: static;
        transform: none;
        white-space: normal;
    }
    
    .header-title h1 {
        font-size: 18px;
    }
    
    .menu-list {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }
    
    .menu-item a {
        padding: 10px 0;
    }
    
    .menu-item:last-child {
        margin-left: 0;
    }
    
    .user-menu-item {
        margin-left: 0 !important;
        width: 100%;
    }
    
    .user-menu-item .header-user {
        width: 100%;
        justify-content: center;
    }
    
    /* Подвал */
    .footer-contacts-row {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        padding-left: 20px;
    }
    
    .footer-map {
        text-align: center;
    }
    
    .map-button {
        width: 100%;
        max-width: 300px;
    }
    
    /* Авторизация */
    .auth-wrapper {
        min-height: calc(100vh - 400px);
    }
}

@media (max-width: 480px) {
    /* Хедер */
    .header-user {
        padding: 5px 10px 5px 5px;
    }
    
    .user-name {
        display: none;
    }
    
    .header-logo img {
        height: 40px;
    }
    
    /* Авторизация */
    .auth-card {
        padding: 30px 20px;
    }
    
    .auth-logo {
        height: 50px;
    }
    
    .auth-title {
        font-size: 22px;
    }
    
    .captcha-image-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .captcha-image-wrapper img {
        max-width: 100%;
    }
    
    .register-link {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        display: block;
        margin-top: 10px;
    }
}