:root {
  color-scheme: dark;
  --bg: #070a0f;
  --surface: rgba(18, 23, 32, 0.78);
  --surface-solid: #111720;
  --surface-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.11);
  --text: #f4f7fb;
  --muted: #929cab;
  --accent: #35a7ff;
  --accent-strong: #108de9;
  --good: #55d69e;
  --danger: #ff7185;
  --radius: 24px;
  --shadow: 0 32px 90px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(33, 102, 158, 0.22), transparent 45%),
    linear-gradient(145deg, #070a0f 0%, #090d13 48%, #06080c 100%);
  overflow-x: hidden;
}

a { color: inherit; }

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.ambient {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

.ambient-one { top: -15rem; right: -10rem; background: #32a6ff; }
.ambient-two { bottom: -20rem; left: -16rem; background: #4265ff; }

.site-header,
.page,
.activate-page,
footer {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 760;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand img { border-radius: 12px; }

.header-link,
.quiet-button,
.text-button {
  color: var(--muted);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 160ms ease;
}

.header-link:hover,
.quiet-button:hover,
.text-button:hover { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.page {
  min-height: calc(100vh - 174px);
  padding: 64px 0;
}

.auth-panel,
.loading-panel {
  max-width: 560px;
  margin-inline: auto;
}

.intro h1,
.activate-copy h1 {
  margin: 14px 0 22px;
  max-width: 760px;
  font-size: clamp(48px, 6.4vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.065em;
  font-weight: 760;
}

.intro h1 span,
.activate-copy h1 span {
  color: transparent;
  background: linear-gradient(100deg, #c8e9ff 5%, #32a6ff 62%, #2679ec);
  -webkit-background-clip: text;
  background-clip: text;
}

.intro > p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.65;
}

.eyebrow,
.panel-kicker,
.metric-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.panel {
  width: 100%;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.panel-heading,
.dashboard-top,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-heading h2,
.dashboard h2,
.section-heading h3,
.success-panel h2 {
  margin: 7px 0 0;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.secure-mark,
.account-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(85, 214, 158, 0.28);
  border-radius: 999px;
  color: var(--good);
  background: rgba(85, 214, 158, 0.08);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.secure-mark::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 12px var(--good);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 30px 0 26px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.auth-tab.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.18);
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form[hidden] { display: none; }

label {
  display: grid;
  gap: 8px;
  color: #cbd2dc;
  font-size: 13px;
  font-weight: 620;
}

label small { color: var(--muted); font-weight: 500; }

input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--text);
  background: rgba(2, 5, 9, 0.48);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder { color: #646e7c; }

input:focus {
  border-color: rgba(53, 167, 255, 0.75);
  background: rgba(8, 14, 21, 0.9);
  box-shadow: 0 0 0 4px rgba(53, 167, 255, 0.11);
}

.password-field { position: relative; display: block; }
.password-field input { padding-right: 90px; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  min-height: 34px;
  padding: 0 9px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover { color: var(--text); background: var(--surface-soft); }

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
  padding: 0 19px;
  border: 0;
  border-radius: 14px;
  color: #02111e;
  background: linear-gradient(110deg, #a5dcff, #38aaff 58%, #1688ec);
  box-shadow: 0 14px 34px rgba(23, 139, 231, 0.24);
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.auth-form .primary-button,
.activation-panel .primary-button { width: 100%; margin-top: 5px; }

.primary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 18px 42px rgba(23, 139, 231, 0.32);
}

.primary-button:disabled {
  opacity: 0.56;
  cursor: wait;
  transform: none;
}

.secondary-button {
  min-height: 44px;
  padding: 0 15px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  box-shadow: none;
  font-size: 13px;
}

.secondary-button:hover { background: rgba(255, 255, 255, 0.09); transform: translateY(-1px); }
.secondary-button.wide { width: 100%; margin-top: 12px; }

.form-note,
.code-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.form-note a { color: #c8e9ff; }

.form-message {
  min-height: 20px;
  margin-top: 16px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.form-message.success { color: var(--good); }

.dashboard {
  display: grid;
  gap: 22px;
  align-self: stretch;
}

.dashboard[hidden] { display: none; }

.dashboard-top {
  align-items: center;
  padding: 4px 2px 10px;
}

.dashboard-top p { margin: 8px 0 0; color: var(--muted); }

.quiet-button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.metric-card,
.device-section {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
}

.metric-card strong {
  display: block;
  margin: 13px 0 8px;
  font-size: 32px;
  letter-spacing: -0.04em;
}

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

.plan-card {
  background:
    radial-gradient(circle at 90% 0%, rgba(53, 167, 255, 0.17), transparent 46%),
    rgba(255, 255, 255, 0.045);
}

.tariff-section {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.payment-provider {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
}

.tariff-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.tariff-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(0, 0, 0, 0.2);
}

.tariff-card.current {
  border-color: rgba(53, 167, 255, 0.38);
  background:
    radial-gradient(circle at 100% 0%, rgba(53, 167, 255, 0.13), transparent 48%),
    rgba(0, 0, 0, 0.2);
}

.tariff-card.upgrade {
  border-color: rgba(85, 214, 158, 0.38);
  background:
    radial-gradient(circle at 100% 0%, rgba(85, 214, 158, 0.12), transparent 48%),
    rgba(0, 0, 0, 0.2);
}

.tariff-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
}

.tariff-heading strong {
  font-size: 22px;
  letter-spacing: -0.035em;
}

.tariff-price {
  color: #c8e9ff;
  font-size: 14px;
  font-weight: 720;
  white-space: nowrap;
}

.tariff-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.tariff-card ul {
  display: grid;
  gap: 7px;
  min-height: 76px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #cbd2dc;
  font-size: 13px;
}

.tariff-card li::before {
  content: "✓";
  margin-right: 8px;
  color: var(--good);
}

.tariff-button {
  width: 100%;
  margin-top: auto;
}

.tariff-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.tariff-cancel {
  width: 100%;
  margin: -2px 0 0;
  padding: 8px;
  font-size: 12px;
  text-align: center;
}

.tariff-cancel:disabled { opacity: 0.5; cursor: wait; }

.payment-email-field {
  max-width: 520px;
  margin-top: 20px;
}

.payment-email-field input {
  min-height: 48px;
}

.payment-email-field small {
  line-height: 1.5;
}

.payment-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.section-heading { align-items: center; }
.section-heading h3 { font-size: 24px; }

.device-list { display: grid; gap: 10px; margin-top: 24px; }

.device-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.device-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #bfe5ff;
  background: rgba(53, 167, 255, 0.11);
  font-size: 19px;
}

.device-info strong,
.device-info span { display: block; }
.device-info strong { font-size: 14px; }
.device-info span { margin-top: 4px; color: var(--muted); font-size: 12px; }

.device-remove {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(255, 113, 133, 0.18);
  border-radius: 10px;
  color: #ff9aaa;
  background: rgba(255, 113, 133, 0.06);
  cursor: pointer;
}

.empty-devices {
  padding: 26px 10px;
  color: var(--muted);
  text-align: center;
}

.loading-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 130px;
  color: var(--muted);
}

.loading-panel[hidden] { display: none; }

.loader {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

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

.activate-page {
  min-height: calc(100vh - 174px);
  padding: 72px 0;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 0.72fr);
  gap: clamp(50px, 10vw, 140px);
  align-items: center;
}

.activate-copy h1 { font-size: clamp(48px, 6vw, 76px); }

.steps {
  list-style: none;
  display: grid;
  gap: 17px;
  margin: 38px 0 0;
  padding: 0;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}

.steps li > span {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(53, 167, 255, 0.28);
  border-radius: 50%;
  color: #bfe5ff;
  background: rgba(53, 167, 255, 0.08);
  font-size: 12px;
  font-weight: 760;
}

.steps p { margin: 0; line-height: 1.5; }
.activate-flow { width: 100%; }
.compact { padding: clamp(24px, 3vw, 34px); }

.activation-panel form { display: grid; gap: 18px; margin-top: 30px; }

.code-label { text-align: center; }

.code-input {
  min-height: 78px;
  padding: 0 14px;
  text-align: center;
  font-size: clamp(30px, 7vw, 42px);
  font-weight: 780;
  letter-spacing: 0.2em;
  font-variant-numeric: tabular-nums;
}

.code-help { margin-top: -10px; text-align: center; }

.text-button {
  display: block;
  margin: 20px auto 0;
  font-size: 13px;
}

.success-panel { text-align: center; }

.success-icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
  border: 1px solid rgba(85, 214, 158, 0.35);
  border-radius: 50%;
  color: var(--good);
  background: rgba(85, 214, 158, 0.1);
  box-shadow: 0 0 45px rgba(85, 214, 158, 0.12);
  font-size: 27px;
}

.success-panel p { color: var(--muted); line-height: 1.6; }

footer {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: #687281;
  font-size: 12px;
}

footer a { text-decoration: none; }
footer a:hover { color: var(--text); }

@media (max-width: 860px) {
  .page,
  .activate-page {
    grid-template-columns: 1fr;
    gap: 44px;
    min-height: auto;
    padding: 52px 0 70px;
  }

  .intro,
  .activate-copy { text-align: center; }
  .intro > p { margin-inline: auto; }
  .steps { max-width: 460px; margin-inline: auto; text-align: left; }
  .auth-panel,
  .activate-flow { width: min(100%, 540px); margin-inline: auto; }
}

@media (max-width: 560px) {
  .site-header,
  .page,
  .activate-page,
  footer { width: min(100% - 28px, 1180px); }

  .site-header { min-height: 76px; }
  .brand { font-size: 16px; }
  .brand img { width: 38px; height: 38px; }
  .header-link { font-size: 12px; }
  .header-actions { gap: 12px; }

  .page,
  .activate-page { padding-top: 38px; gap: 34px; }

  .intro h1,
  .activate-copy h1 { font-size: clamp(42px, 13vw, 58px); }
  .intro > p { font-size: 16px; }

  .panel { padding: 23px 18px; border-radius: 20px; }
  .secure-mark { display: none; }
  .auth-tabs { margin-top: 24px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .metric-card,
  .device-section,
  .tariff-section { padding: 20px 16px; }
  .tariff-list { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .secondary-button { width: 100%; }
  .device-row { grid-template-columns: 38px minmax(0, 1fr); }
  .device-remove { grid-column: 2; justify-self: start; }
  footer { min-height: 95px; flex-direction: column; justify-content: center; text-align: center; }
}

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