/* ==========================================================================
   EqVPN // PRIVATE NETWORK INFRASTRUCTURE
   STYLESHEET: css/style.css
   ========================================================================== */

/* ЖЕСТКИЙ АНТИ-НЕЙРОСЛОП: Никаких скруглений, градиентов, теней и синих акцентов */
*, *::before, *::after {
  border-radius: 0px !important;
  box-shadow: none !important;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: #050505;
  color: #F2F2F2;
  font-family: 'Space Grotesk', sans-serif;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: #F2F2F2;
  color: #050505;
}

/* Nothing OS точечная матрица поверх полупрозрачных панелей */
.dot-matrix {
  background-image: radial-gradient(#242424 1px, transparent 1px);
  background-size: 14px 14px;
}

.dot-matrix-dense {
  background-image: radial-gradient(#1b1b1b 1px, transparent 1px);
  background-size: 8px 8px;
}

/* Строгие пунктирные разделители */
.border-dashed-tech {
  border-style: dashed;
  border-color: #262626;
}

/* Кастомный скроллбар в стиле терминала */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #050505;
  border-left: 1px solid #222222;
}
::-webkit-scrollbar-thumb {
  background: #444444;
}
::-webkit-scrollbar-thumb:hover {
  background: #F2F2F2;
}

/* Инверсия кнопок в стиле Temporal / Nothing */
.btn-tech {
  background-color: #0A0A0A;
  color: #F2F2F2;
  border: 1px solid #2A2A2A;
  transition: background-color 0.12s steps(2), color 0.12s steps(2), border-color 0.12s steps(2);
}
.btn-tech:hover {
  background-color: #F2F2F2;
  color: #050505;
  border-color: #F2F2F2;
}
.btn-tech-primary {
  background-color: #F2F2F2;
  color: #050505;
  border: 1px solid #F2F2F2;
  transition: background-color 0.12s steps(2), color 0.12s steps(2);
}
.btn-tech-primary:hover {
  background-color: #050505;
  color: #F2F2F2;
  border-color: #F2F2F2;
}

/* Мигающий курсор терминала */
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.cursor-blink {
  animation: blink 1s infinite;
}

/* Уголки прицела на блоках */
.corner-ticks {
  position: relative;
}
.corner-ticks::before,
.corner-ticks::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-color: #666666;
  pointer-events: none;
}
.corner-ticks::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid #888888;
  border-left: 1px solid #888888;
}
.corner-ticks::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 1px solid #888888;
  border-right: 1px solid #888888;
}

/* Фиксированный канвас с океаном */
#ocean-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 0;
  display: block;
  opacity: 0.13;
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
}

/* Основной слой интерфейса пропускает клики к океану там, где нет карточек */
.ui-layer {
  position: relative;
  z-index: 10;
  pointer-events: none;
}
.ui-interactive {
  pointer-events: auto;
}

/* Скрытие панели Studio на экранах < 900px */
@media (max-width: 899px) {
  #admin-studio-bar {
    display: none !important;
  }
}

/* Гарантированное строгое скрытие админки без фантомных отступов */
#admin-studio-bar.hidden {
  display: none !important;
}

/* Полное подавление любых сторонних плавающих элементов */
.floating-info, #floating-info, [data-info-btn] {
  display: none !important;
}

/* ==========================================================================
   МОБИЛЬНЫЙ РЕДИЗАЙН СТРОГО ДЛЯ ЭКРАНОВ < 768px (EDGE-TO-EDGE & ДЫШАЩИЙ UI)
   ========================================================================== */
@media (max-width: 768px) {
  /* Контраст фонового ASCII-океана на экранах смартфонов: на йоту ярче */
  #ocean-canvas {
    opacity: 0.17 !important;
  }

  /* 1. УДАЛЕНИЕ ВНЕШНИХ РАМОК (EDGE-TO-EDGE LAYOUT) */
  .site-container {
    padding-left: 16px !important;
    padding-right: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Снятие внешних рамок и заливок у глобальных оберток секций */
  .module-container,
  .hero-outer-frame,
  .hero-section > div,
  .hero-section > div > div.lg\:col-span-8,
  .tariffs-section,
  #tab-feed > div,
  #tab-chat > div,
  #tab-status > div,
  #tab-faq > div {
    border: none !important;
    background: transparent !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Скрытие внешних декоративных уголков на мобилке */
  .corner-ticks::before,
  .corner-ticks::after {
    display: none !important;
  }

  /* Рамки остаются ТОЛЬКО у самостоятельных карточек */
  [data-tariff-block="true"],
  [data-feed-block="true"],
  #radar-grid > div,
  #radar-reports-container > div,
  #platform-guide-container,
  .faq-item,
  #chat-messages,
  #chat-lock-banner {
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    background-color: #0A0A0A !important;
  }
  [data-tariff-block="true"].border-2 {
    border: 2px solid #F2F2F2 !important;
  }

  /* 2. НАВИГАЦИЯ (ДЫШАЩИЕ ТАБЫ) */
  .nav-scroll-mask {
    display: flex !important;
    overflow-x: auto !important;
    gap: 8px !important;
    padding: 8px 0 !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    mask-image: linear-gradient(to right, black 85%, transparent 100%) !important;
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%) !important;
    border: none !important;
  }
  .nav-scroll-mask::-webkit-scrollbar {
    display: none !important;
  }
  .nav-scroll-mask > * + * {
    border-left-width: 0 !important;
  }

  /* Скрытие нумерации "01 //", "02 //" на экранах < 768px */
  .nav-tab > span:first-child {
    display: none !important;
  }

  .nav-tab {
    flex: 0 0 auto !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    letter-spacing: 0.5px !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    line-height: 1.2 !important;
    text-align: center !important;
  }

  /* 3. РАЗРЕЖЕНИЕ ВЕРТИКАЛЬНОГО ПРОСТРАНСТВА (ОТСТУПЫ) */
  .hero-section {
    margin-top: 16px !important;
    margin-bottom: 32px !important;
  }

  .tariffs-section {
    margin-top: 32px !important;
    margin-bottom: 32px !important;
  }

  .tab-section {
    margin-bottom: 32px !important;
  }

  /* Просторный внутренний отступ карточек тарифов и расстояние между ними */
  [data-tariff-block="true"] {
    padding: 24px 18px !important;
    margin-bottom: 20px !important;
  }

  #tariffs-cards-container {
    gap: 20px !important;
  }

  /* 4. РАЗЖАТИЕ ЧАТА ПОДДЕРЖКИ (SUPPORT MODULE) */
  #chat-messages {
    width: 100% !important;
    height: 380px !important;
    padding: 14px !important;
    box-sizing: border-box !important;
  }

  #tab-chat form > div {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    width: 100% !important;
  }

  #tab-chat #chat-input {
    width: 100% !important;
    flex: 1 1 100% !important;
    height: 44px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    background-color: #0A0A0A !important;
    box-sizing: border-box !important;
  }

  #tab-chat form label.btn-tech,
  #tab-chat form button[type="submit"] {
    flex: 1 1 calc(50% - 5px) !important;
    height: 44px !important;
    padding: 0 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 11px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }

  /* Защита от выпадения закрывающей скобки "]" на отдельную строку на мобильных */
  [data-tariff-block="true"] a {
    white-space: nowrap !important;
    font-size: 11px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  #platform-btn-ios,
  #platform-btn-android,
  #platform-btn-windows,
  #platform-btn-macos {
    white-space: nowrap !important;
    font-size: 11px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
}

/* Мобильная маска для горизонтального скролл-бара вкладок на десктопе отключается */
@media (min-width: 769px) {
  .nav-scroll-mask {
    mask-image: none;
    -webkit-mask-image: none;
  }
}

/* ЕДИНЫЙ ЦЕНТРИРУЮЩИЙ КОНТЕЙНЕР (1280px) */
.site-container {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  padding-left: 16px;
  padding-right: 16px;
}
@media (min-width: 768px) {
  .site-container {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ЕСТЕСТВЕННЫЙ ВЕРТИКАЛЬНЫЙ ПОТОК ДЛЯ HERO И ТАРИФОВ */
.hero-section {
  min-height: auto;
  margin-top: 20px;
}
@media (min-width: 768px) {
  .hero-section {
    margin-top: 40px;
  }
}

.tariffs-section {
  margin-top: 50px;
}
@media (min-width: 768px) {
  .tariffs-section {
    margin-top: 80px;
  }
}

/* Адаптивный размер шрифта Hero-заголовка без выпадания за экран */
.hero-title-clamp {
  font-size: clamp(2rem, 7.5vw, 4.25rem);
  line-height: 1.05;
}

/* Горизонтальный скролл навигации на мобилке без полосы */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* РЕЖИМ СТУДИИ (ЧИСТЫЙ РЕЖИМ БЕЗ CONTENTEDITABLE) */

/* МЕХАНИЧЕСКИЕ МИКРО-АНИМАЦИИ И ТАКТИЛЬНЫЙ ОТКЛИК */
@keyframes tabIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-in-anim {
  animation: tabIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Тактильный клик для кнопок и интерактивных карточек */
button, .btn-tech, .btn-tech-primary, a.btn-tech, a.btn-tech-primary, .nav-tab, .faq-header {
  transition: transform 0.08s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease;
}
button:active, .btn-tech:active, .btn-tech-primary:active, a.btn-tech:active, a.btn-tech-primary:active {
  transform: scale(0.975);
}

/* Аппаратная индикация копирования в буфер обмена */
.btn-copied {
  background-color: #F2F2F2 !important;
  color: #050505 !important;
  border-color: #F2F2F2 !important;
  animation: hardwareFlash 0.25s ease-out;
}

@keyframes hardwareFlash {
  0% { filter: invert(1); }
  50% { filter: brightness(1.8); }
  100% { filter: none; }
}

/* Терминальный фокус и каретка полей ввода */
input, textarea, select {
  caret-color: #F2F2F2 !important;
}
input:focus, textarea:focus, select:focus {
  border-color: #F2F2F2 !important;
  box-shadow: 0 0 0 1px #F2F2F2 inset !important;
}

/* Терминальные чипы выбора оператора и статуса */
.isp-chip, .status-chip {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.1s steps(2), color 0.1s steps(2), border-color 0.1s steps(2);
}

/* Живой RTT-индикатор с микро-пульсом */
@keyframes rttBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.rtt-live-dot {
  animation: rttBlink 2s ease-in-out infinite;
}

/* Мягкая подсветка границ при ховере на ключевые блоки */
.border-glow-hover {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.border-glow-hover:hover {
  border-color: rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.045) !important;
}

/* Живой пульсирующий изумрудный индикатор статуса сети */
@keyframes statusPing {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  70% {
    transform: scale(2.6);
    opacity: 0;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}
.status-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 9999px !important;
  background-color: #10B981;
  animation: statusPing 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
  pointer-events: none;
}

/* СТРОГИЙ ACCORDION С CSS GRID АНИМАЦИЕЙ (БЕЗ max-height И ПРЫЖКОВ) */
.faq-item {
  transition: border-color 0.2s ease;
}
.faq-header {
  background: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.faq-header:hover {
  background: rgba(255, 255, 255, 0.03);
}
.faq-answer-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.faq-item:not(.active) .faq-answer-wrapper {
  visibility: hidden;
}
.faq-item.active .faq-answer-wrapper {
  grid-template-rows: 1fr;
}
.faq-answer-inner {
  min-height: 0;
  overflow: hidden;
}
.faq-item .chevron {
  display: inline-block;
  transition: transform 0.25s ease, color 0.2s ease;
}
.faq-item.active .chevron {
  transform: rotate(180deg);
  color: #F2F2F2;
}

/* ДВУХУРОВНЕВЫЙ АККОРДЕОН FAQ: КАТЕГОРИИ И ВОПРОСЫ */
.faq-cat-wrapper, .faq-q-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.faq-cat-item:not(.active) > .faq-cat-wrapper,
.faq-q-item:not(.active) > .faq-q-wrapper {
  visibility: hidden;
}
.faq-cat-item.active > .faq-cat-wrapper,
.faq-q-item.active > .faq-q-wrapper {
  grid-template-rows: 1fr;
}
.faq-cat-inner, .faq-q-inner {
  min-height: 0;
  overflow: hidden;
}
.faq-cat-item .cat-chevron, .faq-q-item .q-chevron {
  display: inline-block;
  transition: transform 0.2s ease, color 0.2s ease;
}
.faq-cat-item.active .cat-chevron {
  color: #F2F2F2;
}
.faq-q-item.active .q-chevron {
  transform: rotate(180deg);
  color: #F2F2F2;
}


/* HUD СИСТЕМА УВЕДОМЛЕНИЙ (ИГРОВОЙ ЛОГ СПРАВА СНИЗУ) */
@keyframes hudSlideUp {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hudFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.hud-toast {
  animation: hudSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

.hud-toast.fade-out {
  animation: hudFadeOut 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* Терминальный строгий чекбокс */
.tech-checkbox-wrapper {
  display: inline-flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  user-select: none;
}
.tech-checkbox-wrapper input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.tech-checkbox-box {
  width: 16px;
  height: 16px;
  border: 1px solid #444444;
  background-color: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0;
  transition: border-color 0.12s ease;
}
.tech-checkbox-wrapper:hover .tech-checkbox-box {
  border-color: #F2F2F2;
}
.tech-checkbox-wrapper input:focus-visible ~ .tech-checkbox-box {
  outline: 1px solid #F2F2F2;
  outline-offset: 1px;
}
.tech-checkbox-box::after {
  content: "";
  display: none;
  width: 8px;
  height: 8px;
  background-color: #F2F2F2;
}
.tech-checkbox-wrapper input:checked ~ .tech-checkbox-box {
  border-color: #F2F2F2;
  background-color: #0A0A0A;
}
.tech-checkbox-wrapper input:checked ~ .tech-checkbox-box::after {
  display: block;
}
