/* ============================================================
   XEDESHIN VPN PANEL — Global Styles
   Preserves original liquid glass aesthetic from web.html
   ============================================================ */

:root {
  --color-bg: #000000;
  --color-bg-soft: #07110d;
  --color-text: #ffffff;
  --color-text-muted: rgba(255, 255, 255, 0.72);
  --color-accent: #00ff88;
  --color-accent-soft: rgba(0, 255, 136, 0.18);
  --color-border: rgba(255, 255, 255, 0.1);
  --color-panel: rgba(255, 255, 255, 0.04);
  --color-panel-strong: rgba(255, 255, 255, 0.06);
  --color-error: #ff8f8f;
  --color-success: #93ffd0;
  --color-warning: #ffa040;
  --shadow-glow: 0 0 24px rgba(0, 255, 136, 0.22);
  --shadow-soft: 0 18px 60px rgba(0, 0, 0, 0.45);
  --shadow-accent-lg: 0 18px 55px rgba(0, 255, 136, 0.14);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --container: 1180px;
  --header-h: 78px;
  --transition: 240ms ease;
  --sidebar-w: 240px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top, rgba(0, 255, 136, 0.08), transparent 26%),
    radial-gradient(
      circle at 20% 20%,
      rgba(0, 255, 136, 0.06),
      transparent 22%
    ),
    linear-gradient(180deg, #020202 0%, #000000 35%, #020705 100%);
  color: var(--color-text);
  overflow-x: hidden;
  min-height: 100svh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 95%);
  opacity: 0.22;
  z-index: -3;
}

a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
  max-width: 100%;
}
button,
input,
select {
  font: inherit;
}

/* ── Container ──────────────────────────────────────────────── */
.container {
  width: min(calc(100% - 32px), var(--container));
  margin-inline: auto;
}

/* ── Header ─────────────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 30;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition:
    background var(--transition),
    border-color var(--transition);
}

.header--scrolled {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(0, 255, 136, 0.16);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.35);
}

.header__inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ── Brand ──────────────────────────────────────────────────── */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08),
    rgba(0, 255, 136, 0.08)
  );
  box-shadow:
    inset 0 0 20px rgba(255, 255, 255, 0.04),
    0 0 18px rgba(0, 255, 136, 0.14);
  object-fit: cover;
  flex-shrink: 0;
}

.brand__name {
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  font-size: 15px;
}

/* ── Nav ────────────────────────────────────────────────────── */
.nav {
  display: none;
  align-items: center;
  gap: 10px;
}

.nav__link {
  padding: 10px 14px;
  color: var(--color-text-muted);
  border-radius: 999px;
  transition:
    color var(--transition),
    background var(--transition);
  font-size: 14px;
}

.nav__link:hover,
.nav__link.active {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.05);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition),
    border-color var(--transition),
    opacity var(--transition);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.16) 50%,
    transparent 100%
  );
  transform: translateX(-120%);
  transition: transform 500ms ease;
  pointer-events: none;
}

.btn:hover::after {
  transform: translateX(120%);
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  color: #02140b;
  background: var(--color-accent);
  box-shadow:
    0 0 0 1px rgba(0, 255, 136, 0.12),
    0 10px 26px rgba(0, 255, 136, 0.25);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn--primary:hover {
  box-shadow:
    0 0 0 1px rgba(0, 255, 136, 0.2),
    0 14px 34px rgba(0, 255, 136, 0.3);
}

.btn--ghost {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text);
}

.btn--ghost:hover {
  border-color: rgba(0, 255, 136, 0.34);
  background: rgba(0, 255, 136, 0.08);
  box-shadow: var(--shadow-glow);
}

.btn--danger {
  border-color: rgba(255, 100, 100, 0.2);
  background: rgba(255, 100, 100, 0.06);
  color: #ff8f8f;
}

.btn--danger:hover {
  border-color: rgba(255, 100, 100, 0.4);
  background: rgba(255, 100, 100, 0.12);
}

.btn--sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
}

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

/* ── Mobile menu toggle ─────────────────────────────────────── */
.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 0 12px;
  cursor: pointer;
}

.menu-toggle span {
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 999px;
  transition:
    transform var(--transition),
    opacity var(--transition);
}

.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile menu ────────────────────────────────────────────── */
.mobile-menu {
  position: fixed;
  top: calc(var(--header-h) + 10px);
  left: 16px;
  right: 16px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition:
    opacity var(--transition),
    transform var(--transition);
  z-index: 25;
}

.mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-menu .btn {
  width: 100%;
}

/* ── Glass card ─────────────────────────────────────────────── */
.glass-card {
  position: relative;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.045),
    rgba(255, 255, 255, 0.022)
  );
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at top right,
    rgba(0, 255, 136, 0.08),
    transparent 28%
  );
}

/* ── Input shell ────────────────────────────────────────────── */
.input-shell {
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.045),
    rgba(255, 255, 255, 0.022)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 28px rgba(0, 0, 0, 0.18);
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

.input-shell:focus-within {
  border-color: rgba(0, 255, 136, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 4px rgba(0, 255, 136, 0.08),
    0 14px 36px rgba(0, 255, 136, 0.08);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.055),
    rgba(255, 255, 255, 0.025)
  );
}

.input-shell.is-invalid {
  border-color: rgba(255, 108, 108, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 4px rgba(255, 108, 108, 0.08);
}

.input-shell input,
.input-shell select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--color-text);
  padding: 0 20px;
  height: 58px;
  font-size: 16px;
  -webkit-appearance: none;
}

.input-shell input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.input-shell--has-action input {
  padding-right: 72px;
}

.field-action {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(0, 255, 136, 0.16);
  background: linear-gradient(
    180deg,
    rgba(0, 255, 136, 0.95),
    rgba(0, 255, 136, 0.82)
  );
  color: #02140b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
  box-shadow: 0 8px 20px rgba(0, 255, 136, 0.22);
}

.field-action:hover {
  transform: translateY(-50%) scale(1.04);
  box-shadow: 0 12px 26px rgba(0, 255, 136, 0.3);
}
.field-action:disabled {
  opacity: 0.65;
  cursor: wait;
}
.field-action svg {
  width: 18px;
  height: 18px;
}

/* ── Messages ───────────────────────────────────────────────── */
.message {
  min-height: 20px;
  font-size: 14px;
  line-height: 1.55;
  transition: color 200ms;
}
.message--muted {
  color: rgba(255, 255, 255, 0.55);
}
.message--error {
  color: var(--color-error);
}
.message--success {
  color: var(--color-success);
}
.message--warning {
  color: var(--color-warning);
}

/* ── Status chip ────────────────────────────────────────────── */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 136, 0.16);
  background: rgba(0, 255, 136, 0.05);
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
  width: fit-content;
}

.status-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.85);
  }
}

/* ── Section labels ─────────────────────────────────────────── */
.eyebrow {
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 700;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 280ms ease,
    visibility 280ms ease;
  z-index: 1000;
}

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

.modal-overlay__bg {
  position: absolute;
  inset: 0;
}

.modal-window {
  position: relative;
  width: min(100%, 560px);
  padding: 36px;
  border-radius: 28px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.05),
      rgba(255, 255, 255, 0.02)
    ),
    rgba(4, 4, 4, 0.97);
  border: 1px solid rgba(0, 255, 136, 0.16);
  box-shadow:
    0 0 40px rgba(0, 255, 136, 0.12),
    0 24px 80px rgba(0, 0, 0, 0.6);
  color: #ffffff;
  animation: modalIn 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  overflow: hidden;
}

/* Scrollable variant for tall modals (renew, topup) */
.modal-window.renew-modal-window,
.modal-window.topup-modal-window {
  overflow-y: auto;
  max-height: 100svh;
  box-sizing: border-box;
  margin: 16px;
}

/* Scrollbar styling for modal windows */
.modal-window::-webkit-scrollbar {
  width: 4px;
}
.modal-window::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}
.modal-window::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 136, 0.3);
  border-radius: 4px;
}
.modal-window::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 136, 0.5);
}

.modal-window::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at top right,
    rgba(0, 255, 136, 0.1),
    transparent 30%
  );
}

@keyframes modalIn {
  from {
    transform: translateY(18px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition:
    background var(--transition),
    color var(--transition);
  z-index: 2;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.modal-sub {
  margin: 0 0 24px;
  color: var(--color-text-muted);
  font-size: 15px;
  line-height: 1.65;
}

/* ── Toast notifications ────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(10, 10, 10, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  max-width: 340px;
  pointer-events: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: toastIn 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.toast.is-hiding {
  animation: toastOut 240ms ease both;
}

.toast--success {
  border-color: rgba(0, 255, 136, 0.25);
}
.toast--error {
  border-color: rgba(255, 100, 100, 0.25);
}
.toast--warning {
  border-color: rgba(255, 160, 0, 0.25);
}

.toast__icon {
  font-size: 18px;
  flex-shrink: 0;
}
.toast__text {
  flex: 1;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toastOut {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateX(20px) scale(0.95);
  }
}

/* ── Loading spinner ────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

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

/* ── Skeleton loading ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ── Reveal animation ───────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 600ms ease,
    transform 600ms ease;
  transition-delay: var(--delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Utility ────────────────────────────────────────────────── */
.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;
}

.text-accent {
  color: var(--color-accent);
}
.text-muted {
  color: var(--color-text-muted);
}
.text-error {
  color: var(--color-error);
}
.text-warning {
  color: var(--color-warning);
}

.divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin: 20px 0;
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
  margin: 20px 0;
}

.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
}

/* ── Badge ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge--green {
  background: rgba(0, 255, 136, 0.12);
  color: var(--color-accent);
  border: 1px solid rgba(0, 255, 136, 0.2);
}
.badge--red {
  background: rgba(255, 100, 100, 0.1);
  color: #ff8f8f;
  border: 1px solid rgba(255, 100, 100, 0.2);
}
.badge--yellow {
  background: rgba(255, 160, 0, 0.1);
  color: #ffa040;
  border: 1px solid rgba(255, 160, 0, 0.2);
}
.badge--blue {
  background: rgba(100, 180, 255, 0.1);
  color: #80c8ff;
  border: 1px solid rgba(100, 180, 255, 0.2);
}
.badge--recommended {
  background: rgba(0, 255, 136, 0.18);
  color: var(--color-accent);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

/* ── Text btn ───────────────────────────────────────────────── */
.text-btn {
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.6;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.12);
  text-underline-offset: 4px;
  transition:
    color var(--transition),
    text-decoration-color var(--transition);
}

.text-btn:hover {
  color: var(--color-text);
  text-decoration-color: rgba(0, 255, 136, 0.5);
}

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

.resend-timer {
  display: inline-block;
  margin-left: 8px;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  padding: 28px 0 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  font-size: 13px;
}

/* ── Stars bg (hero) ────────────────────────────────────────── */
.hero__stars,
.hero__stars::before,
.hero__stars::after {
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  pointer-events: none;
  content: "";
}

.hero__stars {
  background-image:
    radial-gradient(
      2px 2px at 20px 30px,
      rgba(255, 255, 255, 0.9),
      transparent 60%
    ),
    radial-gradient(
      1.5px 1.5px at 120px 90px,
      rgba(255, 255, 255, 0.7),
      transparent 60%
    ),
    radial-gradient(
      1.8px 1.8px at 220px 160px,
      rgba(0, 255, 136, 0.95),
      transparent 65%
    ),
    radial-gradient(
      1.2px 1.2px at 340px 60px,
      rgba(255, 255, 255, 0.8),
      transparent 60%
    );
  background-size: 360px 220px;
  animation: starsDrift 22s linear infinite;
  opacity: 0.85;
  z-index: -2;
}

.hero__stars::before {
  background-image:
    radial-gradient(
      1.4px 1.4px at 60px 60px,
      rgba(255, 255, 255, 0.8),
      transparent 60%
    ),
    radial-gradient(
      1px 1px at 180px 120px,
      rgba(0, 255, 136, 0.85),
      transparent 60%
    ),
    radial-gradient(
      1.8px 1.8px at 300px 180px,
      rgba(255, 255, 255, 0.75),
      transparent 60%
    );
  background-size: 340px 260px;
  animation: starsDriftReverse 30s linear infinite;
  opacity: 0.55;
}

.hero__stars::after {
  background: radial-gradient(
    circle at center,
    rgba(0, 255, 136, 0.06),
    transparent 40%
  );
  filter: blur(20px);
  opacity: 0.8;
}

@keyframes starsDrift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(220px);
  }
}
@keyframes starsDriftReverse {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-180px);
  }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (min-width: 980px) {
  .nav {
    display: flex;
  }
  .menu-toggle,
  .mobile-menu {
    display: none !important;
  }
}

/* ── Plan buttons ────────────────────────────────────────────────────────────── */
.plan-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.15s;
  color: var(--color-text);
}
.plan-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}
.plan-btn.is-active {
  background: rgba(0, 255, 136, 0.08);
  border-color: var(--color-accent);
}
.plan-btn.is-active .text-accent {
  color: var(--color-accent);
}

/* ── Top-up preset buttons ──────────────────────────────────────────────────── */
.topup-preset-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 700;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.topup-preset-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.topup-preset-btn.is-active {
  background: rgba(0, 255, 136, 0.12);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.topup-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

/* ── Balance pay section (renew modal) ─────────────────────────────────────── */
.balance-pay-section {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.balance-pay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.balance-pay-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.balance-pay-toggle input[type="checkbox"] {
  display: none;
}

.balance-pay-toggle__mark {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  transition:
    background 0.25s,
    border-color 0.25s;
  flex-shrink: 0;
}

.balance-pay-toggle__mark::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.balance-pay-toggle input:checked ~ .balance-pay-toggle__mark {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.balance-pay-toggle input:checked ~ .balance-pay-toggle__mark::after {
  transform: translateX(20px);
  background: #02140b;
}

.balance-pay-toggle__label {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.balance-pay-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ── Balance history ─────────────────────────────────────────────────────────── */
.balance-history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.balance-history-item__left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.balance-history-item__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.balance-history-item__icon--deposit {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.15);
}

.balance-history-item__icon--withdraw {
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.15);
}

.balance-history-item__info {
  min-width: 0;
}

.balance-history-item__desc {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  word-break: break-word;
}

.balance-history-item__meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 3px;
}

.balance-history-item__amount {
  font-size: 15px;
  font-weight: 900;
  flex-shrink: 0;
}

.balance-history-item__amount--deposit {
  color: var(--color-accent);
}
.balance-history-item__amount--withdraw {
  color: var(--color-error);
}

/* ── Balance card in home section ────────────────────────────────────────────── */
.balance-card {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    135deg,
    rgba(0, 255, 136, 0.1),
    rgba(0, 255, 136, 0.04)
  );
  border: 1px solid rgba(0, 255, 136, 0.2);
  cursor: pointer;
  transition:
    border-color 0.2s,
    transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.balance-card:hover {
  border-color: rgba(0, 255, 136, 0.35);
  transform: translateY(-1px);
}

.balance-card__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.balance-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(0, 255, 136, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.balance-card__label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.balance-card__value {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--color-accent);
}

.balance-card__right {
  text-align: right;
}

.balance-card__action {
  font-size: 11px;
  color: rgba(0, 255, 136, 0.7);
  font-weight: 600;
}

/* ── Consent checkboxes ──────────────────────────────────────────────────────── */
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}
.consent-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

/* ── Responsive: Panel layout ────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w) - 20px));
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: flex;
  }
  .sidebar-backdrop.is-open {
    display: block;
  }
  .main-content {
    margin-left: 0;
    padding: 24px 16px 80px;
  }

  .info-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  .app-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  .platform-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .actions-row {
    gap: 10px;
  }
  .actions-row .btn {
    font-size: 13px;
    padding: 0 16px;
  }

  .device-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .device-item .btn {
    align-self: flex-start;
  }

  .section-header {
    margin-bottom: 20px;
  }
  .section-title {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
  }
  .section-sub {
    font-size: 14px;
  }
}

/* ── Responsive: Tablet & small screens ──────────────────────── */
@media (max-width: 767px) {
  .hero__grid {
    width: min(30vw, 120px);
  }
  .hero__content {
    padding: 0 8px;
  }

  .hero {
    padding-top: calc(var(--header-h) + 16px);
    padding-bottom: 24px;
  }
  .hero__title {
    font-size: clamp(1.6rem, 6vw, 2.8rem);
  }
  .hero__subtitle {
    font-size: 14px;
    margin-top: 12px;
  }
  .hero__eyebrow {
    font-size: 12px;
    padding: 7px 12px;
  }

  .auth-stage-wrap {
    min-height: 260px;
  }

  .tariff-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .tariff-card {
    padding: 22px 18px;
  }

  .pkg-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .pkg-card {
    padding: 12px 8px;
  }
  .pkg-card__icon {
    font-size: 20px;
  }
  .pkg-card__label {
    font-size: 12px;
  }
  .pkg-card__devices {
    font-size: 11px;
  }
  .pkg-card__price {
    font-size: 12px;
  }

  .glass-card {
    padding: 22px 18px !important;
  }

  .modal-window {
    padding: 28px 22px;
  }
  .modal-window.renew-modal-window,
  .modal-window.topup-modal-window {
    padding: 28px 18px;
  }

  .topup-preset-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .topup-preset-btn {
    padding: 8px 2px;
    font-size: 12px;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .info-card {
    padding: 16px;
  }
  .info-card__label {
    font-size: 11px;
  }
  .info-card__value {
    font-size: 1.3rem;
  }

  .actions-row {
    flex-direction: column;
  }
  .actions-row .btn {
    width: 100%;
  }

  .balance-history-item {
    flex-direction: column;
    gap: 8px;
  }
  .balance-history-item__amount {
    align-self: flex-start;
  }

  .platform-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .platform-btn {
    padding: 14px 8px;
    font-size: 12px;
  }
  .platform-btn__icon {
    font-size: 24px;
  }
}

/* ── Responsive: Phone ───────────────────────────────────────── */
@media (max-width: 480px) {
  .hero__title {
    font-size: clamp(1.4rem, 7vw, 2.2rem);
    letter-spacing: -0.03em;
  }
  .hero__subtitle {
    font-size: 13px;
    line-height: 1.6;
  }
  .hero__eyebrow {
    font-size: 11px;
    padding: 6px 10px;
    gap: 6px;
  }
  .hero__grid {
    width: min(40vw, 80px);
  }

  .auth-stage-wrap {
    min-height: 240px;
  }

  .input-shell input {
    height: 52px;
    font-size: 16px;
    padding: 0 16px;
  }
  .input-shell--has-action input {
    padding-right: 64px;
  }
  .field-action {
    width: 42px;
    height: 42px;
    right: 5px;
  }

  .glass-card {
    padding: 18px 14px !important;
  }

  .tariff-card {
    padding: 18px 14px;
  }
  .tariff-card__name {
    font-size: 14px;
    margin-bottom: 8px;
  }
  .tariff-card__price {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }
  .tariff-card__per {
    font-size: 12px;
  }
  .tariff-card__unit {
    font-size: 11px;
  }
  .tariff-card__features {
    gap: 6px;
  }
  .tariff-card__features li {
    font-size: 12px;
  }

  .modal-overlay {
    padding: 12px;
  }
  .modal-window {
    padding: 24px 16px;
    border-radius: 22px;
  }
  .modal-window.renew-modal-window,
  .modal-window.topup-modal-window {
    padding: 24px 14px;
    margin: 8px;
  }
  .modal-close {
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  .modal-title {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
    margin-bottom: 6px;
  }
  .modal-sub {
    font-size: 14px;
    margin-bottom: 18px;
  }

  .plan-btn {
    padding: 12px 8px;
  }
  .plan-btn > div:first-child {
    font-size: 18px;
  }
  .plan-btn > div:nth-child(2) {
    font-size: 13px;
  }
  .plan-btn > div:nth-child(3) {
    font-size: 11px;
  }

  .topup-preset-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .topup-preset-btn {
    padding: 10px 4px;
    font-size: 13px;
  }

  .pkg-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .pkg-card {
    padding: 10px 6px;
    border-radius: 12px;
  }
  .pkg-card__icon {
    font-size: 18px;
  }
  .pkg-card__label {
    font-size: 11px;
  }
  .pkg-card__devices {
    font-size: 10px;
  }
  .pkg-card__price {
    font-size: 11px;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .info-card {
    padding: 14px;
  }
  .info-card__value {
    font-size: 1.2rem;
  }

  .device-item {
    padding: 12px 14px;
    gap: 8px;
  }
  .device-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 18px;
  }
  .device-item__name {
    font-size: 13px;
  }
  .device-item__meta {
    font-size: 11px;
  }
  .btn--sm {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  .platform-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .platform-btn {
    padding: 12px 6px;
    font-size: 11px;
    border-radius: 12px;
  }
  .platform-btn__icon {
    font-size: 22px;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }
  .app-card {
    padding: 14px;
  }
  .app-card__icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .app-card__name {
    font-size: 14px;
  }
  .app-card__desc {
    font-size: 12px;
  }

  .balance-card {
    padding: 12px 14px;
  }
  .balance-card__icon {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
  .balance-card__label {
    font-size: 11px;
  }
  .balance-card__value {
    font-size: 1rem;
  }

  .balance-pay-section {
    padding: 12px 14px;
  }
  .balance-pay-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .balance-pay-toggle__label {
    font-size: 13px;
  }

  .consent-label,
  .consent-check {
    font-size: 12px;
    line-height: 1.5;
  }
  .consent-label input[type="checkbox"],
  .consent-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
  }

  .section-header {
    margin-bottom: 16px;
  }
  .section-title {
    font-size: clamp(1.3rem, 6vw, 1.6rem);
  }
  .section-sub {
    font-size: 13px;
  }

  .tips-block {
    padding: 14px;
  }
  .tips-block__title {
    font-size: 12px;
  }
  .tips-list li {
    font-size: 12px;
  }

  .instruction-step {
    grid-template-columns: 28px 1fr;
    gap: 10px;
  }
  .instruction-step__num {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .instruction-step__text {
    font-size: 13px;
  }

  .copy-field {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  .copy-field .btn {
    width: 100%;
  }

  .toast-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
  }
  .toast {
    max-width: 100%;
    padding: 12px 14px;
    font-size: 13px;
  }

  .footer {
    padding: 20px 0 32px;
    font-size: 12px;
  }

  #expiredModal .modal-window {
    padding: 24px 16px;
  }
  #expiredModal .modal-window > div:first-child {
    font-size: 36px;
    margin-bottom: 12px;
  }

  .attempts-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .or-divider {
    gap: 12px;
    font-size: 12px;
    margin: 16px 0;
  }

  .slider-row {
    gap: 10px;
  }
  .slider-row label {
    font-size: 13px;
  }
  .slider-val {
    font-size: 14px;
  }

  .tg-user-preview {
    padding: 10px;
    gap: 10px;
  }
  .tg-avatar {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }
  .tg-user-preview__name {
    font-size: 14px;
  }
  .tg-user-preview__username {
    font-size: 12px;
  }
}

/* ── Responsive: Very small phones ───────────────────────────── */
@media (max-width: 360px) {
  .hero__title {
    font-size: clamp(1.2rem, 8vw, 1.8rem);
  }
  .modal-window {
    padding: 20px 12px;
  }
  .modal-window.renew-modal-window,
  .modal-window.topup-modal-window {
    padding: 20px 10px;
  }
  .tariff-card {
    padding: 14px 10px;
  }
  .pkg-card {
    padding: 8px 4px;
  }
  .pkg-card__icon {
    font-size: 16px;
  }
  .pkg-card__label {
    font-size: 10px;
  }
  .pkg-card__price {
    font-size: 10px;
  }
  .consent-label {
    font-size: 11px;
    gap: 6px;
  }
  .consent-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
  }
}

/* ── Responsive: reduced motion ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal,
  .reveal.is-visible {
    transform: none !important;
    opacity: 1 !important;
  }
}
