﻿:root {
  --bg: #090909;
  --bg-soft: #111111;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --line: #222222;
  --white: #ffffff;
  --black: #000000;
}

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

body {
  font-family: 'Space Grotesk', sans-serif;
  background: radial-gradient(circle at 20% 10%, #1a1a1a 0%, var(--bg) 45%, var(--black) 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
  z-index: 0;
}

.topbar,
main,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  width: min(1100px, 92vw);
  margin: 2rem auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: rgba(8, 8, 8, 0.72);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 120%;
  pointer-events: none;
  background: radial-gradient(ellipse at top, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 55%);
}

.logo {
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.9rem;
}

.login-btn {
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.08);
  transition: background 180ms ease, transform 180ms ease;
}

.login-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.topbar-actions form {
  margin: 0;
}

main {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.hero {
  margin-top: 5.5rem;
  margin-bottom: 5rem;
  position: relative;
  text-align: center;
}

.label {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

h1 {
  font-size: clamp(2.4rem, 8vw, 6rem);
  line-height: 0.95;
  margin-bottom: 1rem;
}

.subtitle {
  max-width: 640px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 auto;
}

.cta-row {
  margin-top: 2rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: var(--white);
  color: var(--black);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  text-align: center;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.3rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
}

.card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
}

.card p {
  color: var(--muted);
  line-height: 1.5;
}

.metrics {
  margin: 4rem 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  text-align: center;
}

.metric {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 700;
}

.metrics p {
  color: var(--muted);
  margin-top: 0.4rem;
}

.footer {
  width: min(1100px, 92vw);
  margin: 0 auto 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
}

.policy-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.policy-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 180ms ease;
}

.policy-link:hover {
  color: var(--white);
}

.footer small {
  margin-left: auto;
  text-align: right;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 650ms ease, transform 650ms ease;
}

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

.home-link {
  text-decoration: none;
  color: var(--text);
}

.auth-main {
  width: min(1100px, 92vw);
  margin: 0 auto;
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
  animation: auth-card-in 520ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.auth-title {
  font-size: 1.8rem;
  margin-bottom: 1.2rem;
}

.auth-form {
  display: grid;
  gap: 0.75rem;
}

.auth-form label {
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  outline: none;
}

.auth-form input:focus {
  border-color: rgba(255, 255, 255, 0.35);
}

.auth-hint {
  margin-top: -0.2rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.policy-consent {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  flex-wrap: wrap;
  white-space: normal;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.25;
  user-select: none;
  overflow: visible;
  padding-bottom: 0;
}

.policy-consent input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  display: inline-grid;
  place-content: center;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.policy-consent input[type='checkbox']::before {
  content: '';
  width: 5px;
  height: 9px;
  border-right: 2px solid #050505;
  border-bottom: 2px solid #050505;
  transform: translateY(-1px) rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform 140ms ease;
}

.policy-consent input[type='checkbox']:checked {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.policy-consent input[type='checkbox']:checked::before {
  transform: translateY(-1px) rotate(45deg) scale(1);
}

.policy-consent input[type='checkbox']:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.65);
}

.policy-consent a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.policy-consent a:hover {
  color: #cfcfcf;
}

.policy-note {
  margin-top: 0.65rem;
  font-size: 0.72rem;
  color: #9b9b9b;
  line-height: 1.35;
}

.policy-note a {
  color: #cfcfcf;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.policy-note a:hover {
  color: #ffffff;
}

.auth-error {
  display: none;
  font-size: 0.85rem;
  color: #ff8f8f;
}

.auth-error.visible {
  display: block;
}

.auth-notice {
  display: none;
  font-size: 0.85rem;
  color: #9fd6a8;
}

.auth-notice.visible {
  display: block;
}

.auth-actions {
  display: grid;
  gap: 0.22rem;
}

.auth-actions .btn {
  width: 100%;
}

.verify-actions {
  margin-top: 0.5rem;
  gap: 0.45rem;
}

.verify-actions form {
  margin: 0;
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.tg-preview {
  margin-top: 0;
  margin-bottom: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  overflow: hidden;
  transition: max-height 260ms ease, opacity 240ms ease, transform 240ms ease, margin 240ms ease, padding 240ms ease, border-color 240ms ease;
}

.tg-preview.tg-preview-visible {
  margin-top: 0.2rem;
  margin-bottom: 0.4rem;
  border-color: var(--line);
  padding: 0.7rem;
  max-height: 140px;
  opacity: 1;
  transform: translateY(0);
}

.tg-avatar-wrap {
  width: 48px;
  height: 48px;
  position: relative;
  flex-shrink: 0;
}

.tg-avatar,
.tg-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.tg-avatar {
  display: none;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tg-avatar-fallback {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 700;
}

.tg-profile-meta {
  min-width: 0;
}

.tg-name {
  font-size: 0.96rem;
  color: var(--text);
  line-height: 1.2;
}

.tg-user-id {
  margin-top: 0.2rem;
  font-size: 0.86rem;
  color: var(--muted);
  word-break: break-all;
}

.auth-submit {
  margin-top: 0;
}

.verify-link {
  margin-top: 0.35rem;
  width: 100%;
}

.verify-deadline {
  color: #ff8f8f;
}

.verify-token-box {
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
}

.verify-token {
  margin-top: 0.3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  word-break: break-all;
}

.cabinet-main {
  width: min(1100px, 92vw);
  margin: 0 auto 2.2rem;
}

.cabinet-main .auth-card {
  width: min(840px, 100%);
  margin: 0 auto;
}

.cabinet-extra {
  margin-top: 1.2rem;
}

.cabinet-main > .cabinet-extra {
  margin-top: 1.2rem;
}

.cabinet-extra .cabinet-sub {
  margin-bottom: 0.7rem;
}

.cabinet-grid {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.referral-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cabinet-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
}

.cabinet-label {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.cabinet-value {
  margin-top: 0.45rem;
  font-size: 1.12rem;
  color: var(--text);
  font-weight: 700;
}

.cabinet-sub {
  margin-top: 0.2rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.cabinet-sub-active {
  color: #b7d7ff;
}

.cabinet-sub-expired {
  color: #ff8f8f;
  font-weight: 700;
}

.cabinet-section {
  margin-top: 1rem;
}

.cabinet-section-title {
  font-size: 1.1rem;
  margin-bottom: 0.65rem;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: start;
}

.tutorial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.tutorial-selector {
  margin-bottom: 1.1rem;
  text-align: center;
}

.tutorial-selector .label {
  margin-bottom: 0.7rem;
}

.device-selector {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

.device-tab {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
  font: inherit;
  font-size: 0.88rem;
}

.device-tab:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
}

.device-tab.active {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.14);
}

.tutorial-card {
  position: relative;
  display: none;
  opacity: 0;
  transform: translateY(8px);
}

.tutorial-card.active {
  display: block;
  animation: tutorial-in 320ms ease forwards;
}

.tutorial-card p + p {
  margin-top: 0.4rem;
}

.tutorial-panel-windows {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
  padding: 1.3rem;
}

.tutorial-panel-windows > h2,
.tutorial-panel-windows > .tutorial-intro {
  padding-inline: 0.2rem;
}

.tutorial-intro {
  margin-top: 0.35rem;
  color: var(--muted);
  line-height: 1.5;
}

.tutorial-flow {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.9rem;
}

.tutorial-step {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 1.2rem;
  background:
    radial-gradient(circle at 85% 10%, rgba(255, 255, 255, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(18, 18, 18, 0.92), rgba(10, 10, 10, 0.92));
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.9rem;
  align-items: start;
}

.tutorial-step-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #f3f3f3;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  background: rgba(255, 255, 255, 0.06);
}

.tutorial-step-body h3 {
  font-size: clamp(1.06rem, 2.4vw, 1.42rem);
  line-height: 1.2;
}

.tutorial-step-body p {
  margin-top: 0.45rem;
  color: #cdcdcd;
  line-height: 1.55;
}

.tutorial-step-btn {
  margin-top: 0.8rem;
  border-color: rgba(255, 255, 255, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
  color: var(--text);
  padding: 0.6rem 1rem;
}

.tutorial-step-btn:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.12));
}

.tutorial-step-links {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tutorial-step-links .tutorial-step-btn {
  margin-top: 0;
}

.tutorial-card.device-match {
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.tutorial-card.device-match::after {
  content: 'Ваше устройство';
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  color: var(--text);
}

.tutorial-panel-windows.device-match::after {
  top: 1rem;
  right: 1rem;
}

.plan-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
}

.plan-active {
  border-color: rgba(255, 255, 255, 0.35);
}

.plan-name {
  font-size: 1rem;
  font-weight: 700;
}

.plan-price {
  margin-top: 0.35rem;
  font-size: 1rem;
}

.plan-desc {
  margin-top: 0.5rem;
  margin-bottom: 0.35rem;
  min-height: 2.8em;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.plan-badge {
  margin-top: 0.65rem;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.76rem;
}

.plan-action {
  margin-top: 0.28rem;
  width: 100%;
}

.plan-card form {
  margin: 0;
}

.topup-inline {
  margin-top: 0.45rem;
}

.topup-inline .btn {
  padding: 0.45rem 0.75rem;
  font-size: 0.84rem;
}

.topup-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
}

.topup-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  appearance: textfield;
}

@keyframes auth-card-in {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tutorial-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .topbar {
    min-height: 64px;
    padding: 1rem 1.25rem;
  }

  .grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .footer small {
    margin-left: 0;
    text-align: left;
  }

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

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

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

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

  .tutorial-step {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .tutorial-panel-windows {
    padding: 1.3rem;
  }

}
