/* ===== ОСНОВНЫЕ СТИЛИ ===== */
* {
    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: var(--gray-light, #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: var(--white);
    box-shadow: var(--shadow-sm);
    border-bottom: 3px solid var(--header-border);
    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: var(--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 var(--transition-fast, 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: var(--gray-dark);
    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: var(--white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-menu-transparent .menu-item a i {
    color: var(--transparent-menu-icon);
}

.header-menu-transparent .menu-item.active a {
    color: var(--transparent-menu-hover);
    border-bottom-color: var(--transparent-menu-hover);
}

.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: var(--gray-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all var(--transition-fast, 0.2s);
    border-bottom: 2px solid transparent;
}

.menu-item a i {
    margin-right: 8px;
    color: var(--header-menu-icon, var(--accent-primary));
    font-size: 14px;
}

.menu-item:hover a {
    color: var(--header-menu-hover);
}

.menu-item.active a {
    color: var(--header-menu-active);
    border-bottom-color: var(--header-menu-active);
}

/* Блок пользователя в меню */
.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: var(--accent-primary) !important;
}

/* ===== БЛОК ПОЛЬЗОВАТЕЛЯ (единый стиль) ===== */
.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f9fa;
    padding: 5px 15px 5px 5px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--header-user-border);
    transition: all var(--transition-fast, 0.2s);
}

.header-user:hover {
    border-color: var(--header-user-hover-border);
    box-shadow: 0 2px 10px var(--header-user-hover-shadow);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent-primary);
    background: var(--white);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    color: var(--gray-dark);
    font-size: 14px;
}

.logout-btn {
    color: #a0a0a0;
    font-size: 16px;
    transition: all var(--transition-fast, 0.2s);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--white);
}

.logout-btn:hover {
    color: var(--accent-primary);
    background: var(--accent-bg-light);
    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: var(--radius-lg);
    padding: 40px 35px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    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: var(--gray-dark);
    margin: 0 0 8px 0;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--gray-medium);
    margin: 0;
}

.auth-body {
    margin-bottom: 20px;
}

.auth-error {
    background: #fee2e2;
    border-left: 3px solid #ef4444;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    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: var(--gray-dark);
}

.auth-form .form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 2px solid var(--input-border);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: all var(--transition-fast, 0.2s);
    background: var(--white);
}

.auth-form .form-input:focus {
    border-color: var(--input-focus-border);
    outline: none;
    box-shadow: 0 0 0 3px var(--input-focus-shadow);
}

.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: var(--accent-primary);
}

/* ===== CAPTCHA СТИЛИ ===== */
.captcha-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: var(--radius-md);
    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 var(--input-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    max-width: 180px;
    height: auto;
    transition: all var(--transition-fast, 0.2s);
}

.captcha-image-wrapper img:hover {
    border-color: var(--accent-primary);
}

.captcha-refresh {
    background: none;
    border: 2px solid var(--input-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all var(--transition-fast, 0.2s);
    color: var(--gray-medium);
}

.captcha-refresh:hover {
    background: #e9ecef;
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ===== ПАРОЛЬ ===== */
.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 var(--transition-fast, 0.2s);
}

.password-toggle:hover {
    opacity: 1;
}

.password-toggle.active {
    opacity: 1;
    color: var(--accent-primary);
}

/* ===== КНОПКИ ===== */
.auth-btn {
    width: 100%;
    height: 52px;
    background: var(--btn-primary-bg);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal, 0.3s);
    box-shadow: var(--btn-primary-shadow);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--btn-primary-hover-shadow);
    background: var(--btn-primary-hover-bg);
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: var(--btn-primary-shadow);
}

.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 var(--gray-border);
}

.forgot-link {
    color: var(--gray-medium);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition-fast, 0.2s);
}

.forgot-link:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.register-link {
    margin-left: 15px;
    padding-left: 15px;
    border-left: 1px solid #ddd;
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 14px;
}

.register-link:hover {
    text-decoration: underline;
}

/* ===== ПОДВАЛ САЙТА ===== */
.site-footer {
    background: var(--footer-bg);
    color: #fff;
    padding: 20px 0;
    border-top: 3px solid var(--footer-border);
    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: var(--accent-primary);
    font-size: 14px;
}

.footer-contacts-row .email-link {
    color: #4a9eff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all var(--transition-fast, 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 var(--transition-fast, 0.2s);
}

.footer-contacts-row .map-link:hover {
    background: var(--accent-primary);
}

.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;
}

/* ===== КОНТАКТЫ С ТЕЛЕФОНОМ И РЕЖИМОМ РАБОТЫ ===== */
.contact-item.contact-phone {
    align-items: flex-start;
    gap: 8px;
    position: relative;
}

.contact-phone-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Ссылка телефона */
.phone-link {
    color: #4a9eff;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all var(--transition-fast, 0.2s);
    display: inline-block;
}

.phone-link:hover {
    color: var(--footer-phone-hover);
    text-decoration: underline;
    transform: translateX(2px);
}

/* Блок с режимом работы (выпадающая подсказка) */
.work-hours-tooltip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #a0b8cc;
    cursor: help;
    padding: 4px 8px;
    background: rgba(30, 43, 60, 0.8);
    border-radius: 20px;
    transition: all var(--transition-fast, 0.2s);
    position: relative;
    width: fit-content;
}

.work-hours-tooltip i {
    font-size: 11px;
    color: var(--accent-primary);
    transition: transform var(--transition-fast, 0.2s);
}

.work-hours-text {
    border-bottom: 1px dashed #a0b8cc;
    line-height: 1.4;
}

.work-hours-note {
    font-size: 10px;
    color: #8a9cb0;
    margin-left: 4px;
    white-space: nowrap;
}

/* Эффект при наведении на блок режима работы */
.work-hours-tooltip:hover {
    background: rgba(255, 107, 53, 0.15);
    color: var(--accent-primary);
    cursor: help;
}

.work-hours-tooltip:hover i {
    transform: scale(1.1);
    color: var(--accent-primary-light);
}

.work-hours-tooltip:hover .work-hours-text {
    border-bottom-color: var(--accent-primary);
}

/* Дополнительная всплывающая подсказка (native title) - для браузеров без hover */
.work-hours-tooltip[title] {
    position: relative;
}

/* Анимация для мобильных устройств */
@media (hover: hover) {
    .work-hours-tooltip:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ ЭФФЕКТЫ ===== */
/* Анимация появления при загрузке */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-item.contact-phone {
    animation: fadeInUp 0.3s ease-out;
}

/* Стили для интерактивного выделения */
.contact-item.contact-phone:focus-within {
    outline: none;
}

.phone-link:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.work-hours-tooltip:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: 20px;
}

/* Для пользователей, которые предпочитают меньше анимации */
@media (prefers-reduced-motion: reduce) {
    .work-hours-tooltip:hover {
        transform: none;
    }
    
    .contact-item.contact-phone {
        animation: none;
    }
}

.autor {
    color: #a0b8cc;
}

.autor a {
    color: #4a9eff;
    text-decoration: none;
    border-bottom: 1px solid #ccc;
    font-weight: 600;
    transition: var(--transition-fast, 0.5s);
}

.autor a:hover {
    border-bottom: 1px dotted var(--accent-primary);
}

/* ===== МЕДИА-ЗАПРОСЫ (сгруппированы) ===== */
@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);
    }
    
    /* Контакты телефон */
    .contact-item.contact-phone {
        width: 100%;
        flex-direction: row;
        align-items: flex-start;
    }
    
    .contact-phone-wrapper {
        flex: 1;
        gap: 4px;
    }
    
    .phone-link {
        font-size: 16px;
        padding: 4px 0;
    }
    
    .work-hours-tooltip {
        font-size: 11px;
        padding: 2px 6px;
        background: rgba(30, 43, 60, 0.95);
        width: auto;
        max-width: 100%;
        flex-wrap: wrap;
        gap: 2px;
    }
    
    .work-hours-text {
        white-space: normal;
        border-bottom: none;
    }
    
    .work-hours-note {
        white-space: normal;
        display: block;
        margin-left: 0;
        margin-top: 2px;
        font-size: 9px;
    }
    
    .work-hours-tooltip i {
        align-self: flex-start;
        margin-top: 2px;
    }
}

@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;
    }
    
    /* Контакты телефон */
    .contact-item.contact-phone {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .contact-phone-wrapper {
        width: 100%;
        padding-left: 24px;
    }
    
    .phone-link {
        font-size: 15px;
    }
    
    .work-hours-tooltip {
        padding: 3px 8px;
        background: rgba(255, 107, 53, 0.1);
        border-radius: 12px;
    }
    
    .work-hours-tooltip i {
        font-size: 10px;
    }
    
    .work-hours-text {
        font-size: 10px;
    }
}