:root {
  color-scheme: dark;
  --bg: #06080d;
  --surface: #0d1219;
  --surface-2: #121a22;
  --line: #263442;
  --text: #f5f8fb;
  --muted: #aab6c2;
  --cyan: #26d6e8;
  --magenta: #ff3fc8;
  --green: #46d995;
  --yellow: #ffd166;
  --red: #ff6577;
  --focus: #9be9f1;
  --content: 1040px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

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

a {
  color: var(--cyan);
}

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

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 8, 13, 0.94);
  backdrop-filter: blur(14px);
}

.topbar-inner,
.page,
.footer-inner {
  width: min(100% - 32px, var(--content));
  margin: 0 auto;
}

.topbar-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-weight: 850;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.brand span {
  white-space: nowrap;
}

.top-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page {
  padding: 34px 0 68px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  align-items: center;
  gap: 42px;
  min-height: 310px;
  padding: 24px 0 38px;
}

.intro h1,
.section h2,
.account-head h1 {
  margin: 0;
  letter-spacing: 0;
}

.intro h1 {
  max-width: 720px;
  font-size: 46px;
  line-height: 1.04;
}

.intro p {
  max-width: 670px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.brand-orbit {
  width: min(260px, 66vw);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 50%;
  border: 1px solid rgba(38, 214, 232, 0.35);
  padding: 18px;
  box-shadow: 0 0 38px rgba(38, 214, 232, 0.13), 0 0 70px rgba(255, 63, 200, 0.08);
}

.brand-orbit img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.notice {
  margin: 18px 0;
  padding: 14px 16px;
  border-left: 4px solid var(--cyan);
  background: #0c1820;
  color: #d9f9fc;
  line-height: 1.45;
}

.notice[data-tone="error"] {
  border-left-color: var(--red);
  background: #211015;
  color: #ffd9df;
}

.notice[data-tone="success"] {
  border-left-color: var(--green);
  background: #0d1d17;
  color: #d9ffed;
}

.notice[data-tone="warning"] {
  border-left-color: var(--yellow);
  background: #211b0d;
  color: #fff1c5;
}

.section {
  border-top: 1px solid var(--line);
  padding: 34px 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section h2 {
  font-size: 26px;
}

.section-copy,
.muted {
  color: var(--muted);
  line-height: 1.5;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  gap: 34px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-weight: 750;
}

.field input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 12px 14px;
}

.field input:focus {
  border-color: var(--cyan);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  width: min(100%, 420px);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.segmented button {
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segmented button[aria-selected="true"] {
  background: #18323a;
  color: var(--text);
}

.button,
button.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  padding: 11px 16px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  border-color: #2ad9e4;
  background: #1bbac8;
  color: #031014;
}

.button.accent {
  border-color: #ff58cf;
  background: #e833b8;
  color: #16040f;
}

.button.ghost {
  background: transparent;
}

.button.danger {
  border-color: #7b3441;
  color: #ffb8c2;
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-row .button {
  flex: 0 1 auto;
}

.mt-18 {
  margin-top: 18px;
}

.mt-22 {
  margin-top: 22px;
}

.mt-24 {
  margin-top: 24px;
}

.tariff-grid,
.app-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tariff,
.app-item,
.metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.tariff h3,
.app-item h3,
.metric strong {
  margin: 0;
  font-size: 18px;
}

.tariff-price {
  margin: 12px 0 16px;
  color: var(--cyan);
  font-size: 24px;
  font-weight: 850;
}

.app-item {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
}

.app-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.metric span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 30px;
}

.account-head h1 {
  font-size: 34px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: var(--red);
}

.status-dot.active {
  background: var(--green);
  box-shadow: 0 0 12px rgba(70, 217, 149, 0.55);
}

.subscription-link {
  display: block;
  max-width: 100%;
  margin: 14px 0;
  padding: 12px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #090e14;
  color: #d8f9fc;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
}

.payment-list {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.payment-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 90px 100px minmax(100px, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 10px 13px;
  background: var(--surface);
}

.payment-row + .payment-row {
  border-top: 1px solid var(--line);
}

.hidden {
  display: none !important;
}

[data-loading="true"] {
  pointer-events: none;
  opacity: 0.65;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 36px;
}

@media (max-width: 760px) {
  .topbar-inner,
  .page,
  .footer-inner {
    width: min(100% - 32px, var(--content));
  }

  .topbar-inner {
    min-height: 60px;
  }

  .brand span {
    font-size: 15px;
  }

  .top-actions .button {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 14px;
  }

  .page {
    padding-top: 20px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 24px;
    min-height: 0;
  }

  .intro h1 {
    font-size: 35px;
  }

  .intro p {
    font-size: 16px;
  }

  .brand-orbit {
    grid-row: 1;
    width: min(210px, 60vw);
  }

  .auth-layout,
  .tariff-grid,
  .app-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .account-head,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button-row .button {
    width: 100%;
  }

  .payment-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 340px) {
  .brand span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
