/* ============================================
   1. CSS ПЕРЕМЕННЫЕ И СБРОС
   ============================================ */
:root {
    --color-primary: #1e3a5f;
    --color-primary-light: #2c5282;
    --color-accent: #0D9488;
    --color-accent-dark: #0F766E;
    --color-bg: #f8f9fa;
    --color-text: #333;
    --color-text-light: #6c757d;
    --color-text-muted: #adb5bd;
    --color-white: #ffffff;
    --color-border: #e9ecef;
    
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    
    --container-max: 1200px;
    --container-padding: 24px;
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    --shadow-sm: 0 2px 15px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 20px rgba(30, 58, 95, 0.06);
    --shadow-lg: 0 10px 40px rgba(30, 58, 95, 0.1);
    --shadow-xl: 0 20px 40px rgba(30, 58, 95, 0.12);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

a { text-decoration: none; color: inherit; transition: color 0.3s ease; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* ============================================
   2. HEADER & NAVIGATION
   ============================================ */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    padding-top: calc(16px + var(--safe-top));
    padding-left: calc(24px + var(--safe-left));
    padding-right: calc(24px + var(--safe-right));
    min-height: 70px;
}

.logo h1 {
    font-size: clamp(18px, 4vw, 22px);
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.logo-sub {
    font-size: 11px;
    color: var(--color-accent);
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav a {
    color: var(--color-primary);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s;
    position: relative;
    padding: 8px 0;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.nav a:hover { color: var(--color-accent); }
.nav a:hover::after { width: 100%; }

.lang-switch {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    min-height: 44px;
    min-width: 44px;
    font-family: inherit;
}

.lang-switch:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-primary);
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

/* ============================================
   3. HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.92), rgba(30, 58, 95, 0.85)),
                url('https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    min-height: 85vh;
    display: flex;
    align-items: center;
    color: white;
    text-align: center;
    padding: 80px 0;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero h2 {
    font-size: clamp(28px, 6vw, 52px);
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.hero p {
    font-size: clamp(16px, 2.5vw, 20px);
    margin-bottom: 40px;
    opacity: 0.95;
    font-weight: 300;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 16px 36px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-family: inherit;
    min-height: 52px;
    touch-action: manipulation;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(13, 148, 136, 0.45);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.btn-secondary:hover {
    background: white;
    color: var(--color-primary);
    border-color: white;
    transform: translateY(-3px);
}

/* ============================================
   4. SECTIONS GENERAL
   ============================================ */
section { padding: clamp(60px, 10vw, 100px) 0; }

.section-title {
    font-size: clamp(28px, 5vw, 38px);
    font-weight: 700;
    text-align: center;
    margin-bottom: clamp(40px, 6vw, 60px);
    color: var(--color-primary);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-dark));
    margin: 18px auto 0;
    border-radius: 2px;
}

/* ============================================
   5. SERVICES & WHY US & ABOUT
   ============================================ */
.services-overview { background: var(--color-white); }

.services-grid, .advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.service-card, .advantage-item {
    background: white;
    padding: clamp(30px, 4vw, 45px) clamp(20px, 3vw, 30px);
    border-radius: 14px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--color-border);
}

.service-card { background: #f8f9fa; }

.service-card:hover, .advantage-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-accent);
}

.advantage-item { border-top: 3px solid transparent; }
.advantage-item:hover { border-top-color: var(--color-accent); }

.service-icon, .advantage-icon {
    font-size: clamp(36px, 5vw, 48px);
    color: var(--color-accent);
    margin-bottom: 20px;
}

.service-card h3, .advantage-item h4 {
    font-size: clamp(18px, 2.5vw, 21px);
    margin-bottom: 12px;
    color: var(--color-primary);
    font-weight: 600;
}

.service-card p, .advantage-item p {
    color: var(--color-text-light);
    font-size: 15px;
    line-height: 1.6;
}

.about-preview { background: white; }

.about-content {
    max-width: 850px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
}

.about-content h2 {
    font-size: clamp(28px, 5vw, 38px);
    color: var(--color-primary);
    margin-bottom: 24px;
    font-weight: 700;
}

.about-content p {
    font-size: clamp(16px, 2vw, 17px);
    color: #495057;
    margin-bottom: 20px;
    line-height: 1.8;
}

/* ============================================
   6. CONTACT SECTION
   ============================================ */
.contact-section {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: clamp(30px, 5vw, 60px);
    align-items: start;
}

.contact-info h3 {
    font-size: clamp(24px, 4vw, 28px);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--color-accent);
    display: inline-block;
}

.info-item {
    padding: 24px;
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-item:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 30px rgba(30, 58, 95, 0.1);
    border-color: var(--color-accent);
}

.info-item strong {
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
}

.info-item strong i {
    color: var(--color-accent);
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.info-item p, .info-item a {
    color: #495057;
    text-decoration: none;
    font-size: 15px;
    margin-left: 36px;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
}

.info-item a { font-weight: 500; transition: color 0.3s; }
.info-item a:hover { color: var(--color-accent); }

/* Форма */
.contact-form-wrapper {
    background: white;
    padding: clamp(25px, 4vw, 45px);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    padding: 16px 20px;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    width: 100%;
    background: #f8f9fa;
    color: var(--color-text);
    min-height: 52px;
    -webkit-appearance: none;
    appearance: none;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    background: white;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--color-text-muted);
}

.contact-form select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231e3a5f' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    padding-right: 45px;
}

.contact-form textarea {
    resize: vertical;
    min-height: 140px;
}

.contact-form .btn-primary {
    width: 100%;
    margin-top: 8px;
}

/* ============================================
   7. STATS BANNER
   ============================================ */
.stats-banner {
    margin-top: clamp(40px, 6vw, 60px);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    border-radius: 16px;
    padding: clamp(30px, 5vw, 50px) clamp(20px, 4vw, 40px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(30, 58, 95, 0.2);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-number {
    font-size: clamp(36px, 5vw, 48px);
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 8px;
    line-height: 1;
}

.stat-text {
    font-size: clamp(14px, 2vw, 16px);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    line-height: 1.4;
}

/* ============================================
   8. FOOTER
   ============================================ */
.footer {
    background: var(--color-primary);
    color: white;
    padding: 30px 0;
    padding-bottom: calc(30px + var(--safe-bottom));
    text-align: center;
}

.footer p {
    margin-bottom: 8px;
    opacity: 0.85;
    font-size: 14px;
    padding: 0 20px;
}

/* ============================================
   9. АДАПТИВНОСТЬ
   ============================================ */

/* Большие десктопы */
@media (max-width: 1280px) {
    .container { max-width: 1140px; }
}

/* Планшеты в портрете */
@media (max-width: 1024px) {
    .container { max-width: 960px; }
    .services-grid, .advantages-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-banner { grid-template-columns: repeat(2, 1fr); }
}

/* Большие телефоны */
@media (max-width: 992px) {
    .contact-wrapper { grid-template-columns: 1fr; gap: 40px; }
    .hero { min-height: 75vh; }
}

/* Средние планшеты */
@media (max-width: 834px) {
    .container { max-width: 768px; }
    .hero h2 { font-size: clamp(26px, 5vw, 42px); }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }

    .nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 30px 24px;
        gap: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .nav.active { transform: translateY(0); }

    .nav a {
        font-size: 18px;
        width: 100%;
        text-align: center;
        padding: 12px 0;
        border-bottom: 1px solid #f1f3f5;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav a:last-of-type { border-bottom: none; }

    .lang-switch {
        width: 100%;
        margin-top: 10px;
    }

    .hero { min-height: 70vh; padding: 60px 0; }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .btn { width: 100%; }

    .info-item p, .info-item a { margin-left: 0; margin-top: 4px; }
    
    .services-grid, .advantages-grid { grid-template-columns: 1fr; }
}

/* Стандартные телефоны (iPhone 14/15/16/17/18, Samsung S21-S24) */
@media (max-width: 430px) {
    .container { padding: 0 16px; }
    
    .header-container {
        padding: 14px 16px;
        padding-top: calc(14px + var(--safe-top));
        padding-left: calc(16px + var(--safe-left));
        padding-right: calc(16px + var(--safe-right));
    }
    
    .hero { min-height: 65vh; padding: 50px 0; }
    
    .hero h2 { font-size: clamp(24px, 7vw, 32px); }
    
    .hero p { font-size: 16px; margin-bottom: 30px; }
    
    .stats-banner { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    
    .stat-number { font-size: clamp(32px, 8vw, 40px); }
    
    .contact-form-wrapper { padding: 24px 20px; }
}

/* Маленькие телефоны (iPhone SE, iPhone 12 mini) */
@media (max-width: 375px) {
    .container { padding: 0 12px; }
    
    .header-container {
        padding: 12px 12px;
        padding-top: calc(12px + var(--safe-top));
        padding-left: calc(12px + var(--safe-left));
        padding-right: calc(12px + var(--safe-right));
    }
    
    .logo h1 { font-size: 16px; }
    .logo-sub { font-size: 10px; }
    
    .hero { min-height: 60vh; padding: 40px 0; }
    .hero h2 { font-size: 24px; }
    .hero p { font-size: 15px; }
    
    .btn { padding: 14px 28px; font-size: 15px; }
    .section-title { font-size: 26px; }
    
    .stats-banner { grid-template-columns: 1fr; gap: 24px; }
    
    .stat-item {
        flex-direction: row;
        justify-content: flex-start;
        gap: 16px;
        text-align: left;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding-bottom: 16px;
    }
    
    .stat-item:last-child { border-bottom: none; padding-bottom: 0; }
    .stat-number { font-size: 36px; min-width: 80px; }
    .stat-text { font-size: 14px; }
    
    .info-item { padding: 20px 16px; }
    .contact-form-wrapper { padding: 20px 16px; }
}

/* Очень маленькие экраны */
@media (max-width: 320px) {
    .container { padding: 0 10px; }
    .hero h2 { font-size: 22px; }
    .hero p { font-size: 14px; }
    .btn { padding: 12px 24px; font-size: 14px; min-height: 48px; }
    .section-title { font-size: 24px; }
    .service-card, .advantage-item { padding: 24px 16px; }
}

/* 4K мониторы */
@media (min-width: 1920px) {
    .container { max-width: 1400px; }
    .hero h2 { font-size: 56px; }
    .hero p { font-size: 22px; }
    .section-title { font-size: 42px; }
    .services-grid, .advantages-grid { gap: 32px; }
    .service-card, .advantage-item { padding: 50px 40px; }
}

@media (min-width: 2560px) {
    .container { max-width: 1600px; }
    .hero h2 { font-size: 64px; }
    .hero p { font-size: 24px; }
}

/* Альбомная ориентация телефонов */
@media (max-height: 500px) and (orientation: landscape) {
    .hero { min-height: auto; padding: 60px 0; }
    .hero h2 { font-size: 28px; margin-bottom: 16px; }
    .hero p { font-size: 16px; margin-bottom: 24px; }
    .nav { top: 60px; }
}

/* Touch устройства */
@media (hover: none) and (pointer: coarse) {
    .btn:active { transform: scale(0.98); }
    .service-card:active, .advantage-item:active { transform: scale(0.98); }
    .info-item:active { transform: translateX(3px); }
}

/* Устройства с мышью */
@media (hover: hover) and (pointer: fine) {
    .btn:hover { transform: translateY(-3px); }
    .service-card:hover, .advantage-item:hover { transform: translateY(-8px); }
}

/* Уменьшенная анимация */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
    body { background-color: #1a1a1a; color: #e0e0e0; }
    .header { background: rgba(30, 30, 30, 0.98); }
    .nav { background: #2a2a2a; }
    .service-card { background: #2a2a2a; }
    .info-item, .contact-form-wrapper { background: #2a2a2a; border-color: #3a3a3a; }
    .contact-form input, .contact-form select, .contact-form textarea { background: #3a3a3a; color: #e0e0e0; border-color: #4a4a4a; }
}

/* Высокая контрастность */
@media (prefers-contrast: high) {
    .btn-primary { border: 2px solid white; }
    .info-item { border-width: 2px; }
}

/* Печать */
@media print {
    .header, .mobile-menu-btn, .lang-switch, .btn { display: none !important; }
    body { background: white; color: black; }
    .hero { min-height: auto; padding: 20px 0; }
}