/* VPN-SC checkout — design tokens + shared components */
:root {
  --text: #10314c;
  --text-secondary: #5b7a92;
  --text-soft: #37617f;
  --primary: #1f7ae0;
  --primary-hover: #1668c4;
  --primary-soft: #e4f1fd;
  --primary-line: #9fcaee;
  --page-bg: #f7fbff;
  --card-bg: #ffffff;
  --card-stroke: #dceaf6;
  --divider: #edf4fa;
  --header-line: #e6f0f8;
  --success: #1f9d6b;
  --success-text: #12805a;
  --success-soft: #e6f7ef;
  --price-old: #7d95a8;
  --radio-off: #b9d4ea;
  --danger: #c9463d;
  --shadow-btn: 0 10px 22px -12px rgba(31, 122, 224, 0.9);
  --shadow-plan: 0 18px 36px -22px rgba(31, 122, 224, 0.75);
  --shadow-row: 0 8px 20px -12px rgba(31, 122, 224, 0.7);
  --font: "Segoe UI", "Segoe UI Variable", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.site-header {
  height: 72px;
  background: transparent;
  border-bottom: none;
  flex: none;
}

.site-header__inner {
  height: 100%;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1200px;
}

.site-header__inner--plans {
  max-width: 1120px;
}

.site-header__inner--pay {
  max-width: 1040px;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.site-header__logo {
  width: 30px;
  height: 30px;
  flex: none;
  display: block;
}

.site-header__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.site-header__account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.site-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  flex: none;
}

/* Mobile: сегмент RU | EN */
.lang-switch {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: stretch;
  gap: 2px;
  flex: none;
  padding: 3px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--card-stroke);
  box-shadow: 0 4px 14px -8px rgba(16, 49, 76, 0.28);
}

.lang-switch a.lang-switch__opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--text-secondary);
  background: transparent;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.lang-switch a.lang-switch__opt:hover {
  color: var(--text);
  background: var(--primary-soft);
}

.lang-switch a.lang-switch__opt.is-active,
.lang-switch a.lang-switch__opt.is-active:hover {
  color: #ffffff;
  background: var(--primary);
  pointer-events: none;
}

/* Desktop: dropdown + close в правом верхнем углу */
.lang-dropdown {
  display: none;
}

.site-header__corner {
  display: none;
}

.lang-dropdown__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  min-width: 40px;
  padding: 0 20px 0 10px;
  border: none;
  border-radius: 10px;
  position: relative;
  font: 700 13px/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--primary);
  background: rgba(31, 122, 224, 0.08);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-dropdown__toggle:hover,
.lang-dropdown__toggle:focus,
.lang-dropdown.is-open .lang-dropdown__toggle {
  background: rgba(31, 122, 224, 0.14);
  color: var(--primary-hover);
  outline: none;
}

.lang-dropdown__caret {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
  transform: translateY(-20%);
  pointer-events: none;
}

.lang-dropdown__menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #ffffff;
  border: 1px solid var(--card-stroke);
  border-radius: 10px;
  box-shadow: 0 10px 28px -12px rgba(16, 49, 76, 0.35);
  z-index: 60;
}

.lang-dropdown.is-open .lang-dropdown__menu {
  display: block;
}

.lang-dropdown__option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  border-radius: 7px;
  padding: 8px 10px;
  font: 600 13px/1 var(--font);
  color: var(--text);
  text-decoration: none;
  background: transparent;
}

.lang-dropdown__option:hover,
.lang-dropdown__option:focus {
  background: var(--primary-soft);
  color: var(--text);
  outline: none;
}

.lang-dropdown__option.is-active {
  background: var(--primary);
  color: #ffffff;
  pointer-events: none;
}

.lang-dropdown__flag {
  display: inline-block;
  width: 18px;
  height: 13px;
  border-radius: 2px;
  flex: none;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.lang-dropdown__flag--ru {
  background-image: url("/pay/img/flags/ru.svg");
}

.lang-dropdown__flag--gb {
  background-image: url("/pay/img/flags/gb.svg");
}

/* Close — hidden on mobile; shown on desktop inside .site-header__corner */
.site-header__close {
  display: none;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  line-height: 0;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-secondary);
  background: none;
  border: none;
  box-shadow: none;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.site-header__close:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

.site-header__close span {
  display: block;
  font-size: 28px;
  line-height: 1;
  transform: translateY(-1px);
}

@media (min-width: 640px) {
  .lang-switch--mobile {
    display: none;
  }

  .site-header__corner {
    display: flex;
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 50;
    align-items: center;
    gap: 8px;
  }

  .lang-dropdown {
    display: block;
    position: relative;
    flex: none;
  }

  .site-header__close {
    display: flex;
  }
}

.site-header__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  text-transform: uppercase;
}

.site-header__email {
  font-size: 14px;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  padding: 0 24px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: background 0.15s ease;
  touch-action: manipulation;
}

.btn:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn--block {
  width: 100%;
}

.btn--wide {
  width: 360px;
  max-width: 100%;
}

.btn__spinner {
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
}

.radio {
  width: 20px;
  height: 20px;
  flex: none;
  box-sizing: border-box;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--radio-off);
}

.radio.is-on {
  border: 6px solid var(--primary);
}

.badge-discount {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--success-text);
  background: var(--success-soft);
  padding: 2px 9px;
  border-radius: 100px;
  white-space: nowrap;
}

.pay-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  background: #fff;
  border: 1px solid var(--card-stroke);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.is-selected .pay-chip {
  border-color: var(--primary-line);
  color: var(--primary);
}

.lock-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.lock-row svg {
  flex: none;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.check-row svg {
  flex: none;
  margin-top: 2px;
}

.price-num {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 639px) {
  .site-header {
    height: 56px;
  }

  .site-header__inner {
    padding: 0 16px;
    gap: 8px;
  }

  .site-header__logo {
    width: 26px;
    height: 26px;
  }

  .site-header__name {
    font-size: 16px;
  }

  .site-header__avatar {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .site-header__email {
    display: none;
  }

  .btn {
    height: 52px;
  }

  .badge-discount {
    font-size: 11px;
    padding: 1px 7px;
  }

  .pay-chip {
    padding: 2px 9px;
  }

  .lock-row {
    font-size: 12px;
    gap: 6px;
  }
}
