/* --- ТЕМЫ И ПЕРЕМЕННЫЕ --- */
.light-theme {
    --bg-main: #ffffff;
    --bg-card: #f6f9ff;
    --border-color: #e2e8f0;
    --text-main: #0b0f19;
    --text-gray: #475569;
    --electric-blue: #0052ff;
    --electric-hover: #0042cc;
    --electric-glow: rgba(0, 82, 255, 0.15);
}

* {
    scroll-behavior: smooth;
}

.dark-theme {
    --bg-main: #0b0f19;
    --bg-card: #151d30;
    --border-color: #222f4c;
    --text-main: #f8fafc;
    --text-gray: #94a3b8;
    --electric-blue: #0052ff;
    --electric-hover: #266fff;
    --electric-glow: rgba(0, 82, 255, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg-main); color: var(--text-main); line-height: 1.6; transition: background 0.3s, color 0.3s; scroll-behavior: smooth; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.max-w-md { max-width: 800px; }
.max-w-sm { max-width: 550px; }
.section { padding: 100px 0; }
.bg-card { background-color: var(--bg-card); }
.accent-text { color: var(--electric-blue); }

.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 16px; }
.section-header p { color: var(--text-gray); font-size: 1.1rem; }

/* HEADER & ВЫРОВНЕННЫЙ ТЕЛЕФОН */
.header { width: 100%; border-bottom: 1px solid var(--border-color); position: fixed; top: 0; left: 0; background-color: rgba(11, 15, 25, 0.2); backdrop-filter: blur(12px); z-index: 100; }
.header-container { display: flex; justify-content: space-between; align-items: center; height: 80px; }
.logo { font-size: 1.5rem; font-weight: 800; cursor: pointer; user-select: none; }
.logo span { color: var(--electric-blue); }
.nav { display: flex; align-items: center; gap: 24px; }
.nav-link { color: var(--text-gray); text-decoration: none; font-weight: 500; transition: color 0.2s; }
.nav-link:hover { color: var(--electric-blue); }

.nav-phone {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center; /* Центрируем иконку по вертикали */
    gap: 8px;
    padding-right: 4px; /* Легкий отступ от кнопки */
    transition: color 0.2s;
}
.nav-phone i {
    display: flex;
    align-items: center;
    width: 18px;
    height: 18px;
}
.nav-phone:hover { color: var(--electric-blue); }

.btn-nav { background: var(--text-main); color: var(--bg-main); text-decoration: none; padding: 10px 20px; border-radius: 8px; font-weight: 600; transition: background 0.2s; }
.btn-nav:hover { background: var(--electric-blue); color: white; }
.btn-theme { background: none; border: 1px solid var(--border-color); color: var(--text-main); cursor: pointer; padding: 8px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }

/* HERO */
.hero { padding-top: 160px; padding-bottom: 100px; min-height: 90vh; display: flex; align-items: center; }
.hero-container { display: flex; align-items: center; gap: 64px; }
.hero-content { flex: 1.2; }
.hero-image { flex: 0.8; display: flex; justify-content: center; filter: drop-shadow(0 10px 20px var(--electric-glow));}
.badge { background: var(--bg-card); border: 1px solid var(--border-color); color: var(--electric-blue); padding: 8px 16px; border-radius: 100px; font-size: 0.85rem; font-weight: 700; display: inline-block; margin-bottom: 24px; }
.hero-content h1 { font-size: 3.8rem; font-weight: 800; line-height: 1.1; margin-bottom: 20px; letter-spacing: -1px; }
.hero-description { font-size: 1.15rem; color: var(--text-gray); margin-bottom: 40px; max-width: 550px; }
.hero-buttons { display: flex; gap: 16px; }


/* КНОПКИ */
.btn-primary, .btn-secondary { padding: 16px 32px; border-radius: 12px; font-weight: 600; text-decoration: none; transition: all 0.2s; display: inline-block; border: none; cursor: pointer; }
.btn-primary { background: var(--electric-blue); color: white; box-shadow: 0 4px 20px var(--electric-glow); }
.btn-primary:hover { background: var(--electric-hover); transform: translateY(-2px); }
.btn-secondary { border: 1px solid var(--border-color); color: var(--text-main); background: transparent; }
.btn-secondary:hover { background: var(--bg-card); }
.btn-full { width: 100%; text-align: center; }
.btn-primary.disabled { background: #cbd5e1; color: #94a3b8; box-shadow: none; pointer-events: none; opacity: 0.4; }

.scooter-placeholder { font-size: 12rem; animation: float 4s ease-in-out infinite; user-select: none; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

/* STEPS */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; margin-top: 20px; }
.step-card { background: var(--bg-main); border: 1px solid var(--border-color); padding: 32px; border-radius: 16px; position: relative; overflow: hidden; }
.step-num { font-size: 3.5rem; font-weight: 900; color: var(--border-color); opacity: 0.3; line-height: 1; margin-bottom: 16px; }
.step-card h3 { font-size: 1.25rem; margin-bottom: 12px; }
.step-card p { color: var(--text-gray); font-size: 0.95rem; }

/* SERVICES GRID */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
.service-card { background: var(--bg-main); padding: 40px; border-radius: 16px; border: 1px solid var(--border-color); transition: transform 0.3s; }
.service-card:hover { transform: translateY(-5px); }
.service-icon { width: 40px; height: 40px; color: var(--electric-blue); margin-bottom: 24px; }

/* KALKULATOR */
/* KALKULATOR - WERSJA PC */
.calc-container { 
    display: flex; 
    gap: 64px; 
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    padding: 50px; 
    border-radius: 24px; 
}
.calc-info { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; /* Spycha total-box na dół pod tekst na PC */
}
.calc-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.calc-form-box { 
    flex: 1.2; 
    background: var(--bg-main); 
    padding: 40px; 
    border-radius: 16px; 
    border: 1px solid var(--border-color); 
}
.total-box { 
    background: var(--electric-blue); 
    color: white; 
    padding: 24px; 
    border-radius: 12px; 
    margin-top: 40px; /* Margines bezpieczeństwa */
}
.total-amount { 
    font-size: 2.5rem; 
    font-weight: 800; 
    display: block; 
}
.form-group { margin-bottom: 24px; }
.form-control { width: 100%; padding: 14px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-main); color: var(--text-main); font-size: 1rem; outline: none; }
.checkbox-group, .radio-group { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.checkbox-label, .radio-label { display: flex; align-items: center; gap: 12px; background: var(--bg-card); padding: 14px; border-radius: 8px; border: 1px solid var(--border-color); cursor: pointer; }
/* DIAGNOSTYKA PO DŹWIĘKU */
.sound-diagnostic-grid { display: flex; flex-direction: column; gap: 12px; max-width: 500px; margin: 0 auto; }
.sound-btn { background: var(--bg-card); border: 1px solid var(--border-color); padding: 16px; border-radius: 12px; color: var(--text-main); font-family: inherit; font-size: 0.95rem; font-weight: 500; text-align: left; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.sound-btn:hover { background: #1e2d4a; border-color: var(--electric-blue); }
.sound-result-box { background: var(--bg-card); border: 1px solid var(--border-color); padding: 24px; border-radius: 12px; margin-top: 30px; text-align: left; animation: fadeIn 0.3s ease-in-out; }
.sound-result-box p { margin-top: 8px; color: var(--text-gray); }

/* STATUS TRACKER */
.inline-form { display: flex; gap: 12px; }
.status-result-card { background: var(--bg-main); border: 1px solid var(--border-color); padding: 30px; border-radius: 16px; margin-top: 30px; text-align: left; }
.status-header-line { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 20px; }
.status-badge { background: #e0f2fe; color: #0369a1; padding: 4px 12px; border-radius: 50px; font-size: 0.8rem; }
.status-timeline { display: flex; justify-content: space-between; margin-top: 20px; position: relative; }
.step { font-size: 0.85rem; color: var(--text-gray); position: relative; }
.step.done { color: #10b981; font-weight: 700; }
.step.active { color: var(--electric-blue); font-weight: 700; }

/* FAQ */
.accordion { display: flex; flex-direction: column; gap: 16px; }
.accordion-item { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; }
.accordion-header { padding: 24px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.accordion-inner { padding: 0 24px 24px 24px; color: var(--text-gray); }
.accordion-item.active .acc-icon { transform: rotate(180deg); color: var(--electric-blue); }

/* MAPA & KONTAKTY */

.contact-info-block { background: var(--bg-main); border: 1px solid var(--border-color); padding: 20px; border-radius: 12px; margin-top: 15px; }
.info-row { display: flex; gap: 12px; align-items: flex-start; text-align: left; }
.contact-link { color: var(--text-main); text-decoration: none; transition: color 0.2s; }
.contact-link:hover { color: var(--electric-blue); }
/* --- СЕТКА ДЛЯ КАРТЫ И КОНТАКТОВ НА ДЕСКTOPE --- */
.contact-section-container {
    display: flex;
    gap: 64px;
    background: var(--bg-card); /* Тот же фоновый цвет */
    border: 1px solid var(--border-color);
    padding: 50px; /* Большие сочные десктопные отступы */
    border-radius: 24px;
    align-items: stretch;
    width: 100%;
}

.contact-info-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.contact-map-side {
    flex: 1.2;
    min-width: 0; /* Железный фикс для Leaflet */
}

.real-map-container {
    width: 100%;
    height: 100%;
    min-height: 380px; /* Чтобы карта была высокой и красивой на ПК */
    border-radius: 16px;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
}

/* FOOTER */
.footer { border-top: 1px solid var(--border-color); padding: 40px 0; text-align: center; color: var(--text-gray); }
.footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.footer-contacts { display: flex; gap: 24px; color: var(--text-gray); font-size: 0.9rem; }
.footer-contacts span { display: flex; align-items: center; gap: 8px; }

/* AI WIDGET CHAT */
.ai-widget { position: fixed; bottom: 30px; right: 30px; z-index: 1000; }
.ai-chat-trigger-btn { background: var(--electric-blue); color: white; border: none; padding: 14px 24px; border-radius: 50px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 24px var(--electric-glow); }
.ai-chat-window { position: absolute; bottom: 70px; right: 0; width: 350px; height: 450px; background: #111827; border: 1px solid #1f2937; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); display: flex; flex-direction: column; overflow: hidden; opacity: 0; pointer-events: none; transform: translateY(20px); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.ai-chat-window.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.ai-chat-header { background: #1f2937; padding: 16px; color: white; display: flex; justify-content: space-between; align-items: center; }
.ai-chat-messages { flex: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.msg-ai, .msg-user { max-width: 80%; padding: 10px 14px; border-radius: 12px; font-size: 0.9rem; }
.msg-ai { background: #1e293b; color: #f3f4f6; align-self: flex-start; }
.msg-user { background: var(--electric-blue); color: white; align-self: flex-end; }
.ai-chat-footer { padding: 12px; border-top: 1px solid #1f2937; display: flex; gap: 8px; background: #0b0f19; }
.ai-chat-footer input { flex: 1; background: #1f2937; border: 1px solid #334155; padding: 10px; border-radius: 8px; color: white; outline: none; }
.ai-chat-footer button { background: var(--electric-blue); border: none; color: white; padding: 10px; border-radius: 8px; cursor: pointer; }

/* --- ADMIN DASHBOARD LAYOUT --- */
.admin-auth-container { height: 100vh; display: flex; justify-content: center; align-items: center; background: #070a13; }
.login-card { background: #111827; border: 1px solid #1f2937; padding: 40px; border-radius: 16px; max-width: 450px; width: 100%; text-align: center; }
.admin-dashboard-layout { display: flex; min-height: 100vh; background: #0f172a; color: #f8fafc; }
.sidebar { width: 260px; background: #1e293b; border-right: 1px solid #334155; padding: 30px 20px; display: flex; flex-direction: column; }
.sidebar-nav { display: flex; flex-direction: column; gap: 8px; margin-top: 40px; flex: 1; }
.sidebar-nav button.sidebar-link { background: none; border: none; width: 100%; text-align: left; cursor: pointer; font-family: inherit; font-size: 1rem; }
.sidebar-link { display: flex; align-items: center; gap: 12px; color: #94a3b8; text-decoration: none; padding: 12px; border-radius: 8px; font-weight: 500; }
.sidebar-link.active, .sidebar-link:hover { background: #334155; color: white; }
.sidebar-footer { font-size: 0.8rem; color: #64748b; }
.admin-main { flex: 1; padding: 40px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #334155; padding-bottom: 20px; }
.db-status { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: #10b981; }
.indicator { width: 8px; height: 8px; background: #10b981; border-radius: 50px; display: inline-block; box-shadow: 0 0 10px #10b981; }
.table-card { background: #1e293b; border-radius: 12px; border: 1px solid #334155; overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table th, .admin-table td { padding: 16px; border-bottom: 1px solid #334155; }
.admin-table th { background: #111827; color: #94a3b8; font-size: 0.85rem; text-transform: uppercase; }
.btn-delete { background: none; border: none; color: #ef4444; cursor: pointer; }
#admin-trigger { cursor: pointer; user-select: none; }

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

/* Базовый стиль для бургера (на десктопе скрыт) */
.btn-burger {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
}
.nav-right-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ==========================================================================
   POLNA ADAPTACJA MOBILNA (FIX DLA SQUASHED HEADER)
   ========================================================================== */
@media (max-width: 768px) {
    .section { padding: 60px 0; }
    .section-header h2 { font-size: 2rem; }

    /* ФИКС ШАПКИ И БУРГЕРА */
    .btn-burger { display: block; } /* Показываем бургер */
    
    .header-container {
        height: 70px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 16px;
    }

    /* Прячем меню за экран по дефолту */
    .nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--bg-main);
        border-top: 1px solid var(--border-color);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 40px 24px;
        gap: 24px;
        transition: left 0.3s ease-in-out;
        z-index: 999;
    }

    /* Класс, который будет добавляться через JS при клике */
    .nav.open {
        left: 0;
    }

    .nav-right-group {
        flex-direction: column;
        gap: 24px;
        width: 100%;
    }
    .nav-phone {
        font-size: 1.1rem;
        justify-content: center;
        width: 100%;
    }
    .btn-nav {
        width: 100%;
        text-align: center;
        padding: 14px;
        font-size: 1rem;
    }

/* HERO BLOCK FIX DLA REALNEJ FOTKI */
.hero { 
    padding-top: 90px; /* Поднимаем весь блок повыше к шапке */
    padding-bottom: 30px; 
    min-height: auto; 
}

.hero-container { 
    flex-direction: column-reverse; /* Картинка будет сверху, текст снизу */
    text-align: center; 
    gap: 15px; 
}

/* ОГРАНИЧИВАЕМ РАЗМЕР САМОЙ КАРТИНКИ */
.hero-image img {
    max-width: 280px; /* Вот тут зажимаем её, чтобы не разносила экран */
    height: auto;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0 10px 20px var(--electric-glow)); /* Добавим электрический неоновый свет под колеса */
}


.hero-content h1 { 
    font-size: 2.1rem; 
    line-height: 1.2;
    margin-bottom: 12px;
}

.hero-description { 
    font-size: 0.95rem; 
    margin-bottom: 24px; 
}

.hero-buttons { 
    flex-direction: column; 
    width: 100%; 
    gap: 12px;
}

    /* ОСТАЛЬНЫЕ БЛОКИ */
    .steps-grid, .services-grid { grid-template-columns: 1fr; gap: 16px; }
    .calc-form-box { padding: 16px; }
    .inline-form { flex-direction: column; }
    .footer-content { flex-direction: column; gap: 16px; }
    .footer-contacts { flex-direction: column; gap: 8px; }
    
    /* ФИКС СЕТКИ ДЛЯ КАРТЫ И КОНТАКТОВ НА МОБИЛКАХ */
    .bg-card .calc-container {
        flex-direction: column; /* Выстраиваем контакты и карту строго в одну колонку */
        padding: 24px;
        gap: 32px; /* Зазор между текстом контактов и картой */
        width: 100%;
    }

    .bg-card .calc-info {
        width: 100%; /* Текстовый блок занимает всю ширину */
    }

/* leaflet fix */

    /* Жесткий адаптивный фикс карты на мобилках */
    .contact-section-container {
        display: flex !important;
        flex-direction: column !important; /* Ультимативно бьем браузер, чтобы он пустил карту вниз */
        gap: 32px !important;
        padding: 20px !important; /* Уменьшаем огромные десктопные паддинги */
        border-radius: 16px !important;
        width: 100% !important;
    }
    
    .contact-info-side {
        width: 100% !important;
    }
    
    .contact-map-side {
        width: 100% !important;
    }
    
    .real-map-container {
        width: 100% !important;
        height: 300px !important;
        min-height: 300px !important;
        display: block !important;
    }
/* ФИКС ИИ-ЧАТА ПОД МОБИЛКИ (МАЛЕНЬКИЙ СПРАВА) */
.ai-widget { 
    bottom: 20px; 
    right: 20px; 
    left: auto; /* Сбрасываем растягивание на весь экран */
    width: auto;
}

.ai-chat-trigger-btn { 
    width: auto; 
    height: 50px;
    width: 50px; /* Делаем кнопку идеально круглой */
    border-radius: 50%;
    padding: 0;
    justify-content: center; /* Центрируем иконку бота */
}

/* Прячем текст внутри круглой кнопки на мобилках, оставляем только иконку */
.ai-chat-trigger-btn span {
    display: none;
}

/* Само окно чата делаем компактным и аккуратным */
.ai-chat-window { 
    width: 320px; /* Фиксированная небольшая ширина */
    max-width: calc(100vw - 40px); /* Чтобы не вылезало за экраны совсем маленьких телефонов */
    bottom: 65px; 
    right: 0;
    height: 400px;
}

/* FIEKTYWNY INTERFEJS KALKULATORA NA SMARTFONY */
.calc-container {
    display: flex !important;
    flex-direction: column !important; /* Wszystko w jedną kolumnę */
    padding: 20px !important;
    gap: 24px !important;
}

.calc-info {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    justify-content: static !important;
}

.calc-text-wrapper {
    order: 1; /* Nagłówek i opis na samej górze */
}

.calc-form-box {
    order: 2; /* Formularz z checkboxami w środku */
    padding: 20px !important;
    width: 100% !important;
}

.total-box {
    order: 3; /* UŻYWAMY ORDER, ABY ZRZUCIĆ KOSZT NA SAM DÓŁ POD FORMULARZ */
    width: 100% !important;
    margin-top: 16px !important;
    padding: 20px !important;
    text-align: center !important;
}
}
