/* =============================================== */
/* Kairrosys - AI Automation Solutions Stylesheet  */
/* =============================================== */

/* --- CSS Переменные (Темы) --- */
:root {
    /* Темная тема (по умолчанию) */
    --primary: #3B82F6;
    --secondary: #8B5CF6;
    --dark: #0A0F1C; 
    --darker: #050811; 
    --light: #F8FAFC; 
    --gray: #64748B; 
    --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
    --card-bg: rgba(15, 23, 42, 0.7); 
    --header-bg: rgba(25, 30, 40, 0.65);
    --header-border-glass: rgba(255, 255, 255, 0.1); 
    --toggle-bg: rgba(255, 255, 255, 0.1);
    --btn-icon-hover: rgba(255, 255, 255, 0.1);
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-heavy: rgba(59, 130, 246, 0.3);

    /* УЛУЧШЕННАЯ Светлая тема */
    --l-primary: #3B82F6;
    --l-secondary: #8B5CF6;
    --l-dark: #F8FAFC;
    --l-darker: #FFFFFF;
    --l-light: #020617;
    --l-gray: #334155;
    --l-card-bg: #FFFFFF;
    --l-header-bg: rgba(255, 255, 255, 0.85);
    --l-header-border-glass: rgba(0, 0, 0, 0.08);
    --l-toggle-bg: rgba(0, 0, 0, 0.05);
    --l-btn-icon-hover: rgba(0, 0, 0, 0.05);
    --l-shadow-light: rgba(0, 0, 0, 0.08);
    --l-shadow-heavy: rgba(59, 130, 246, 0.22);
}

/* --- Глобальные стили --- */
html { scroll-behavior: smooth; }
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--darker);
    color: var(--light);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.light-mode {
    --primary: var(--l-primary);
    --secondary: var(--l-secondary);
    --dark: var(--l-dark);
    --darker: var(--l-darker);
    --light: var(--l-light);
    --gray: var(--l-gray);
    --card-bg: var(--l-card-bg);
    --header-bg: var(--l-header-bg);
    --header-border-glass: var(--l-header-border-glass);
    --toggle-bg: var(--l-toggle-bg);
    --btn-icon-hover: var(--l-btn-icon-hover);
    --shadow-light: var(--l-shadow-light);
    --shadow-heavy: var(--l-shadow-heavy);
}

body.light-mode .feature-card,
body.light-mode .flow-step,
body.light-mode .form-container,
body.light-mode .chat-widget,
body.light-mode .mobile-menu-content {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
}

.icon-stroke {
    stroke: currentColor; 
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Фоновые эффекты --- */
.bg-effects {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
}
.particles { position: absolute; width: 100%; height: 100%; }
.particle {
    position: absolute;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 15s infinite linear;
}
body.light-mode .particle { opacity: 0.5; }
.glow {
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.1) 30%, transparent 70%);
    filter: blur(40px);
    animation: pulse 8s infinite alternate;
}
body.light-mode .glow { background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.03) 30%, transparent 70%); }
.glow-1 { top: 10%; left: 10%; }
.glow-2 {
    bottom: 10%; right: 10%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(59, 130, 246, 0.1) 30%, transparent 70%);
}

/* --- Шапка сайта --- */
.desktop-header {
    position: fixed;
    top: 1.5rem; left: 50%;
    transform: translateX(-50%);
    width: auto; 
    padding: 0.8rem 1rem; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(20px) saturate(1.5);
    background: var(--header-bg);
    border-radius: 50px; 
    box-shadow: 0 0 0 1px var(--header-border-glass) inset, 0 10px 40px rgba(0,0,0,0.1);
    transition: all 0.3s;
}
.desktop-header nav ul { display: flex; list-style: none; gap: 1.2rem; }
.desktop-header nav a {
    color: var(--light);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s;
    position: relative;
    white-space: nowrap;
}
.desktop-header nav a:hover { color: var(--primary); }
.desktop-header nav a::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 0;
    width: 0; height: 2px;
    background: var(--gradient);
    transition: width 0.3s;
}
.desktop-header nav a:hover::after { width: 100%; }

.logo {
    font-size: 1.5rem; 
    font-weight: 600;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-right: 1.5rem; 
    margin-left: 0.5rem;
}
.header-actions {
    display: flex;
    gap: 0.75rem; 
    align-items: center;
    margin-left: 1.5rem;
}

/* --- Мобильная шапка и навигация --- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    padding: 1rem 5%;
    justify-content: space-between;
    align-items: center;
    z-index: 1002;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--header-border-glass);
}
.mobile-nav {
    display: none; /* Скрыто до активации JS */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh; height: 100dvh;
    background: rgba(10, 15, 28, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}
body.light-mode .mobile-nav { background: rgba(248, 250, 252, 0.9); }
body.mobile-nav-open .mobile-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: flex; /* ИСПРАВЛЕНО */
}
.mobile-menu-content {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 3rem 2rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--header-border-glass);
}
.mobile-menu-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 24px;
    padding: 1px;
    background: var(--gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    z-index: 0;
    opacity: 0.5;
}
.mobile-nav ul {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.mobile-nav ul li {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.5s ease forwards;
}
body.mobile-nav-open .mobile-nav ul li:nth-child(1) { animation-delay: 0.2s; }
body.mobile-nav-open .mobile-nav ul li:nth-child(2) { animation-delay: 0.25s; }
body.mobile-nav-open .mobile-nav ul li:nth-child(3) { animation-delay: 0.3s; }
body.mobile-nav-open .mobile-nav ul li:nth-child(4) { animation-delay: 0.35s; }
body.mobile-nav-open .mobile-nav ul li:nth-child(5) { animation-delay: 0.4s; }
body.mobile-nav-open .mobile-nav ul li:nth-child(6) { animation-delay: 0.45s; }
.mobile-nav a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--light);
    text-decoration: none;
    padding: 0.75rem;
    display: block;
    transition: color 0.3s, transform 0.3s;
}
.mobile-nav a:hover { color: var(--primary); transform: scale(1.05); }
.mobile-menu-actions {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    opacity: 0;
    animation: fadeIn 0.5s ease 0.5s forwards;
}

nav ul { display: flex; list-style: none; gap: 1.2rem; }
nav a {
    color: var(--light);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s;
    position: relative;
    white-space: nowrap;
}
nav a:hover { color: var(--primary); }
nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s;
}
nav a:hover::after { width: 100%; }
.header-actions {
    display: flex;
    gap: 0.75rem; 
    align-items: center;
    margin-left: 1.5rem;
}

/* --- Кнопки --- */
.btn {
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    outline: none;
    text-decoration: none; 
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    gap: 0.5rem; 
}
.btn-primary {
    background: var(--gradient);
    color: white;
    position: relative;
    overflow: hidden;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--shadow-heavy);
}
.btn-secondary {
    background: var(--toggle-bg);
    color: var(--light);
    border: none;
    padding: 0.6rem 1.2rem;
}
.btn-secondary:hover { background: var(--btn-icon-hover); }
.btn-icon {
    background: transparent;
    border: none;
    color: var(--light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.btn-icon svg { width: 22px; height: 22px; }
.btn-icon:hover { background: var(--btn-icon-hover); }

/* --- Переключатель языка --- */
.lang-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray);
}
.lang-toggle-btn {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    background: var(--toggle-bg);
    border-radius: 20px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}
.lang-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: var(--light);
    border-radius: 50%;
    box-shadow: 0 2px 4px var(--shadow-light);
    transition: transform 0.3s ease;
}
.lang-toggle-btn[aria-checked="true"] .lang-toggle-knob { transform: translateX(18px); }
body.lang-en .lang-toggle-wrap span:first-of-type,
body.lang-ru .lang-toggle-wrap span:last-of-type { 
     color: var(--light);
}
body.lang-en .lang-toggle-wrap span:last-of-type,
body.lang-ru .lang-toggle-wrap span:first-of-type { 
     color: var(--gray);
}

/* --- Секция Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 5% 0; 
    position: relative;
    overflow: hidden;
}
.hero-content { max-width: 600px; z-index: 2; }
.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 2.5rem;
    max-width: 500px;
}
.hero-actions { display: flex; gap: 1rem; }
.hero-actions .btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
body.light-mode .hero-actions .btn-secondary { border-color: rgba(0, 0, 0, 0.2); }
.hero-actions .btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.ai-sphere {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--primary), transparent 50%),
                radial-gradient(circle at 70% 70%, var(--secondary), transparent 50%);
    filter: blur(40px);
    opacity: 0.7;
    animation: rotate 20s infinite linear;
}
body.light-mode .ai-sphere { opacity: 0.3; }
.neural-network {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    width: 500px;
    height: 500px;
    animation: subtle-float 10s ease-in-out infinite;
}
.node {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
}
.connection {
    position: absolute;
    height: 2px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    transform-origin: left center;
    opacity: 0.4;
}

/* --- Общие стили секций --- */
section { padding: 8rem 5%; }
.section-header {
    text-align: center;
    margin-bottom: 5rem;
}
.section-header h2 {
    font-size: 2.5rem;
    font-weight: 600; 
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.section-header p {
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Карточки преимуществ --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.feature-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 20px;
    padding: 1px;
    background: var(--gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    z-index: -1;
    opacity: 0; 
    transition: opacity 0.3s;
}
.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px var(--shadow-heavy);
}
.feature-card:hover::before { opacity: 1; }
.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--light); 
    transition: all 0.3s;
}
body.light-mode .feature-icon {
     background: rgba(0, 0, 0, 0.03);
     border: 1px solid rgba(0, 0, 0, 0.05);
}
.feature-icon svg { width: 32px; height: 32px; }
.feature-card:hover .feature-icon {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px var(--shadow-light);
}
.feature-card h3 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--light); }
.feature-card p { color: var(--gray); }

/* --- Секция "Как это работает" --- */
.visualization { padding-bottom: 8rem; }
.flow-diagram {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}
.flow-step {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 20px;
    width: 250px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 2;
    transition: all 0.3s;
}
.flow-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-heavy);
}
.flow-step svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    stroke: url(#svg-gradient); 
}
.flow-step h3 { color: var(--light); }
.flow-step p { color: var(--gray); font-size: 0.9rem; }
.flow-connector {
    position: absolute;
    height: 2px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    top: 50px;
    left: 25%;
    width: 50%;
    z-index: 1;
}
.flow-connector::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--light);
    border-radius: 50%;
    box-shadow: 0 0 10px 2px var(--light);
    animation: move-dot 4s ease-in-out infinite;
}

/* --- Секция Миссия --- */
.mission {
    text-align: center;
    background: transparent;
    position: relative;
    z-index: 1; 
}
body.light-mode .mission { background: linear-gradient(to bottom, var(--l-darker), var(--l-dark)); }
.mission-content { max-width: 800px; margin: 0 auto; }
.mission h2 { font-size: 2.5rem; margin-bottom: 2rem; font-weight: 600; }
.mission p { font-size: 1.2rem; color: var(--gray); margin-bottom: 3rem; }
.mission-stats { display: flex; justify-content: space-around; margin-top: 4rem; }
.stat-number {
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}
.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- AI Ассистент (Чат) --- */
.ai-assistant { padding-top: 0; }
.chat-widget {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--header-border-glass);
}
.chat-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}
.chat-title { font-weight: 600; color: var(--light); }
.chat-body {
    height: 450px;
    overflow-y: auto;
    padding: 1.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb { background: var(--gray); border-radius: 3px; }
.chat-message {
    padding: 0.75rem 1.25rem;
    border-radius: 16px;
    max-width: 80%;
    line-height: 1.5;
}
.chat-message.ai {
    background: var(--toggle-bg);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}
.chat-message.user {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}
.chat-input-area {
    display: flex;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--header-border-glass);
}
.chat-input-area input {
    flex-grow: 1;
    background: var(--toggle-bg);
    border: 1px solid var(--header-border-glass);
    border-radius: 50px;
    padding: 0.7rem 1.25rem;
    color: var(--light);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
}
.chat-input-area input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}
.chat-input-area .btn-icon {
    flex-shrink: 0;
    background: var(--gradient);
    color: white;
}

/* --- Форма обратной связи --- */
.contact-form { padding-bottom: 8rem; }
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
/* Разрешаем выпадающим элементам выходить за границы формы */
.form-group {
    overflow: visible !important;
    position: relative; /* Важно для z-index */
}

/* Если есть specific класс для группы телефона, поднимаем его */
.form-group:has(#phone) {
    z-index: 50;
}
.form-container label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray);
    font-size: 0.9rem;
    font-weight: 500;
}
.form-container input, .form-container textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    background: var(--toggle-bg);
    border: 1px solid var(--header-border-glass);
    border-radius: 10px;
    color: var(--light);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
}
.form-container input:focus, .form-container textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}
.form-container textarea { resize: vertical; min-height: 120px; }
.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}
.input-with-prefix span {
    position: absolute;
    left: 1rem;
    color: var(--gray);
    pointer-events: none;
}
.input-with-prefix input { padding-left: 2rem; }
.form-container .btn-primary { width: 100%; font-size: 1.1rem; padding: 0.9rem 1.5rem; }
#form-success-message {
    color: #4ade80; 
    font-size: 1.2rem;
    text-align: center;
    padding: 2rem 0;
    font-weight: 600;
}
.form-consent-text {
    font-size: 0.8rem;
    color: var(--gray);
    text-align: center;
    margin-top: 1.5rem;
}
.form-consent-text a { color: var(--primary); text-decoration: none; }
.form-consent-text a:hover { text-decoration: underline; }


/* =============================================== */
/* --- ИСПРАВЛЕННЫЙ ВВОД ТЕЛЕФОНА И СПИСКА --- */
/* =============================================== */

/* 1. КОНТЕЙНЕР. Важно: даем ему высокий z-index, чтобы он был выше поля Telegram */
.phone-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: stretch;
    /* Поднимаем этот блок над остальными полями формы */
    z-index: 1000; 
    background: transparent; /* Сам контейнер прозрачный */
}

/* 2. КНОПКА ФЛАГА */
.country-select {
    position: absolute;
    left: 1px; 
    top: 1px; 
    bottom: 1px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    
    /* Непрозрачный фон, чтобы перекрывать текст под ним */
    background-color: #1e293b !important; 
    
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px 0 0 10px;
    padding: 0 12px;
    min-width: 90px;
    cursor: pointer;
    z-index: 20;
}

/* 3. ВЫПАДАЮЩИЙ СПИСОК */
.country-list {
    position: absolute;
    /* Сдвигаем вниз ровно под поле ввода (высота поля ~50px) */
    top: 55px; 
    left: 0;
    
    /* Делаем список широким, во всю ширину поля */
    width: 300px; 
    
    max-height: 400px;
    overflow-y: auto;
    
    /* САМОЕ ВАЖНОЕ: СПЛОШНОЙ ЦВЕТ ФОНА БЕЗ ПРОЗРАЧНОСТИ */
    background-color: #0b0f19 !important; 
    
    border: 1px solid #334155; /* Рамка посветлее */
    border-radius: 8px;
    
    /* Мощная тень, чтобы отделить от фона сайта */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 1) !important;
    
    /* Скрываем по умолчанию */
    display: none; 
    opacity: 0;
    
    /* Поверх всего */
    z-index: 99999 !important; 
}

/* Класс для показа (добавляется через JS) */
.country-list.show {
    display: block !important;
    opacity: 1 !important;
    animation: fadeInList 0.2s ease-out;
}

/* Анимация появления */
@keyframes fadeInList {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Элемент списка */
.country-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px; /* Чуть больше отступы для пальца */
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff; /* Белый текст */
    font-size: 1rem;
    background-color: #0b0f19; /* Дублируем фон */
}

.country-option:hover {
    background-color: #3b82f6 !important; /* Синий при наведении */
}

/* Инпут телефона */
.phone-input-wrapper input {
    /* Отступ слева, чтобы текст не наезжал на флаг */
    padding-left: 100px !important; 
    position: relative;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.05); /* Легкий фон инпута */
}

/* Скроллбар */
.country-list::-webkit-scrollbar {
    width: 8px;
}
.country-list::-webkit-scrollbar-track {
    background: #0b0f19;
}
.country-list::-webkit-scrollbar-thumb {
    background-color: #475569;
    border-radius: 4px;
}
/* =============================================== */

/* --- Футер --- */
footer {
    padding: 5rem 5% 2rem;
    background: var(--dark);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
body.light-mode footer { border-top-color: rgba(0, 0, 0, 0.08); }
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 3rem;
    margin-bottom: 3rem;
}
.footer-brand { flex: 1; min-width: 300px; }
.footer-logo {
    font-size: 1.8rem;
    font-weight: 600;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}
.footer-description { color: var(--gray); max-width: 300px; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--gray);
    font-size: 0.9rem;
    flex-wrap: wrap; 
    gap: 1.5rem; 
}
body.light-mode .footer-bottom { border-top-color: rgba(0, 0, 0, 0.08); }
.footer-legal-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}
.footer-legal-links a, .footer-email {
    color: var(--gray);
    text-decoration: none;
    transition: color 0.3s;
}
.footer-legal-links a:hover, .footer-email:hover { color: var(--primary); }

/* --- Плавающие иконки соцсетей --- */
.floating-socials {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.floating-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--card-bg);
    border: 1px solid var(--header-border-glass);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    transition: all 0.3s ease;
}
.floating-socials .social-icon {
    width: 26px;
    height: 26px;
    filter: invert(48%) sepia(11%) saturate(1211%) hue-rotate(178deg) brightness(91%) contrast(88%);
    transition: filter 0.3s ease;
}
.floating-socials a:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 20px var(--shadow-heavy);
}
.floating-socials a:hover .social-icon {
    filter: invert(53%) sepia(93%) saturate(1744%) hue-rotate(204deg) brightness(97%) contrast(92%);
}

/* --- Модальное окно с видео --- */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(10, 15, 28, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}
.modal-overlay.visible { display: flex; opacity: 1; }
.modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    transform: scale(0.95);
    transition: transform 0.3s ease-out;
}
.modal-overlay.visible .modal-content { transform: scale(1); }
.modal-close-btn {
    color: var(--gray);
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 36px;
    font-weight: bold;
    transition: color 0.3s, transform 0.3s;
    cursor: pointer;
}
.modal-close-btn:hover { color: var(--light); transform: rotate(90deg); }
.video-player-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid var(--header-border-glass);
    cursor: pointer;
}
#demo-video { width: 100%; display: block; background-color: #000; }
.video-controls {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 10px 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.video-player-wrapper:hover .video-controls, .video-player-wrapper.playing .video-controls { opacity: 1; }
.controls-main { display: flex; align-items: center; gap: 15px; }
.control-btn { background: none; border: none; padding: 0; cursor: pointer; }
.control-btn svg { width: 24px; height: 24px; fill: #fff; transition: transform 0.2s; }
.control-btn:hover svg { transform: scale(1.1); }
.time-display { color: #fff; font-size: 0.9rem; font-weight: 500; }
.volume-wrapper { display: flex; align-items: center; margin-left: auto; }
#volume-slider { -webkit-appearance: none; appearance: none; width: 80px; background: transparent; cursor: pointer; }
#volume-slider::-webkit-slider-runnable-track { background: rgba(255, 255, 255, 0.5); height: 6px; border-radius: 3px; }
#volume-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; margin-top: -5px; background: #fff; height: 16px; width: 16px; border-radius: 50%; box-shadow: 0 0 5px rgba(0,0,0,0.5); }
.progress-bar-wrapper { padding: 5px 0 10px; cursor: pointer; }
.progress-bar { width: 100%; height: 6px; background: rgba(255, 255, 255, 0.3); border-radius: 3px; }
.progress-bar-filled { width: 0%; height: 100%; background: var(--gradient); border-radius: 5px; position: relative; transition: width 0.1s linear; }
.progress-bar-filled::after { content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; background: #fff; border-radius: 50%; box-shadow: 0 0 5px rgba(0,0,0,0.5); }
.video-play-button-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.3); pointer-events: none; opacity: 1; transition: opacity 0.3s; }
.video-player-wrapper.playing .video-play-button-overlay { opacity: 0; }
.video-play-button-overlay svg { width: 80px; height: 80px; fill: rgba(255,255,255,0.8); filter: drop-shadow(0 0 10px rgba(0,0,0,0.5)); transition: transform 0.3s; }
.video-player-wrapper:hover .video-play-button-overlay svg { transform: scale(1.1); }

/* --- Анимации --- */
.animate-group .animate-child {
    opacity: 0;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.animate-from-left { transform: translateX(-30px); }
.animate-from-right { transform: translateX(30px); }
[data-lang-en] { transition: opacity 0.15s ease-out; }
[data-lang-en].lang-fade-out { opacity: 0; }

/* --- Анимации --- */
@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-20px) translateX(15px); }
}
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.1); opacity: 0.8; }
}
@keyframes rotate {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}
@keyframes move-dot {
    0% { left: 0; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}
@keyframes subtle-float {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-55%) scale(1.02); }
    100% { transform: translateY(-50%) scale(1); }
}

/* =============================================== */
/* --- Адаптация (Media Queries) --- */
/* =============================================== */

@media (max-width: 992px) {
    /* Скрываем десктопную шапку и показываем мобильную */
    .desktop-header {
        display: none;
    }
    .mobile-header {
        display: flex;
    }
    .flow-diagram { flex-direction: column; gap: 3rem; align-items: center; }
    .flow-connector { display: none; } 
}

@media (max-width: 768px) {
    .hero { text-align: center; }
    .hero-content { margin: 0 auto; }
    .hero h1 { font-size: 3rem; }
    .hero-actions { justify-content: center; }
    .ai-sphere, .neural-network { display: none; }
    
    .features-grid { grid-template-columns: 1fr; } 
    
    .mission-stats { flex-direction: column; gap: 2rem; }
    .footer-content { flex-direction: column; }
    .footer-bottom { flex-direction: column; text-align: center; }

    /* Иконка закрытия меню */
    #menu-icon-close { display: none; }
    body.mobile-nav-open #mobile-menu-toggle #menu-icon-open { display: none; }
    body.mobile-nav-open #mobile-menu-toggle #menu-icon-close { display: block; }
}

@media (max-width: 480px) {
    .mobile-header { padding: 0.75rem 5%; }
    .logo { font-size: 1.2rem; }
    .btn-icon { width: 36px; height: 36px; }
    .btn-icon svg { width: 18px; height: 18px; }
    
    .hero h1 { font-size: 2.5rem; }
    .form-container, .chat-widget { padding: 1.5rem; }
    .floating-socials { bottom: 1rem; right: 1rem; }
}

/* --- Стили для активной ссылки в навигации --- */
.desktop-header nav a.active {
    color: var(--primary);
}

.desktop-header nav a.active::after {
    width: 100%;
}

.mobile-nav a.active {
    color: var(--primary);
    transform: scale(1.05);
}

/* --- Стильное модальное окно (Notification) --- */
.site-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(5, 8, 17, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.site-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.site-modal-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1), 0 20px 50px rgba(0,0,0,0.5);
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    padding: 2rem;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}
body.light-mode .site-modal-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0,0,0,0.1);
}

.site-modal-overlay.visible .site-modal-card {
    transform: scale(1);
}

.site-modal-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.logo-small {
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo-small::before {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    background: var(--gradient);
    border-radius: 50%;
}

.site-modal-body h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--light);
}

.site-modal-body p {
    color: var(--gray);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.site-modal-footer {
    display: flex;
    justify-content: center;
}

.site-modal-footer .btn {
    min-width: 120px;
}

/* =============================================== */
/* --- SPECIALLY FOR TELEGRAM WEB APP --- */
/* =============================================== */

body.telegram-app .desktop-header,
body.telegram-app footer,
body.telegram-app .floating-socials,
body.telegram-app .bg-effects {
    /* Скрываем десктопные элементы, которые мешают в приложении */
    display: none !important;
}

body.telegram-app .mobile-header {
    /* Фиксируем мобильную шапку */
    position: sticky;
    top: 0;
    background: var(--darker); /* Используем твой родной темный фон */
    border-bottom: 1px solid var(--header-border-glass);
    padding: 0.5rem 1rem;
    z-index: 2000;
}

body.telegram-app .hero {
    /* Убираем лишние отступы сверху для приложения */
    min-height: auto;
    padding-top: 2rem;
    text-align: center;
}

body.telegram-app section {
    padding: 3rem 1rem;
}