:root {
    --primary-red: #EF4A20;
    --dark-black: #1A1A1A;
    --light-grey: #F4F4F4;
    --medium-grey: #CCCCCC;
    --white: #FFFFFF;
    --dark-bg: #121212;
    --surface-card: #1E1E1E;
    --text-main: #FFFFFF;
    --text-muted: #A0A0A0;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    color: var(--dark-black);
    background-color: var(--white);
    scroll-behavior: smooth;
}

/* Эффект Параллакса */
.parallax-hero {
    position: relative;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-align: center;
}

.parallax-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Базовый параллакс */
    filter: brightness(0.4);
}

.hero-content h1 {
    font-size: 4rem;
    letter-spacing: 5px;
    margin-bottom: 10px;
}

/* Кнопки */
.btn {
    padding: 15px 30px;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    transition: 0.3s;
    display: inline-block;
    margin: 10px;
}

.btn-red {
    background-color: var(--primary-red);
    color: var(--white);
}

.btn-red:hover {
    background-color: var(--primary-red);
    transform: translateY(-3px);
}

.btn-outline {
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--dark-black);
}

/* Секция услуг */
.services-section {
    padding: 80px 0;
    background: var(--light-grey);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.service-card {
    background: var(--white);
    padding: 40px;
    border-bottom: 5px solid var(--medium-grey);
    transition: 0.3s;
}

.service-card:hover {
    border-bottom: 5px solid var(--primary-red);
    transform: translateY(-10px);
}

.service-card i {
    font-size: 3rem;
    color: var(--primary-red);
    margin-bottom: 20px;
}


/* Header Styles */
#main-header {
    background: var(--dark-black);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: 0.4s;
    padding: 20px 0;
}

#main-header nav ul li a.active {
    color: var(--primary-red) !important;
    font-weight: bold;
    position: relative;
}

/* Опционально: красивая неоновая полоска под активным пунктом */
#main-header nav ul li a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-red);
    box-shadow: 0 0 8px var(--primary-red); /* Легкое свечение в стиле ваших остальных страниц */
}


.header-scrolled {
    background: var(--dark-black);
    padding: 10px 0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: var(--white);
    text-decoration: none;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.logo-bold {
    color: var(--primary-red);
    font-weight: 900;
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: 0.3s;
}

nav ul li a:hover {
    color: var(--primary-red);
}

.nav-auth {
    border: 1px solid var(--primary-red);
    padding: 8px 18px;
    border-radius: 2px;
}

/* Footer Styles */
.main-footer {
    background: #111;
    color: var(--medium-grey);
    padding: 60px 0 20px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    border-bottom: 1px solid #333;
    padding-bottom: 40px;
}

.footer-info h4, .footer-contact h4 {
    color: var(--white);
    margin-bottom: 20px;
}

.footer-copy {
    text-align: center;
    padding-top: 20px;
    font-size: 0.8rem;
}
/* Виджет чата */
.chat-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(227, 6, 19, 0.4);
    z-index: 2000;
}

.ai-chat-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: none; /* Скрыт по умолчанию */
    flex-direction: column;
    z-index: 2000;
    overflow: hidden;
    border: 1px solid var(--medium-grey);
}

.chat-header {
    background: var(--dark-black);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: var(--white);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Стили для индикатора печати (печатает...) */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px;
    background: #e0e0e0;
    border-radius: 8px;
    width: fit-content;
}
.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #888;
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .ai-chat-container {
        width: 90%;
        right: 5%;
        left: 5%;
        height: 70vh;
        bottom: 80px;
    }
}


.message {
    padding: 10px;
    border-radius: 8px;
    max-width: 80%;
    font-size: 0.9rem;
}

.ai-msg { background: var(--dark-black); align-self: flex-start; }
.user-msg { background: var(--primary-red); color: white; align-self: flex-end; }

.chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid var(--medium-grey);
}

.chat-suggestions {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fafafa;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.chat-suggestions button {
    flex: 0 0 auto;
    border: 1px solid #ddd;
    background: white;
    color: var(--dark-black);
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 0.78rem;
    cursor: pointer;
}

.chat-suggestions button:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.chat-input input {
    flex: 1;
    border: none;
    padding: 10px;
    outline: none;
}



/* Красивые карточки для дашборда и услуг */
.card-glass {
    background: white;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.card-glass:hover {
    transform: translateY(-5px);
}



.service-block {
    position: relative;
    height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.parallax-window {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 120%;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.service-info {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    padding: 50px;
    width: 40%;
    box-shadow: 20px 0 50px rgba(0,0,0,0.2);
}

.service-info.right { margin-left: auto; margin-right: 10%; border-right: 8px solid var(--primary-red); }
.service-info.left { margin-right: auto; margin-left: 10%; border-left: 8px solid var(--primary-red); }

.service-block.inverse { flex-direction: row-reverse; }


/* Общие настройки для всех анимируемых элементов */
.reveal {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.17, 0.67, 0.83, 0.67); /* Более мягкий эффект */
}

/* Начальное положение: вылет СЛЕВА */
.reveal-left {
    transform: translateX(-100px);
}

/* Начальное положение: вылет СПРАВА */
.reveal-right {
    transform: translateX(100px);
}

/* Финальное состояние (когда элемент в поле зрения) */
.reveal.active {
    opacity: 1;
    transform: translateX(0);
}

/* Задержки для последовательного появления карточек */
.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }


/* Hero Section Styles */
.hero {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: var(--dark-black);
    color: white;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 100%);
    z-index: 2;
}

.hero-container {
    position: relative;
    z-index: 3;
}

.hero-content h1 {
    font-size: 5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -2px;
    margin-bottom: 10px;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    color: var(--medium-grey);
    margin-bottom: 30px;
    border-left: 3px solid var(--primary-red);
    padding-left: 20px;
}

/* Кнопка с белой обводкой */
.btn-outline-white {
    padding: 12px 30px;
    border: 2px solid white;
    color: white;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
    margin-left: 15px;
}

.btn-outline-white:hover {
    background: white;
    color: black;
}

/* Красная линия в стиле AMG */
.hero-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--primary-red);
    z-index: 4;
    box-shadow: 0 -5px 15px rgba(227, 6, 19, 0.4);
}

@media (max-width: 768px) {
    .hero-content h1 { font-size: 3rem; }
    .hero-btns { display: flex; flex-direction: column; gap: 15px; }
    .btn-outline-white { margin-left: 0; }
}



.stat-number {
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary-red);
    font-family: 'Montserrat', sans-serif;
    line-height: 1;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--medium-grey);
    font-weight: 700;
}

.stat-item {
    padding: 20px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.stat-item:hover {
    border-color: var(--primary-red);
}

.logo-slider {
    width: 100%;
    position: relative;
    display: flex;
}

.logo-track {
    display: flex;
    width: calc(250px * 10); /* Ширина одного лого * количество */
    animation: scroll 30s linear infinite;
}

.logo-item {
    width: 250px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: #ccc; /* Светло-серый цвет в покое */
    filter: grayscale(100%);
    transition: all 0.4s ease;
    text-transform: uppercase;
}

.logo-item:hover {
    filter: grayscale(0%);
    color: var(--primary-red);
    transform: scale(1.1);
    cursor: default;
}

/* Анимация движения */
@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-250px * 5)); }
}

/* Остановка при наведении */
.logo-slider:hover .logo-track {
    animation-play-state: paused;
}


.work-step {
    max-width: 45%;
}

.work-bubble {
    background: white;
    padding: 30px;
    border-radius: 15px;
    border-bottom-left-radius: 2px; /* Хвостик сообщения слева */
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    position: relative;
    border-left: 5px solid var(--primary-red);
}

.work-bubble.inverse {
    border-left: none;
    border-right: 5px solid var(--dark-black);
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 2px; /* Хвостик сообщения справа */
}

.step-num {
    font-size: 0.8rem;
    font-weight: 900;
    color: var(--primary-red);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.work-bubble h3 {
    margin-bottom: 10px;
    text-transform: uppercase;
    font-size: 1.1rem;
}

.work-bubble p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
}

/* Адаптивность для мобилок */
@media (max-width: 768px) {
    .work-step { max-width: 100%; align-self: center !important; }
    .chat-line { display: none; }
    .work-bubble { border-bottom-left-radius: 15px; }
}


.review-card {
    background: #f1f1f1;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.chat-header {
    background: var(--dark-black);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.avatar {
    width: 35px;
    height: 35px;
    background: var(--primary-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.chat-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.chat-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #e5ddd5; /* Цвет фона WhatsApp */
}

.bubble-msg {
    max-width: 85%;
    padding: 10px 15px;
    font-size: 0.9rem;
    line-height: 1.4;
    border-radius: 10px;
    position: relative;
}

.bubble-msg.incoming {
    align-self: flex-start;
    background: white;
    color: #333;
    border-top-left-radius: 0;
}

.bubble-msg.outgoing {
    align-self: flex-end;
    background: #dcf8c6; /* Цвет исходящего сообщения */
    color: #333;
    border-top-right-radius: 0;
}

.chat-status {
    font-size: 0.7rem;
    color: #888;
    align-self: flex-end;
    margin-top: 5px;
}

/* Кнопки табов */
.tab-btn {
    padding: 12px 30px;
    border: 2px solid var(--dark-black);
    background: transparent;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.tab-btn.active, .tab-btn:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
}

/* Карточки прайса */
.price-card {
    background: white;
    padding: 30px;
    border: 1px solid #eee;
    border-bottom: 4px solid #ddd;
    transition: all 0.4s ease;
}

.price-card.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.95);
}

.price-card.show {
    display: block;
    animation: fadeIn 0.5s forwards;
}

.price-header {
    font-weight: 900;
    font-size: 1.1rem;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.price-value {
    color: var(--primary-red);
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 15px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}



.emergency-dashboard {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 20px;
    padding: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #333;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 20px rgba(227, 6, 19, 0.2);
}

/* Декоративная красная подсветка сверху */
.emergency-dashboard::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: var(--primary-red);
    box-shadow: 0 0 15px var(--primary-red);
}

.emergency-main { max-width: 60%; }

.emergency-badge {
    color: var(--primary-red);
    text-transform: uppercase;
    font-weight: 900;
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.emergency-dashboard h2 {
    color: white;
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.emergency-dashboard p {
    color: #aaa;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Кнопка экстренной связи */
.emergency-btn {
    display: inline-block;
    background: var(--primary-red);
    color: white;
    padding: 18px 40px;
    text-decoration: none;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 4px;
    transition: 0.3s;
    box-shadow: 0 10px 20px rgba(227, 6, 19, 0.3);
}

.emergency-btn:hover {
    background: var(--primary-red);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(227, 6, 19, 0.5);
}

/* Стили "Спидометра" */
.emergency-gauge {
    text-align: center;
    min-width: 250px;
}

.gauge-container {
    position: relative;
    width: 180px;
    margin: 0 auto 15px;
}

.gauge-svg { transform: rotate(-90deg); }

.gauge-base {
    fill: none;
    stroke: #333;
    stroke-width: 8;
}

.gauge-progress {
    fill: none;
    stroke: var(--primary-red);
    stroke-width: 8;
    stroke-dasharray: 283;
    stroke-dashoffset: 70; /* Это создает эффект заполнения круга */
    stroke-linecap: round;
    filter: drop-shadow(0 0 5px var(--primary-red));
}

.gauge-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
}

.gauge-value {
    color: white;
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
}

.gauge-unit {
    color: var(--primary-red);
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
}

.gauge-label {
    color: #888;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

@media (max-width: 992px) {
    .emergency-dashboard { flex-direction: column; text-align: center; padding: 40px 20px; }
    .emergency-main { max-width: 100%; margin-bottom: 40px; }
}



.before-after-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 500px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border: 1px solid #ddd;
}

.before-after-container .img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
}

.foreground-img {
    width: 50%; /* Это значение будет менять JS */
    z-index: 2;
}

/* Подписи */
.label {
    position: absolute;
    bottom: 20px;
    padding: 8px 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 1px;
}
.before { left: 20px; }
.after { right: 20px; }

/* Кастомный Input Range (невидимый, но функциональный) */
.slider {
    position: absolute;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 100%;
    background: transparent;
    outline: none;
    margin: 0;
    transition: all .2s;
    z-index: 10;
    cursor: ew-resize;
}

/* Линия разделителя */
.slider-line {
    position: absolute;
    top: 0; bottom: 0; left: 50%;
    width: 4px;
    background: var(--primary-red);
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 0 15px rgba(227, 6, 19, 0.5);
}

/* Кнопка на линии */
.slider-button {
    position: absolute;
    top: 50%; left: 50%;
    width: 40px; height: 40px;
    background: var(--primary-red);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 6;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid white;
}

.slider-button::before {
    content: '↔';
    color: white;
    font-weight: bold;
}


/* Карточки статистики */
.stat-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 900;
}

/* Основная кнопка действия */
.btn-main-action {
    display: inline-block;
    background: var(--primary-red);
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 4px;
    transition: 0.3s;
}

.btn-main-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(227, 6, 19, 0.4);
}

/* Карточки тикетов */
.ticket-item {
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 15px;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s;
}

.ticket-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary-red);
}

.ticket-date {
    font-size: 0.8rem;
    color: var(--primary-red);
    font-weight: 700;
}

.ticket-info h3 {
    margin: 5px 0;
    font-size: 1.3rem;
}

.ticket-info p {
    color: #aaa;
    font-size: 0.9rem;
    margin: 0;
}

/* Статус-бейдж */
.status-badge {
    padding: 6px 15px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 10px;
    text-align: center;
}

.status-process { background: rgba(255, 193, 7, 0.2); color: #ffc107; border: 1px solid #ffc107; }
.status-done { background: rgba(40, 167, 69, 0.2); color: #28a745; border: 1px solid #28a745; }

.btn-view {
    display: block;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    text-align: center;
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 2px;
    transition: 0.3s;
}

.btn-view:hover { color: var(--primary-red); }

@media (max-width: 768px) {
    .ticket-item { flex-direction: column; align-items: flex-start; gap: 20px; }
}


/* Кнопка SOS в стиле тревожной кнопки */
.btn-sos {
    width: 100%;
    background: #222;
    border: 2px solid var(--primary-red);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-sos::before {
    content: '';
    position: absolute;
    width: 100%; height: 100%;
    background: var(--primary-red);
    opacity: 0.1;
    top: 0; left: 0;
    animation: sos-pulse 2s infinite;
}

@keyframes sos-pulse {
    0% { transform: scale(1); opacity: 0.2; }
    100% { transform: scale(1.5); opacity: 0; }
}

.sos-icon { font-size: 1.5rem; }
.sos-title { display: block; color: white; font-weight: 900; font-size: 1.1rem; }
.sos-desc { color: var(--primary-red); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }

/* Загрузка фото объекта */
.object-photo-placeholder {
    width: 100%;
    height: 150px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    cursor: pointer;
    transition: 0.3s;
}

.object-photo-placeholder:hover {
    border-color: var(--primary-red);
    color: white;
    background: rgba(255, 255, 255, 0.02);
}

/* Список документов */
.doc-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.doc-item i { color: var(--primary-red); font-size: 1.2rem; }
.doc-name { display: block; font-size: 0.85rem; color: #ccc; }
.doc-link { font-size: 0.75rem; color: var(--primary-red); text-decoration: none; font-weight: 700; }
.doc-link:hover { text-decoration: underline; }



/* Адаптив для Личного Кабинета */
@media (max-width: 992px) {
    /* Переводим сетку из 2 колонок в 1 */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Боковая панель (SOS, Фото, Документы) теперь идет после основного контента */
    .sidebar-content {
        order: 2;
    }

    .main-content {
        order: 1;
    }

    /* Уменьшаем размер заголовка на мобильных */
    .db-header h1 {
        font-size: 1.8rem !important;
    }
}

@media (max-width: 576px) {
    /* Сетка статистики: делаем в одну колонку на очень узких экранах */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    /* Карточка тикета: делаем вертикальной */
    .ticket-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .ticket-meta {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid rgba(255,255,255,0.05);
        padding-top: 15px;
    }

    .btn-view {
        width: auto;
    }
}


/* Прогресс-бар */
.progress-bar-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
}

.progress-line {
    position: absolute;
    top: 50%; left: 0; width: 0%; height: 2px;
    background: var(--primary-red);
    z-index: 1;
    transition: 0.4s;
}

.steps-circles {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 30px; height: 30px;
    background: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 900;
}

.step-circle.active {
    background: var(--primary-red);
    box-shadow: 0 0 10px var(--primary-red);
}

/* Карточки выбора типа оборудования */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.type-card input { display: none; }

.card-content {
    background: rgba(255,255,255,0.05);
    border: 2px solid transparent;
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
}

.type-card input:checked + .card-content {
    border-color: var(--primary-red);
    background: rgba(227, 6, 19, 0.1);
}

.card-content i { font-size: 2rem; display: block; margin-bottom: 10px; color: #666; }
.type-card input:checked + .card-content i { color: var(--primary-red); }

/* Поля ввода */
.input-group label { display: block; font-size: 0.8rem; color: #888; margin-bottom: 8px; text-transform: uppercase; }
.input-group input, .input-group textarea {
    width: 100%;
    background: #222;
    border: 1px solid #444;
    padding: 12px;
    color: white;
    border-radius: 5px;
    outline: none;
}

.input-group input:focus { border-color: var(--primary-red); }

/* Кнопки навигации */
.btn-next, .btn-submit {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 12px 35px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
}

.btn-back {
    background: transparent;
    border: 1px solid #555;
    color: #888;
    padding: 12px 35px;
    cursor: pointer;
}

/* Срочность */
.emergency-notice {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #ffc107;
    font-size: 0.9rem;
}


/* Админские виджеты */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.admin-stat-card {
    background: #151515;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid #222;
}

.admin-stat-card.urgent {
    border-color: var(--primary-red);
    background: linear-gradient(135deg, #151515 0%, #2a0507 100%);
}

.admin-stat-card i { font-size: 2rem; color: var(--primary-red); }

.stat-info .label { display: block; color: #666; font-size: 0.8rem; text-transform: uppercase; }
.stat-info .value { font-size: 2rem; font-weight: 900; color: white; }

/* Таблица */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #111;
    border: 1px solid #222;
}

.admin-table th, .admin-table td {
    padding: 18px;
    text-align: left;
    border-bottom: 1px solid #222;
}

.admin-table th {
    background: #1a1a1a;
    color: #888;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.admin-table tr:hover { background: #181818; }
.row-urgent { background: rgba(227, 6, 19, 0.05); }

/* Бейджи */
.badge-urgent { color: var(--primary-red); font-weight: 900; text-transform: uppercase; font-size: 0.7rem; }
.badge-normal { color: #555; font-weight: 900; text-transform: uppercase; font-size: 0.7rem; }

/* Кастомный селект */
.status-select {
    background: #222;
    color: white;
    border: 1px solid #444;
    padding: 5px 10px;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
}

/* Индикатор работы */
.pulse-dot {
    height: 10px; width: 10px;
    background-color: #28a745;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
    box-shadow: 0 0 8px #28a745;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}


.admin-layout {
    display: flex;
    min-height: 100vh;
    background: #0a0a0a;
}

.admin-sidebar {
    width: 260px;
    background: #111111;
    border-right: 1px solid #222;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    padding: 25px 20px;
    border-bottom: 1px solid #222;
    color: #fff;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.sidebar-brand .logo-bold {
    color: var(--primary-red);
    font-weight: 900;
}

.terminal-status {
    font-size: 0.65rem;
    color: #444;
    margin-top: 5px;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #a0a0a0;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.sidebar-menu li.active a,
.sidebar-menu a:hover {
    color: #fff;
    background: rgba(227, 27, 35, 0.05);
    border-left: 4px solid var(--primary-red);
    padding-left: 16px; /* Компенсация бордера */
}

.sidebar-menu i {
    width: 25px;
    font-size: 1.1rem;
}

.badge-count {
    background: var(--primary-red);
    color: white;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: bold;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #222;
}

.btn-logout {
    display: flex;
    align-items: center;
    color: var(--primary-red);
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-logout:hover {
    color: #ff3333 !important;
    transform: translateX(3px);
}



/* ================= STYLES FOR SPECIALIST TERMINAL ================= */
.task-table {
    width: 100%;
    border-collapse: collapse;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #222;
    margin-top: 15px;
}

.task-table th {
    background: #161616;
    color: #888;
    text-align: left;
    padding: 15px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-table td {
    padding: 15px;
    border-top: 1px solid #222;
    font-size: 0.95rem;
    vertical-align: middle;
}

.task-row {
    transition: background 0.2s ease;
}

.task-row:hover {
    background: #151515;
}

/* Бэйджи срочности */
.badge {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
}
.badge.emergency {
    background: rgba(227, 27, 35, 0.15);
    color: var(--primary-red);
    border: 1px solid rgba(227, 27, 35, 0.3);
}
.badge.urgent {
    background: rgba(255, 153, 0, 0.15);
    color: var(--primary-red);
    border: 1px solid rgba(255, 153, 0, 0.3);
}
.badge.normal {
    background: #222;
    color: #aaa;
    border: 1px solid #333;
}

/* Формы обратной связи инженера */
.status-form {
    background: #111;
    border: 1px solid #222;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.status-form select, 
.status-form textarea {
    width: 100%;
    background: #161616;
    border: 1px solid #333;
    padding: 12px;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    box-sizing: border-box;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
}

.status-form select:focus, 
.status-form textarea:focus {
    border-color: var(--primary-red);
    outline: none;
}

/* Responsive stabilization */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

img,
video,
canvas,
iframe {
    max-width: 100%;
}

table {
    max-width: 100%;
}

input,
select,
textarea,
button {
    max-width: 100%;
    font: inherit;
}

.container {
    width: min(100%, 1200px);
}

.admin-main-content {
    min-width: 0;
}

.admin-table,
.task-table,
.users-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table thead,
.admin-table tbody,
.task-table thead,
.task-table tbody,
.users-table thead,
.users-table tbody {
    min-width: 760px;
}

.admin-table th,
.admin-table td,
.task-table th,
.task-table td,
.users-table th,
.users-table td {
    overflow-wrap: anywhere;
}

.filter-container,
.tabs-container,
.header-actions,
.filter-buttons,
.notification-actions,
.slot-actions {
    max-width: 100%;
}

@media (max-width: 992px) {
    #main-header {
        position: sticky;
        padding: 14px 0;
    }

    .header-flex {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .logo a {
        font-size: 1.25rem;
        letter-spacing: 1px;
    }

    nav {
        width: 100%;
    }

    nav ul {
        flex-wrap: wrap;
        gap: 8px;
        padding: 0;
    }

    nav ul li {
        margin-left: 0;
    }

    nav ul li a {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 36px;
        padding: 8px 10px;
        border-radius: 8px;
        background: rgba(255,255,255,0.04);
        font-size: 0.78rem;
        line-height: 1.2;
    }

    #main-header nav ul li a.active::after {
        display: none;
    }

    .hero,
    .parallax-hero {
        min-height: 620px;
        height: auto;
        padding: 120px 0 70px;
    }

    .parallax-bg,
    .parallax-window {
        background-attachment: scroll;
    }

    .hero-content h1 {
        font-size: 3rem;
        letter-spacing: 0;
    }

    .hero-content p {
        font-size: 1rem;
        max-width: 100%;
    }

    .service-block {
        height: auto;
        min-height: 520px;
        padding: 70px 20px;
    }

    .service-info,
    .service-info.left,
    .service-info.right {
        width: min(100%, 620px);
        margin: 0 auto;
        padding: 32px;
        box-shadow: 0 15px 35px rgba(0,0,0,0.18);
    }

    .footer-grid,
    .main-footer .container {
        grid-template-columns: 1fr !important;
    }

    .emergency-dashboard {
        border-radius: 12px;
    }

    .before-after-container {
        height: auto;
        aspect-ratio: 16 / 10;
    }

    .tabs-container,
    .filter-container,
    .filter-buttons {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
        padding-bottom: 4px;
    }

    .tab-btn,
    .filter-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .admin-container,
    .admin-dashboard,
    .admin-users,
    .specialists-page,
    .calendar-page,
    .ticket-page,
    main.admin-main-content {
        padding: 34px 14px 44px !important;
    }

    .admin-container > .container,
    .admin-main-content > .container,
    .admin-users > .container,
    .specialists-page > .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .page-header,
    .tickets-header,
    .dashboard-header,
    .ticket-header,
    .calendar-header {
        min-width: 0;
        color:#ffffff;
    }

    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero,
    .parallax-hero {
        min-height: 560px;
        padding-top: 96px;
    }

    .hero-content h1 {
        font-size: 2.35rem;
        line-height: 1.05;
    }

    .hero-content p {
        border-left-width: 2px;
        padding-left: 14px;
    }

    .hero-btns,
    .btn,
    .btn-main-action,
    .emergency-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .btn,
    .btn-outline-white {
        margin-left: 0;
        margin-right: 0;
        padding-left: 18px;
        padding-right: 18px;
    }

    .services-section,
    .form-wrapper {
        padding: 42px 0;
    }

    .service-card,
    .price-card,
    .work-bubble {
        padding: 22px;
    }

    .service-info,
    .service-info.left,
    .service-info.right {
        padding: 24px;
        border-left-width: 4px;
        border-right-width: 4px;
    }

    .stats-grid,
    .admin-stats-grid,
    .spec-stats,
    .stats-row,
    .services-grid,
    .type-grid,
    .specialists-grid,
    .admin-form,
    .calendar-layout,
    .ticket-layout,
    .action-grid {
        grid-template-columns: 1fr !important;
    }

    .panel,
    .calendar-panel,
    .tickets-section,
    .form-container,
    .notification-card,
    .specialist-card,
    .users-table-container,
    .search-section {
        max-width: 100%;
    }

    .ticket-item,
    .doc-item,
    .emergency-notice {
        align-items: flex-start;
    }

    .ai-chat-container {
        width: calc(100vw - 24px);
        height: min(70vh, 520px);
        left: 12px;
        right: 12px;
        bottom: 82px;
    }

    .chat-toggle-btn {
        width: 54px;
        height: 54px;
        right: 16px;
        bottom: 18px;
    }
}

@media (max-width: 520px) {
    #main-header {
        padding: 10px 0;
    }

    .header-flex {
        gap: 10px;
    }

    .logo a {
        font-size: 1.03rem;
        letter-spacing: 0;
    }

    nav ul {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    nav ul li a {
        width: 100%;
        justify-content: center;
        text-align: center;
        font-size: 0.72rem;
        padding: 8px 6px;
    }

    .hero,
    .parallax-hero {
        min-height: 520px;
        padding: 84px 0 52px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 0.94rem;
    }

    .stat-number {
        font-size: 2.6rem;
    }

    .service-block {
        min-height: 460px;
        padding: 48px 14px;
    }

    .service-info,
    .service-info.left,
    .service-info.right,
    .emergency-dashboard {
        padding: 20px;
    }

    .emergency-dashboard h2 {
        font-size: 1.75rem;
    }

    .gauge-container {
        width: 150px;
    }

    .gauge-value {
        font-size: 2.6rem;
    }

    .before-after-container {
        aspect-ratio: 4 / 3;
        border-radius: 10px;
    }

    .label {
        bottom: 12px;
        font-size: 0.68rem;
        padding: 6px 10px;
    }

    .admin-table th,
    .admin-table td,
    .task-table th,
    .task-table td,
    .users-table th,
    .users-table td {
        padding: 12px;
        font-size: 0.82rem;
    }

    .modal-content {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 32px);
        overflow-y: auto;
        padding: 20px;
    }

    .modal-buttons,
    .header-actions,
    .notification-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .modal-buttons > *,
    .header-actions > *,
    .notification-actions > * {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    nav ul li a {
        font-size: 0.68rem;
    }

    .hero-content h1 {
        font-size: 1.78rem;
    }

    .btn,
    .btn-main-action,
    .emergency-btn,
    .btn-submit,
    .btn-next,
    .btn-back {
        padding-left: 14px;
        padding-right: 14px;
    }
}
