/* ========== БАЗОВЫЕ СТИЛИ ========== */
:root {
    --bg-primary: #0f1115;
    --bg-secondary: #161b22;
    --bg-card: rgba(20, 25, 35, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --gradient-hero: radial-gradient(circle at top, #1f2a44, #0f1115);
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0f1115 0%, #141923 30%, #1a1f2e 60%, #0f1115 100%);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Декоративные круги на фоне */
body::before {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -150px;
    left: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

section, footer, .container {
    position: relative;
    z-index: 1;
}

/* ========== НАВИГАЦИЯ ========== */
.navbar-custom {
    background: rgba(15,17,21,0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.navbar-brand img {
    height: 40px;
    width: auto;
    margin-right: 12px;
}

/* ========== HERO ========== */
.hero {
    padding: 140px 0 100px;
    text-align: center;
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.hero h1 {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff, #a0c4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-right: 2px solid var(--accent);
    animation: blink 0.8s infinite;
    padding-right: 8px;
    display: inline-block;
}

@keyframes blink {
    0%, 100% { border-color: var(--accent); }
    50% { border-color: transparent; }
}

.hero p {
    font-size: clamp(16px, 2vw, 22px);
    opacity: 0.85;
    max-width: 700px;
    margin: 0 auto 40px;
    color: var(--text-secondary);
}

/* ========== СЕКЦИИ ========== */
.section-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    margin-bottom: 50px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 15px auto 0;
    border-radius: 2px;
}

.card-body h3 {
    color: #f3f4f6;
    font-size: 22px;
    font-weight: 700;
    padding-bottom: 12px;
    border-bottom: 1px solid #374151;
    margin-bottom: 24px;
}

.card-body h5 {
    color: #e5e7eb;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ========== GLASS-КАРТОЧКИ ========== */
.feature-card,
.admin-card,
.card.bg-black, .card.bg-dark, .card,
.device-box,
.download-card,
.accordion-item,
.maintenance-box {
    background: rgba(20, 25, 35, 0.6) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-radius: 18px !important;
}

.feature-card:hover,
.download-card:hover,
.admin-card:hover {
    background: rgba(25, 30, 42, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.feature-card {
    padding: 30px;
    height: 100%;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 8px 30px rgba(59,130,246,0.15);
}

.download-card {
    display: block;
    text-align: center;
    padding: 40px 20px;
    text-decoration: none;
    transition: transform 0.2s, border-color 0.2s;
    color: var(--text-primary);
    height: 100%;
}

.download-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    color: #fff;
}

.download-icon { font-size: 48px; margin-bottom: 20px; }
.download-card h4 { margin: 0; font-size: 22px; font-weight: 600; }

/* ========== ТАРИФЫ ========== */
.tariff-card { position: relative; overflow: hidden; }

.tariff-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent) !important;
    box-shadow: 0 12px 40px rgba(59,130,246,0.2);
}

.tariff-features { list-style: none; padding: 0; margin: 25px 0; }
.tariff-features li { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.06); color: #d1d5db; }
.tariff-features li:last-child { border-bottom: none; }

/* ========== FAQ ========== */
.faq-accordion .accordion-item {
    border-radius: 14px !important;
    overflow: hidden;
}

.faq-accordion .accordion-button {
    background: rgba(20, 25, 35, 0.6) !important;
    color: #fff !important;
    font-weight: 600;
    padding: 20px 24px;
    box-shadow: none !important;
    border: none !important;
    transition: background 0.2s;
}

.faq-accordion .accordion-button:not(.collapsed) {
    background: rgba(30, 36, 48, 0.7) !important;
}

.faq-accordion .accordion-button::after { filter: invert(1); }
.faq-accordion .accordion-button:focus { box-shadow: none !important; }

.faq-accordion .accordion-body {
    background: rgba(15, 20, 27, 0.5);
    color: #aeb7c2;
    line-height: 1.7;
    padding: 24px;
}

/* ========== УСТРОЙСТВА ========== */
.device-box { padding: 60px 40px; }
.device-box h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 700; }
.device-box p { max-width: 760px; margin: auto; font-size: 18px; line-height: 1.8; color: var(--text-secondary); }

/* ========== ФУТЕР ========== */
footer {
    background: #11151c !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 80px;
}

/* ========== АДМИНКА ========== */
.admin-card {
    padding: 30px;
    height: 100%;
    transition: transform 0.2s, border-color 0.2s;
}

.admin-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.admin-card h3 { font-size: 24px; margin-bottom: 15px; }
.admin-card p { color: var(--text-secondary); min-height: 50px; }

/* ========== ФОРМЫ ========== */
.form-control, .form-select, textarea {
    background: rgba(22, 29, 39, 0.6) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: #fff !important;
    border-radius: 12px !important;
    padding: 12px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus, textarea:focus {
    background: rgba(27, 36, 48, 0.7) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.18) !important;
}

.form-control::placeholder, textarea::placeholder { color: #7c8594 !important; }
.form-label { color: #cbd5e1; margin-bottom: 8px; font-weight: 600; }

/* ========== КНОПКИ ========== */
.btn {
    border-radius: 8px !important;
    transition: all 0.15s ease;
    font-weight: 500;
}

.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); opacity: 1; }
.btn:hover { transform: translateY(-1px); }

.btn-sm, .btn-outline-light.btn-sm {
    padding: 4px 12px !important;
    font-size: 13px !important;
    line-height: 1.5;
}

/* ========== ТАБЛИЦЫ ========== */
.table { color: #fff; border-color: rgba(255,255,255,0.06); }
.table thead { background: rgba(23, 29, 39, 0.5); }
.table thead th { border-bottom: 1px solid rgba(255,255,255,0.08) !important; color: #cbd5e1; font-weight: 700; }
.table tbody tr { background: rgba(17, 21, 28, 0.4); transition: background 0.15s; }
.table tbody tr:hover { background: rgba(23, 29, 39, 0.5); }
.table td, .table th { border-color: rgba(255,255,255,0.06) !important; vertical-align: middle; }

/* Строки таблицы — явный тёмный фон */
.admin-compact-table tbody td {
    color: #e8ecf1 !important;
    background: #11151c !important;
}

.admin-compact-table tbody tr {
    background: #11151c !important;
}

.admin-compact-table tbody tr:hover {
    background: #1a202b !important;
}

.admin-compact-table thead th {
    color: #e8ecf1 !important;
    background: #0d1117 !important;
}

/* ========== ПРОЧЕЕ ========== */
a { text-decoration: none; color: var(--accent); transition: color 0.2s; }
a:hover { color: var(--accent-hover); text-decoration: none; }
hr { border-color: rgba(255,255,255,0.08); opacity: 0.5; margin: 40px 0; }
html { scroll-behavior: smooth; }
.sortable-ghost { opacity: 0.4; }

/* ========== СКРОЛЛБАР ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: rgba(59,130,246,0.3); border-radius: 10px; transition: background 0.3s; }
::-webkit-scrollbar-thumb:hover { background: rgba(59,130,246,0.5); }

/* ========== ЧЕКБОКСЫ ========== */
.form-check-label { color: #e5e7eb !important; font-size: 15px; cursor: pointer; padding-left: 4px; }
.form-check-input { background-color: #374151; border-color: #4b5563; cursor: pointer; width: 18px; height: 18px; margin-top: 2px; }
.form-check-input:checked { background-color: var(--accent) !important; border-color: var(--accent) !important; }
.form-check-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.25); }
.form-switch .form-check-input { width: 36px; height: 20px; }
.form-switch .form-check-input:checked { background-color: #10b981 !important; border-color: #10b981 !important; }

/* ========== КНОПКА НАВЕРХ ========== */
.scroll-top-btn {
    position: fixed; bottom: 30px; right: 30px;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--accent); color: #fff;
    border: none; font-size: 20px; cursor: pointer;
    opacity: 0; transition: opacity 0.3s; z-index: 999;
}
.scroll-top-btn.visible { opacity: 1; }

/* ========== АНИМАЦИИ ========== */
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ========== АВАТАРКИ ОТЗЫВОВ ========== */
.review-avatar {
    width: 48px; height: 48px; min-width: 48px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 20px;
}
.review-avatar-small {
    width: 36px; height: 36px; min-width: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}

/* ========== ПОЛУПРОЗРАЧНЫЕ КНОПКИ ========== */
.nav-btn {
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    background: rgba(255,255,255,0.05) !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: #e8ecf1 !important; transition: all 0.2s;
}
.nav-btn:hover { background: rgba(255,255,255,0.12) !important; border-color: rgba(255,255,255,0.25) !important; color: #fff !important; }
.nav-btn.btn-primary { background: rgba(59,130,246,0.3) !important; border-color: rgba(59,130,246,0.4) !important; }
.nav-btn.btn-primary:hover { background: rgba(59,130,246,0.5) !important; }
.nav-btn-admin { background: rgba(244,180,0,0.15) !important; border-color: rgba(244,180,0,0.3) !important; color: #f4b400 !important; }
.nav-btn-logout { background: rgba(231,76,60,0.15) !important; border-color: rgba(231,76,60,0.3) !important; color: #e74c3c !important; }

.footer-btn {
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    background: rgba(255,255,255,0.04) !important;
    border-color: rgba(255,255,255,0.08) !important;
    color: #9aa2b0 !important; transition: all 0.2s;
}
.footer-btn:hover { background: rgba(255,255,255,0.1) !important; border-color: rgba(255,255,255,0.2) !important; color: #e8ecf1 !important; }
.footer-btn i { margin-right: 4px; }

/* ========== МОБИЛЬНАЯ АДАПТАЦИЯ ========== */
@media (max-width: 991px) {
    .navbar-custom .navbar-collapse {
        background: rgba(15,17,21,0.95);
        backdrop-filter: blur(10px);
        border-radius: 12px;
        padding: 16px;
        margin-top: 12px;
        max-height: 80vh;
        overflow-y: auto;
    }
    .nav-btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
        padding: 10px 16px;
        font-size: 14px;
    }
    .navbar-custom .d-flex.gap-2 {
        flex-direction: column;
        width: 100%;
    }
}

/* ========== СЧЁТЧИКИ ========== */
.counter-item {
    padding: 20px;
    background: rgba(20, 25, 35, 0.4);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}
.counter-value {
    font-size: clamp(28px, 5vw, 48px);
    transition: all 0.1s;
}

/* ========== ПОПУЛЯРНЫЙ ТАРИФ ========== */
.popular-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #f4b400, #ff8c00);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    z-index: 1;
}

.card.bg-black .display-6.fw-bold {
    color: #f3f4f6 !important;
}

/* ========== LUCIDE ICONS ========== */
.feature-icon {
    display: inline-block;
    transition: transform 0.3s;
    color: var(--accent);
}
.feature-card:hover .feature-icon { transform: scale(1.1); }
.download-icon i { transition: transform 0.3s; }
.download-card:hover .download-icon i { transform: scale(1.15); }

/* ========== QUIL EDITOR ========== */
.ql-toolbar {
    background: rgba(23, 29, 39, 0.5) !important;
    border-color: rgba(255,255,255,0.1) !important;
    border-radius: 12px 12px 0 0 !important;
}
.ql-toolbar button { color: #e8ecf1 !important; }
.ql-toolbar button:hover { background: rgba(255,255,255,0.1) !important; }
.ql-container {
    background: #11151c !important;
    color: #e8ecf1 !important;
    border-color: rgba(255,255,255,0.1) !important;
    border-radius: 0 0 12px 12px !important;
    font-size: 14px;
}
.ql-editor { color: #e8ecf1 !important; min-height: 250px; }
.ql-stroke { stroke: #e8ecf1 !important; }
.ql-fill { fill: #e8ecf1 !important; }
.ql-picker { color: #e8ecf1 !important; }

/* ========== ЗАГОЛОВКИ СЧЁТЧИКОВ ========== */
.card.bg-dark h6,
.card.bg-dark .card-body h6 {
    color: #e8ecf1 !important;
}

/* ========== УЛУЧШЕНИЯ ДИЗАЙНА ========== */

/* Плавный hover с border-glow */
.feature-card:hover,
.tariff-card:hover,
.admin-card:hover,
.download-card:hover {
    border-color: rgba(59,130,246,0.5) !important;
    box-shadow: 0 0 30px rgba(59,130,246,0.1), 0 8px 32px rgba(0,0,0,0.3);
}

/* Пульсирующая кнопка Telegram */
.hero .btn-primary {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
    70% { box-shadow: 0 0 0 15px rgba(59,130,246,0); }
}

/* Параллакс для Hero */
.hero {
    transform: translateZ(0);
    will-change: transform;
}

/* Точка онлайн */
.online-dot {
    width: 8px; height: 8px;
    background: #10b981;
    border-radius: 50%;
    position: absolute;
    top: 2px; right: 4px;
    animation: onlinePulse 2s infinite;
}

@keyframes onlinePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* Плавная смена темы */
body, .card, .feature-card, .navbar-custom, footer, .btn {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}