/* ─────────────────────────────────────────────────────────────────────────
   ruVPN · base.css
   Переменные, сброс, общие компоненты (кнопки, поля, модалки, утилиты).
   Подключается на всех страницах первым.
───────────────────────────────────────────────────────────────────────── */

:root {
  /* Фон */
  --bg:       #080B0A;
  --bg-soft:  #0D1311;
  --card:     #101715;
  --card-2:   #131D1A;

  /* Границы */
  --line:   rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.14);

  /* Текст */
  --txt:   #EAF2EE;
  --txt-2: #8FA39B;
  --txt-3: #5E726A;

  /* Акцент */
  --acc:      #34E5A1;
  --acc-dim:  #1F9C6E;
  --acc-glow: rgba(52,229,161,.18);

  /* Статусы */
  --warn: #E5C534;
  --err:  #FF6B6B;
  --corp: #7BA8FF;   /* для тега «лучший выбор» */

  /* Радиусы */
  --r:    14px;
  --r-lg: 20px;

  /* Шрифты */
  --mono: 'JetBrains Mono', monospace;
  --disp: 'Unbounded', sans-serif;
  --body: 'Golos Text', sans-serif;
}

/* ── Сброс ─────────────────────────────────────────────────────────────── */

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

body {
  font-family: var(--body);
  background:  var(--bg);
  color:       var(--txt);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Шум-текстура поверх фона (общая для всех страниц) */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none }

/* ── Утилиты ───────────────────────────────────────────────────────────── */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

.mono { font-family: var(--mono); font-weight: 400 }

.tag {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--acc);
  text-transform: lowercase;
}
.tag::before { content: "// " }

/* ── Кнопки ────────────────────────────────────────────────────────────── */

.btn {
  font-family: var(--body);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border: none;
  border-radius: 11px;
  padding: 11px 20px;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--acc);
  color: #06120C;
}
.btn-primary:hover {
  box-shadow: 0 8px 30px -6px var(--acc-glow);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--txt);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover {
  border-color: var(--acc);
  color: var(--acc);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 9px;
}

.btn-danger {
  color: var(--err);
  border: 1px solid rgba(255,107,107,.3);
  background: transparent;
}
.btn-danger:hover { background: rgba(255,107,107,.1) }

.ruvpn-language-menu {
  position: relative;
  flex: 0 0 auto;
  color: var(--txt);
}

.ruvpn-language-menu summary {
  min-width: 74px;
  height: 38px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  list-style: none;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
  color: var(--txt);
  font: 600 12px/1 var(--mono);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

.ruvpn-language-menu summary::-webkit-details-marker { display: none; }

.ruvpn-language-menu summary:hover,
.ruvpn-language-menu summary:focus-visible,
.ruvpn-language-menu[open] summary {
  border-color: rgba(52, 229, 161, .42);
  background: rgba(52, 229, 161, .07);
  outline: none;
}

.ruvpn-language-icon {
  position: relative;
  width: 15px;
  height: 15px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  opacity: .8;
}

.ruvpn-language-icon::before,
.ruvpn-language-icon::after {
  content: "";
  position: absolute;
  inset: 2px 5px;
  border-left: 1px solid currentColor;
  border-right: 1px solid currentColor;
  border-radius: 50%;
}

.ruvpn-language-icon::after {
  inset: 6px -1.5px auto;
  border: 0;
  border-top: 1px solid currentColor;
  border-radius: 0;
}

.ruvpn-language-chevron {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: .65;
  transition: transform .18s ease;
}

.ruvpn-language-menu[open] .ruvpn-language-chevron {
  transform: translateY(2px) rotate(225deg);
}

.ruvpn-language-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: 150px;
  padding: 5px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(10, 15, 13, .98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .38);
}

.ruvpn-language-options button {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--txt-2);
  font: 500 13px/1 var(--body);
  cursor: pointer;
}

.ruvpn-language-options button:hover,
.ruvpn-language-options button:focus-visible,
.ruvpn-language-options button[aria-checked="true"] {
  background: rgba(52, 229, 161, .09);
  color: var(--txt);
  outline: none;
}

.ruvpn-language-options button[aria-checked="true"] span:last-child {
  color: var(--acc);
}

/* ── Поля форм ─────────────────────────────────────────────────────────── */

.field { margin-bottom: 18px }

.field label {
  display: block;
  font-size: 13px;
  color: var(--txt-2);
  margin-bottom: 8px;
  font-weight: 500;
}

.field input,
.field select {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 15px;
  color: var(--txt);
  font-family: var(--body);
  font-size: 15px;
  transition: border .2s;
}
.field input:focus,
.field select:focus    { outline: none; border-color: var(--acc) }
.field input::placeholder          { color: var(--txt-3) }
.field select option:disabled      { color: var(--txt-3) }

/* ── Модальные окна (каркас) ───────────────────────────────────────────── */

.modal-bg {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4,7,6,.78);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.modal-bg.open { display: flex }

.modal {
  background: var(--bg-soft);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  width: 100%;
  position: relative;
  animation: modalPop .25s ease;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,.8);
}

.modal .x {
  position: absolute; top: 20px; right: 20px;
  background: none; border: none;
  color: var(--txt-3); font-size: 24px;
  cursor: pointer; line-height: 1;
}
.modal .x:hover { color: var(--txt) }

.modal h3 {
  font-family: var(--disp);
  font-weight: 500;
  font-size: 22px;
  margin-bottom: 4px;
}

.modal-acts {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.modal-acts .btn {
  flex: 1;
  justify-content: center;
  padding: 13px;
}

/* ── Toast ─────────────────────────────────────────────────────────────── */

.toast {
  position: fixed; bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--acc); color: #06120C;
  font-weight: 600; font-size: 14px;
  padding: 12px 22px; border-radius: 12px;
  z-index: 200; opacity: 0;
  transition: all .3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) }

/* ── Анимации ──────────────────────────────────────────────────────────── */

@keyframes modalPop {
  from { opacity:0; transform:translateY(10px) }
  to   { opacity:1; transform:none }
}
@keyframes fadeIn {
  from { opacity:0; transform:translateY(8px) }
  to   { opacity:1; transform:none }
}
@keyframes pulseDot {
  0%,100% { opacity:1 }
  50%      { opacity:.35 }
}
@keyframes blinkCursor {
  50% { opacity:0 }
}

/* Network activity stays visible without covering the page or moving content. */
.client-progress {
    position: fixed;
    inset: 0 0 auto;
    height: 3px;
    overflow: hidden;
    z-index: 10000;
    pointer-events: none;
    background: var(--acc-glow);
}
.client-progress[hidden] { display: none; }
.client-progress::after {
    content: '';
    display: block;
    height: 100%;
    width: 38%;
    border-radius: 3px;
    background: var(--acc);
    animation: client-progress 1.1s ease-in-out infinite;
}
button.is-loading:disabled { opacity: .8; cursor: progress; }
button.is-loading::before {
    content: '';
    display: inline-block;
    width: .9em;
    height: .9em;
    margin-inline-end: 0;
    border: 2px solid currentColor;
    border-inline-end-color: transparent;
    border-radius: 50%;
    vertical-align: -.12em;
    animation: client-spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes client-spin { to { transform: rotate(360deg); } }
@keyframes client-progress {
    from { transform: translateX(-105%); }
    to { transform: translateX(365%); }
}
@media (prefers-reduced-motion: reduce) {
    button.is-loading::before { animation: none; }
    .client-progress::after { animation: none; width: 100%; opacity: .75; }
}
