@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* === ОСНОВНЫЕ СТИЛИ === */
html { background-color: #ffffff; height: 100%; }

body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, sans-serif;
    color: #333333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #ffffff;
    margin: 0;
    overflow-x: hidden;
}

main { flex: 1; display: block; }

input, textarea, button, select {
    font-family: inherit;
    box-sizing: border-box;
}

/* === ШАПКА === */
.header-top { display: flex; justify-content: space-between; align-items: center; padding: 20px 10%; background: #ffffff; }
.logo img { max-height: 60px; display: block; transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.logo img:hover { transform: scale(1.05); }

.header-contacts { display: flex; align-items: center; gap: 30px; }
.phone-link { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 700; color: #333; text-decoration: none; transition: color 0.3s ease; }
.phone-link:hover { color: #1b5fa7; }

/* Анимация пульсации для иконки телефона */
@keyframes pulsePhone {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); color: #1b5fa7; }
    100% { transform: scale(1); }
}
.phone-link svg { animation: pulsePhone 2.5s infinite ease-in-out; }

.header-buttons { display: flex; gap: 10px; }

/* === НАВИГАЦИЯ === */
.navbar { background: #f8f8f8; border-top: 1px solid #eaeaea; border-bottom: 1px solid #eaeaea; padding: 15px 10%; display: flex; justify-content: center; flex-wrap: wrap; }
.nav-links a { margin: 5px 15px; text-decoration: none; color: #555; font-weight: 500; font-size: 14px; text-transform: uppercase; transition: color 0.3s ease, transform 0.3s ease; display: inline-block; }
.nav-links a:hover { color: #1b5fa7; transform: translateY(-2px); }

/* === КНОПКИ === */
.btn { 
    display: inline-block; background: #1b5fa7; color: white; padding: 12px 24px; border-radius: 6px; 
    text-decoration: none; font-size: 14px; font-weight: 500; border: none; cursor: pointer; 
    transition: background 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease; 
    position: relative; z-index: 10; 
}
.btn:hover { background: #13467b; transform: translateY(-3px); box-shadow: 0 6px 15px rgba(27, 95, 167, 0.3); }
.btn:active { transform: translateY(0); box-shadow: none; }

.btn-dark { background: #0f1f33; }
.btn-dark:hover { background: #071220; box-shadow: 0 6px 15px rgba(15, 31, 51, 0.3); }
.btn-full { width: 100%; font-size: 16px; padding: 15px; }

/* === ГЛАВНЫЙ БАННЕР (HERO) === */
.hero { height: 450px; background: url('https://images.unsplash.com/photo-1517048676732-d65bc937f952?q=80&w=1800&auto=format&fit=crop') center/cover; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.hero-overlay { background: rgba(7, 31, 56, 0.75); padding: 50px; color: white; text-align: center; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; box-sizing: border-box; backdrop-filter: blur(2px); }
.hero h1 { font-size: 48px; margin-bottom: 15px; font-weight: 700; text-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.hero p { font-size: 18px; text-shadow: 0 2px 5px rgba(0,0,0,0.3); }

/* === СЕКЦИИ И КАРТОЧКИ === */
.section { padding: 80px 10%; text-align: center; }
.section h2 { font-size: 32px; text-transform: uppercase; margin-bottom: 50px; font-weight: 700; color: #111; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; text-align: left; }
.card { 
    background: white; overflow: hidden; border: 1px solid #eaeaea; border-radius: 8px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
    position: relative; z-index: 5; 
}
.card:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.card img, .gallery-item img { width: 100%; height: 220px; object-fit: cover; display: block; transition: transform 0.5s ease; }
.card:hover img { transform: scale(1.03); }

.card-content { padding: 25px; }
.card-content h3 { margin-top: 0; font-size: 18px; color: #333; font-weight: 700; }
.card-content a.more-link { color: #1b5fa7; text-decoration: none; font-size: 14px; font-weight: 500; display: inline-block; margin-top: 15px; text-transform: uppercase; letter-spacing: 0.5px; transition: color 0.3s ease; }
.card-content a.more-link:hover { color: #cc0000; }

/* === ПОДВАЛ === */
.footer {
    background: #111111; color: #888; padding: 50px 10%;
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
    border-top: 5px solid #1b5fa7; margin-top: auto; width: 100%; box-sizing: border-box;
    box-shadow: 0 1000px 0 990px #111111; position: relative; z-index: 1;
}
.footer p { margin-top: 0; margin-bottom: 10px; }
.footer p:last-child { margin-bottom: 0; } 
.footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.footer-nav a { color: #888; text-decoration: none; margin-left: 20px; margin-bottom: 5px; font-size: 14px; text-transform: uppercase; transition: color 0.3s ease; }
.footer-nav a:hover { color: #ffffff; }

/* === ВОССТАНОВЛЕННАЯ АДМИН-ПАНЕЛЬ === */
.admin-box { 
    max-width: 650px; margin: 80px auto; background: #ffffff; padding: 50px; 
    border: 1px solid #eaeaea; border-radius: 12px; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.08); text-align: left;
}
.admin-box h1 { margin-top: 0; font-size: 28px; color: #111; margin-bottom: 15px; }
.admin-box h3 { font-size: 18px; color: #1b5fa7; margin-top: 30px; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.admin-box label { display: block; font-size: 14px; font-weight: 500; color: #555; margin-bottom: 8px; }
.admin-box input, .admin-box textarea { 
    width: 100%; padding: 14px; margin-bottom: 20px; border-radius: 6px; 
    border: 1px solid #ddd; background: #fcfcfc; font-size: 15px; 
    transition: border-color 0.3s ease, box-shadow 0.3s ease; 
}
.admin-box input:focus, .admin-box textarea:focus { border-color: #1b5fa7; background: #fff; box-shadow: 0 0 0 3px rgba(27, 95, 167, 0.1); outline: none; }

/* === МОДАЛЬНЫЕ ОКНА (ПОПАПЫ) === */
.modal { 
    display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.6); backdrop-filter: blur(4px); 
    justify-content: center; align-items: center; 
}
.modal-content { 
    background-color: #fff; padding: 45px; border-radius: 12px; width: 100%; max-width: 480px; 
    position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.2); 
    max-height: 85vh; overflow-y: auto; box-sizing: border-box; text-align: left;
}

/* ИСПРАВЛЕНИЕ: Крестик больше не крутится при наведении */
.close-btn { 
    position: absolute; right: 20px; top: 20px; font-size: 28px; color: #aaa; cursor: pointer; 
    line-height: 1; transition: color 0.3s ease; 
}
.close-btn:hover { color: #cc0000; }

.modal h2 { margin-top: 0; margin-bottom: 10px; font-size: 26px; font-weight: 700; color: #111; }
.modal-subtitle { font-size: 13px; color: #777; margin-bottom: 25px; }
.modal label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: #444; }
.modal input, .modal textarea { 
    width: 100%; padding: 14px; margin-bottom: 20px; border-radius: 6px; 
    border: 1px solid #ddd; font-size: 15px; background: #fafafa;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.modal input:focus, .modal textarea:focus { border-color: #1b5fa7; background: #fff; box-shadow: 0 0 0 3px rgba(27, 95, 167, 0.1); outline: none; }

.checkbox-group { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 25px; width: 100%; box-sizing: border-box; }
.checkbox-group input { margin-top: 4px; flex-shrink: 0; width: 16px; height: 16px; cursor: pointer; }
.checkbox-group label { font-size: 13px; color: #555; line-height: 1.5; white-space: normal; overflow-wrap: break-word; font-weight: 400; cursor: pointer; }
.checkbox-group a { color: #1b5fa7; text-decoration: underline; transition: color 0.3s; }
.checkbox-group a:hover { color: #cc0000; }

/* === КНОПКА НАВЕРХ === */
#scrollTopBtn { 
    display: none; position: fixed; bottom: 30px; right: 30px; z-index: 9999; border: none; outline: none; 
    background-color: #1b5fa7; color: white; cursor: pointer; width: 50px; height: 50px; padding: 0; 
    border-radius: 50%; font-size: 18px; box-shadow: 0 6px 15px rgba(0,0,0,0.2); 
    transition: opacity 0.3s ease, background-color 0.3s ease, transform 0.3s ease; 
    display: flex; align-items: center; justify-content: center; 
}
#scrollTopBtn:hover { background-color: #13467b; transform: translateY(-5px); }

/* === АНИМАЦИИ === */
.animate-fade-in { animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-slide-up { animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-scale-in { animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

.hero-overlay h1, .hero-overlay p, .hero-overlay .btn { opacity: 0; animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.hero-overlay h1 { animation-delay: 0.1s; }
.hero-overlay p { animation-delay: 0.3s; }
.hero-overlay .btn { animation-delay: 0.5s; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(50px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* === ТЕКСТОВЫЕ СТРАНИЦЫ И ХЛЕБНЫЕ КРОШКИ === */
.breadcrumbs { font-size: 14px; margin-bottom: 30px; color: #888; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumbs a { color: #888; text-decoration: none; transition: color 0.3s; }
.breadcrumbs a:hover { color: #1b5fa7; }
.breadcrumbs .current-page { color: #1b5fa7; font-weight: 500; cursor: default; }

.text-page-content { text-align: left; max-width: 900px; margin: 0 auto; line-height: 1.7; color: #333; padding-bottom: 60px; font-size: 16px; }
.text-page-content h1 { text-align: center; font-size: 34px; font-weight: 700; margin-bottom: 40px; color: #111; }
.text-page-content h2 { font-size: 20px; text-transform: uppercase; margin-top: 40px; margin-bottom: 15px; font-weight: 700; color: #222; border-bottom: 2px solid #eaeaea; padding-bottom: 10px; }

/* === ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКОВ === */
.lang-switcher { margin-left: 15px; padding: 10px 14px; border: 1px solid #eaeaea; border-radius: 6px; background: #f8f8f8; color: #333; font-size: 14px; font-weight: 500; cursor: pointer; outline: none; transition: border-color 0.3s, box-shadow 0.3s; }
.lang-switcher:hover { border-color: #1b5fa7; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.lang-block { display: none; }
.lang-block.active { display: block; animation: fadeIn 0.6s ease-out; }

/* === СПЕЦРАЗДЕЛЫ === */
.video-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 30px; }
.video-wrapper { position: relative; width: 100%; padding-top: 56.25%; background: #000; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.video-wrapper video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

.gallery-grid { display: flex; gap: 30px; margin-top: 30px; flex-wrap: wrap; justify-content: flex-start; }
.gallery-item { width: 300px; text-align: left; text-decoration: none; }
.gallery-item img { border-radius: 8px; }
.gallery-item p { color: #1b5fa7; margin-top: 15px; font-size: 15px; font-weight: 500; text-align: center; }

.contact-info { margin-bottom: 40px; background: #f8f8f8; padding: 30px; border-radius: 8px; border-left: 4px solid #1b5fa7; }
.map-container { width: 100%; height: 450px; background: #f0f0f0; margin-top: 20px; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 20px rgba(0,0,0,0.05); }


/* ======================================================= */
/* === АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ === */
/* ======================================================= */
@media (max-width: 768px) {
    .header-top { flex-direction: column; padding: 20px 5%; text-align: center; }
    .logo img { margin: 0 auto; }
    .header-contacts { flex-direction: column; width: 100%; gap: 15px; margin-top: 20px; }
    .phone-link { font-size: 24px; justify-content: center; width: 100%; }
    .header-buttons { flex-direction: column; width: 100%; gap: 12px; }
    .btn { width: 100%; text-align: center; padding: 16px 20px; font-size: 16px; border-radius: 8px; }

    .lang-switcher { width: auto !important; margin: 10px auto 0 auto !important; padding: 6px 12px !important; font-size: 13px !important; background: transparent !important; color: #777 !important; border: 1px solid #ddd !important; border-radius: 20px; }

    .navbar { padding: 15px 5%; }
    .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
    .nav-links a { margin: 0; padding: 12px; background: #f2f2f2; border-radius: 6px; font-size: 13px; flex-grow: 1; text-align: center; border: 1px solid #e0e0e0; font-weight: 600; }

    .hero { height: auto; min-height: 400px; }
    .hero-overlay { padding: 40px 20px; }
    .hero h1 { font-size: 32px; margin-bottom: 15px; line-height: 1.2; }
    
    .section { padding: 50px 5%; }
    .section h2 { font-size: 26px; margin-bottom: 30px; }
    .cards { grid-template-columns: 1fr; gap: 25px; }

    .card img, .gallery-item img { width: 100% !important; height: 240px !important; object-fit: cover !important; display: block !important; border-radius: 8px 8px 0 0; }
    .gallery-grid { justify-content: center; gap: 25px; }
    .gallery-item { width: 100%; max-width: none; }
    .gallery-item img { border-radius: 8px; }
    
    .text-page-content { padding-bottom: 40px; font-size: 15px; }
    .text-page-content h1 { font-size: 28px; margin-bottom: 25px; }

    .admin-box { padding: 30px 20px; margin: 40px 5%; }

    .modal { padding: 15px; box-sizing: border-box; }
    .modal-content { padding: 30px 20px; width: 100%; margin: 0; max-height: 85vh; overflow-y: auto; border-radius: 12px; }
    .modal h2 { font-size: 22px; padding-right: 40px; margin-bottom: 20px; }
    .modal input, .modal textarea { padding: 14px; font-size: 16px; margin-bottom: 15px; }

    .close-btn { top: 15px; right: 15px; font-size: 32px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: #f5f5f5; border-radius: 50%; }

    .footer { padding: 40px 5%; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
    .footer-content { flex-direction: column; text-align: center; gap: 25px; }
    .footer-nav { justify-content: center; gap: 10px; width: 100%; }
    .footer-nav a { margin: 0; display: block; width: 100%; padding: 10px 0; border-bottom: 1px solid #222; font-size: 15px; }
}