/* ==========================================================================
   Дизайн-система Прокоопа Анатольевича (Bio-Tech Dark Mode)
   ========================================================================== */

:root {
  /* Цветовая палитра - Темная тема по умолчанию */
  --bg-main: #07160F;
  --bg-gradient-end: #0c1813;
  --bg-alt: #0a1c13;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-inverse: #07160F;
  
  --primary: #10B981;
  --primary-hover: #34D399;
  --primary-glow: rgba(16, 185, 129, 0.3);
  
  --accent: #D97706;
  --accent-hover: #F59E0B;
  --accent-glow: rgba(217, 119, 6, 0.3);
  
  --glass-bg: rgba(15, 33, 26, 0.65);
  --glass-border: rgba(16, 185, 129, 0.12);
  --glass-border-hover: rgba(16, 185, 129, 0.25);
  --glass-shadow: rgba(0, 0, 0, 0.4);
  
  --msg-user: #0e3b2b;
  --msg-bot: rgba(25, 48, 38, 0.8);

  --nav-bg: rgba(7, 22, 15, 0.8);
  --nav-bg-scrolled: rgba(7, 22, 15, 0.95);
  --nav-border: rgba(16, 185, 129, 0.08);
  --nav-border-scrolled: rgba(16, 185, 129, 0.15);
  
  /* Шрифты и скругления */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Manrope', var(--font-sans);
  --font-numeric: 'Outfit', var(--font-sans);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Светлая тема (Bio-Tech Light Mode)
   ========================================================================== */

body.light-theme {
  --bg-main: #F8FAFC;
  --bg-gradient-end: #F1F5F9;
  --bg-alt: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-inverse: #FFFFFF;
  
  --primary: #059669;
  --primary-hover: #10B981;
  --primary-glow: rgba(5, 150, 105, 0.2);
  
  --accent: #D97706;
  --accent-hover: #B45309;
  --accent-glow: rgba(217, 119, 6, 0.2);
  
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(5, 150, 105, 0.15);
  --glass-border-hover: rgba(5, 150, 105, 0.3);
  --glass-shadow: rgba(15, 23, 42, 0.06);
  
  --msg-user: #D1FAE5;
  --msg-bot: #F1F5F9;
  
  --nav-bg: rgba(248, 250, 252, 0.8);
  --nav-bg-scrolled: rgba(248, 250, 252, 0.95);
  --nav-border: rgba(5, 150, 105, 0.08);
  --nav-border-scrolled: rgba(5, 150, 105, 0.15);
}

body.light-theme {
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(5, 150, 105, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(217, 119, 6, 0.02) 0%, transparent 40%),
    linear-gradient(to bottom, var(--bg-main), var(--bg-gradient-end));
}

/* ==========================================================================
   Базовые стили
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(217, 119, 6, 0.03) 0%, transparent 40%),
    linear-gradient(to bottom, var(--bg-main), var(--bg-gradient-end));
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Сетки и утилиты */
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.text-center { text-align: center; }
.margin-auto { margin-left: auto; margin-right: auto; }
.max-w-600 { max-width: 600px; }
.section-padding { padding: 100px 0; }
.bg-alt { background-color: var(--bg-alt); }

/* ==========================================================================
   Кнопки и ссылки
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #059669);
  color: var(--text-inverse);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.1);
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   Эффект Glassmorphism
   ========================================================================== */

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px var(--glass-shadow);
  transition: var(--transition);
}

.glass:hover {
  border-color: var(--glass-border-hover);
}

/* ==========================================================================
   Шапка (Navbar)
   ========================================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nav-border);
  padding: 16px 0;
  transition: var(--transition);
}

.navbar.scrolled {
  background: var(--nav-bg-scrolled);
  border-bottom: 1px solid var(--nav-border-scrolled);
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: var(--text-main);
  gap: 8px;
}

.logo-highlight {
  color: var(--primary);
}

.nav-menu {
  display: flex;
  gap: 32px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary);
}

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

/* Переключатель темы */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--glass-border-hover);
  color: var(--primary);
}

body.light-theme .theme-toggle:hover {
  background: rgba(0, 0, 0, 0.03);
}

.theme-toggle svg {
  transition: transform 0.5s ease;
}

.theme-toggle:hover svg {
  transform: rotate(20deg);
}

/* ==========================================================================
   Геро-секция (Hero)
   ========================================================================== */

.hero {
  position: relative;
  padding: 120px 0 100px 0;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.hero-container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 60px;
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: 50px;
  margin-bottom: 24px;
}

.badge-accent {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.2);
  color: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
  margin-bottom: 24px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), #34D399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 500px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
}

/* Визуал героя */
.hero-visual {
  position: relative;
}

.visual-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  transform: perspective(1000px) rotateY(-5deg);
  transition: var(--transition);
  aspect-ratio: 1 / 1;
  background: var(--bg-alt);
  border: 1px solid var(--glass-border);
}

.visual-frame:hover {
  transform: perspective(1000px) rotateY(0deg) translateY(-5px);
  border-color: var(--glass-border-hover);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.visual-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.visual-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
  transition: var(--transition);
}

.visual-frame:hover .visual-glow {
  width: 140%;
  height: 140%;
}

.hero-avatar-badge {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  width: calc(100% - 40px);
  max-width: none;
  margin-left: 0;
  transform: none !important;
  box-shadow: 0 8px 32px var(--glass-shadow);
  border-radius: var(--radius-md);
  z-index: 2;
}

.visual-card {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.visual-header {
  background: rgba(0, 0, 0, 0.2);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.visual-title {
  font-weight: 600;
  font-size: 14px;
}

.visual-status {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.visual-chat-preview {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-msg {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  max-width: 85%;
  line-height: 1.4;
}

.msg-user {
  background-color: var(--msg-user);
  align-self: flex-end;
  color: var(--text-main);
  border-bottom-right-radius: 2px;
}

.msg-bot {
  background-color: var(--msg-bot);
  align-self: flex-start;
  color: #CBD5E1;
  border-bottom-left-radius: 2px;
  border: 1px solid rgba(16, 185, 129, 0.05);
}

/* ==========================================================================
   Секции контента
   ========================================================================== */

.section-header {
  margin-bottom: 60px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
}

.section-desc {
  font-size: 16px;
  color: var(--text-muted);
}

/* Сетка: О проекте */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.about-card {
  padding: 40px 30px;
  border-radius: var(--radius-md);
  text-align: left;
}

.about-icon {
  font-size: 32px;
  margin-bottom: 24px;
}

.about-card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.about-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Сетка: Возможности */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.feature-card {
  padding: 30px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.feature-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.feature-num {
  font-family: var(--font-numeric);
  font-size: 28px;
  font-weight: 700;
  color: rgba(16, 185, 129, 0.2);
}

.feature-emoji {
  font-size: 24px;
}

.feature-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ==========================================================================
   Секция: Автор проекта
   ========================================================================== */

.author-container {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 60px;
  align-items: center;
}

.author-image-area {
  display: flex;
  justify-content: center;
}

.author-frame {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(217, 119, 6, 0.05));
  border: 2px dashed rgba(16, 185, 129, 0.3);
  padding: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.author-avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius-xl) - 8px);
  background: rgba(16, 185, 129, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 96px;
  color: var(--primary);
}

.author-badge {
  position: absolute;
  bottom: -15px;
  right: -15px;
  background: var(--accent);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 50px;
  box-shadow: 0 4px 10px var(--accent-glow);
}

.author-name {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  margin-top: 12px;
  margin-bottom: 8px;
}

.author-bio {
  font-size: 16px;
  color: #CBD5E1;
  margin-bottom: 24px;
}

.quote-box {
  background: rgba(217, 119, 6, 0.06);
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 24px;
}

.quote-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-hover);
}

.author-mission {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ==========================================================================
   Секция: Инфраструктура
   ========================================================================== */

.infra-badge {
  display: inline-block;
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.2);
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 16px;
}

.infra-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 50px;
}

.infra-item {
  padding: 20px;
}

.infra-icon {
  font-size: 32px;
  margin-bottom: 16px;
}

.infra-item h4 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.infra-item p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ==========================================================================
   Интерактивный Чат (Chat Widget)
   ========================================================================== */

.chat-section-container {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 50px;
  align-items: flex-start;
}

.chat-intro-text {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 30px;
}

.quick-questions {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 24px;
}

.quick-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.quick-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-btn-item {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.1);
  color: #E2E8F0;
  text-align: left;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.quick-btn-item:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
  transform: translateX(4px);
}

/* Чат-виджет */
.chat-widget-container {
  width: 100%;
  height: 520px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

/* Ворота согласия (Consent Gate Overlay) */
.consent-gate {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 22, 15, 0.95);
  z-index: 10;
  display: flex;
  /* flex-start + margin:auto на контенте: центрируется когда есть место,
     и скроллится от верха (без обрезки) когда контент выше окна. */
  align-items: flex-start;
  justify-content: center;
  padding: 24px 20px;
  text-align: center;
  transition: opacity 0.4s ease, visibility 0.4s;
  /* На узких/невысоких экранах контент может быть выше окна — даём прокрутку,
     иначе кнопки входа уезжают за overflow:hidden контейнера и становятся недоступны. */
  overflow-y: auto;
}

.consent-gate-content {
  max-width: 400px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto 0;
}

.consent-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.consent-gate h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.consent-gate p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.consent-gate p.consent-sub {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.7);
  margin-bottom: 20px;
}

.consent-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.consent-link-item {
  color: var(--primary);
  font-size: 11px;
  text-decoration: none;
  font-weight: 500;
}

.consent-link-item:hover {
  text-decoration: underline;
}

.bullet {
  color: var(--text-muted);
  font-size: 8px;
}

.consent-actions {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 10px;
}

/* Окно чата */
.chat-window {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.chat-header {
  background: rgba(0, 0, 0, 0.2);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-bot-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  /* Фото Прокоопа как фон кружка — object-fit:cover-аналог через background. */
  background-image: url('images/prokop.jpg');
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  background-color: rgba(16, 185, 129, 0.15);
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 0 2px rgba(7, 22, 15, 0.6);
}

.bot-meta {
  display: flex;
  flex-direction: column;
}

.bot-name {
  font-size: 14px;
  font-weight: 600;
}

.bot-status {
  font-size: 11px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary);
  display: inline-block;
}

.chat-reset-btn,
.chat-fullscreen-btn {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  cursor: pointer;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  transition: var(--transition);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-reset-btn:hover,
.chat-fullscreen-btn:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.5);
}

.chat-fullscreen-btn svg {
  width: 16px;
  height: 16px;
}

/* Полноэкранный режим окна чата (раскрытие на весь экран, моб + браузер).
   CSS-фолбэк на случай, если Fullscreen API недоступен. Native :fullscreen
   ниже отрабатывает в первую очередь. */
.chat-widget-container.fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 99999;
  border-radius: 0;
  margin: 0;
}

/* Native Fullscreen API: элемент сам становится во весь экран — растягиваем содержимое. */
.chat-widget-container:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  background: var(--bg-main, #07160f);
}
.chat-widget-container:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  background: #07160f;
}

body.chat-fullscreen-open {
  overflow: hidden;
}

/* Сообщения в чате */
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(0, 0, 0, 0.05);
}

/* Стилизация скроллбара */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.2);
}

.message {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  max-width: 80%;
  line-height: 1.5;
  animation: messageIn 0.25s ease-out;
}

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

.msg-incoming {
  background-color: var(--msg-bot);
  align-self: flex-start;
  color: #E2E8F0;
  border-bottom-left-radius: 2px;
  border: 1px solid rgba(16, 185, 129, 0.05);
}

.msg-outgoing {
  background-color: var(--msg-user);
  align-self: flex-end;
  color: var(--text-main);
  border-bottom-right-radius: 2px;
}

/* Индикатор набора текста (Typing Indicator) */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background-color: var(--msg-bot);
  border-radius: var(--radius-sm);
  border-bottom-left-radius: 2px;
  align-self: flex-start;
  width: fit-content;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--text-muted);
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Зона ввода */
.chat-input-area {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-input-field {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  resize: none;
  transition: var(--transition);
  max-height: 100px;
  overflow-y: auto;
}

.chat-input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.15);
}

.chat-input-field:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-send-btn {
  background: var(--primary);
  color: var(--text-inverse);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.chat-send-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 0 10px var(--primary-glow);
}

.chat-send-btn:disabled {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ==========================================================================
   Подвал (Footer)
   ========================================================================== */

.footer {
  border-top: 1px solid rgba(16, 185, 129, 0.08);
  padding: 40px 0;
  background-color: #050d0a;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: #E2E8F0;
  display: block;
  margin-bottom: 8px;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-link {
  text-decoration: none;
  font-size: 12px;
  color: var(--text-muted);
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--primary);
}

/* ==========================================================================
   Адаптивность (Responsive Design)
   ========================================================================== */

@media (max-width: 992px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  
  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-buttons {
    justify-content: center;
  }
  
  .visual-card {
    margin: 0 auto;
  }
  
  .about-grid, .features-grid, .infra-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .author-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  
  .author-badge {
    right: 10px;
  }
  
  .chat-section-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .navbar-container {
    flex-direction: column;
    gap: 16px;
  }
  
  .nav-menu {
    gap: 20px;
  }
  
  .hero-title {
    font-size: 40px;
  }
  
  .about-grid, .features-grid, .infra-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .footer-container {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 12px;
  }
}

/* ==========================================================================
   Дополнительные правила светлой темы для идеального контраста и читаемости
   ========================================================================== */

body.light-theme .navbar {
  background: var(--nav-bg);
  border-bottom-color: var(--nav-border);
}

body.light-theme .logo {
  color: var(--text-main);
}

body.light-theme .nav-link {
  color: var(--text-muted);
}

body.light-theme .nav-link:hover {
  color: var(--primary);
}

body.light-theme .quick-btn-item {
  background: rgba(5, 150, 105, 0.05);
  border-color: rgba(5, 150, 105, 0.15);
  color: var(--text-main);
}

body.light-theme .quick-btn-item:hover {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.3);
}

body.light-theme .msg-incoming {
  color: var(--text-main);
  background-color: var(--msg-bot);
  border-color: rgba(5, 150, 105, 0.08);
}

body.light-theme .msg-incoming strong,
body.light-theme .msg-incoming strong.chat-number {
  color: #047857; /* Глубокий изумрудный для контраста */
}

body.light-theme .msg-outgoing {
  color: #064e3b; /* Темно-зеленый текст для лучшей читаемости в светло-зеленом баббле */
}

body.light-theme .typing-indicator {
  background-color: var(--msg-bot);
  border-color: rgba(5, 150, 105, 0.08);
}

body.light-theme .typing-dot {
  background-color: var(--text-muted);
}

body.light-theme .chat-input-field {
  background: #FFFFFF;
  border-color: rgba(5, 150, 105, 0.15);
  color: var(--text-main);
}

body.light-theme .chat-input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(5, 150, 105, 0.15);
}

body.light-theme .chat-input-area,
body.light-theme .chat-header {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(5, 150, 105, 0.08);
}

body.light-theme .chat-messages {
  background: rgba(0, 0, 0, 0.01);
}

body.light-theme .chat-send-btn:disabled {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
}

body.light-theme .chat-reset-btn:hover {
  background: rgba(0, 0, 0, 0.03);
}

body.light-theme .footer {
  background-color: #F1F5F9;
  border-top: 1px solid rgba(5, 150, 105, 0.08);
}

body.light-theme .footer-logo {
  color: var(--text-main);
}

body.light-theme .author-bio {
  color: var(--text-muted);
}

body.light-theme .consent-gate {
  background: rgba(248, 250, 252, 0.96);
}

/* ==========================================================================
   Стили для версии 2.1 (Иконки, Модальные окна, Дисклеймер, Соцсети)
   ========================================================================== */

/* Иконки разделов */
.feature-icon-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(16, 185, 129, 0.15));
  transition: var(--transition);
}

.feature-card.clickable-card {
  cursor: pointer;
  padding-bottom: 50px; /* Место под кнопку подробнее */
  position: relative;
}

.feature-card.clickable-card:hover .feature-icon-img {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 6px 15px rgba(16, 185, 129, 0.3));
}

.card-more-btn {
  position: absolute;
  bottom: 24px;
  left: 30px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  opacity: 0.8;
  transition: var(--transition);
}

.feature-card.clickable-card:hover .card-more-btn {
  opacity: 1;
  transform: translateX(4px);
}

/* Дисклеймер ИИ */
.chat-disclaimer {
  background: rgba(217, 119, 6, 0.05);
  border: 1px solid rgba(217, 119, 6, 0.15);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.disclaimer-badge {
  display: inline-block;
  align-self: flex-start;
  background: rgba(217, 119, 6, 0.15);
  color: var(--accent-hover);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
}

.disclaimer-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

body.light-theme .chat-disclaimer {
  background: rgba(217, 119, 6, 0.04);
  border-color: rgba(217, 119, 6, 0.1);
}

/* Модальное окно (Modal Preview) */
.modal-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: rgba(7, 22, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
  animation: modalScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
}

@keyframes modalScaleIn {
  from { transform: scale(0.9) translateY(20px); }
  to { transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.modal-close:hover {
  color: var(--primary);
}

.modal-header-area {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 16px;
}

.modal-header-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-body-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 8px;
}

.modal-body-text::-webkit-scrollbar {
  width: 4px;
}
.modal-body-text::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.2);
  border-radius: 4px;
}

.modal-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
}

body.light-theme .modal-preview {
  background: rgba(248, 250, 252, 0.85);
}

body.light-theme .modal-content {
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.1);
}

/* Стили подвала (Footer socials & author) */
.footer-author {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.footer-author-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.footer-author-link:hover {
  text-decoration: underline;
}

.footer-socials {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.socials-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.social-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.social-link {
  text-decoration: none;
  font-size: 12.5px;
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.social-link:hover {
  color: var(--primary);
  transform: translateX(2px);
}

@media (max-width: 992px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }
  .footer-socials {
    text-align: center;
  }
  .social-links-grid {
    justify-content: center;
  }
}

/* ==========================================================================
   Стили для Авторизации в Чат-Виджете
   ========================================================================== */

.consent-checkbox-wrapper {
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-align: left;
}

.consent-checkbox-label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
}

.consent-checkbox-label input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-text {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.checkbox-text a {
  color: var(--primary);
  text-decoration: none;
}

.checkbox-text a:hover {
  text-decoration: underline;
}

.auth-block {
  width: 100%;
  transition: var(--transition);
}

.auth-helper-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  font-size: 13.5px;
}

.btn-icon {
  font-size: 16px;
}

.decline-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 16px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: underline;
}

.decline-link:hover {
  color: #EF4444;
}

.telegram-widget-wrapper {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  min-height: 40px;
}

/* Стили заголовка авторизованного пользователя */
.chat-bot-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-logout-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #FCA5A5;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.chat-logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

/* Модальное окно Deep-Link ожидания */
.auth-wait-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 22, 15, 0.98);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.auth-wait-content {
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.auth-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(16, 185, 129, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-wait-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.auth-wait-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.chat-header-login-btn {
  background: transparent;
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  margin-left: 8px;
}

.chat-header-login-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--primary-hover);
  color: var(--primary-hover);
}



