:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #ffffff;
  background: #000000;
  --bg: #000000;
  --panel: #050505;
  --text: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.78);
  --text-muted: rgba(255, 255, 255, 0.58);
  --accent: #56d7e8;
  --accent-hover: #6be6f5;
  --success: #7fd957;
  --error: #ff5c5c;
  --border: rgba(255, 255, 255, 0.9);
}

* {
  box-sizing: border-box;
}

html {
  background: #000000;
}

body {
  min-width: 320px;
  margin: 0;
  background: #000000;
  color: var(--text);
  font-size: 16px;
  line-height: 1.42;
}

button,
input {
  font: inherit;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #000000;
}

.screen,
.home-screen {
  width: 100%;
  max-width: 430px;
}

.screen {
  display: grid;
  align-content: start;
  gap: 22px;
  padding-top: 18px;
}

.home-screen {
  min-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 34px;
  align-items: center;
  padding: 42px 0 18px;
}

.logo-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
}

.brand-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100%, 360px);
  max-height: 360px;
  object-fit: contain;
}

.brand-logo:not([src]),
.brand-logo[src=""] {
  display: none;
}

.logo-placeholder {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: none;
  width: min(100%, 320px);
  min-height: 180px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 800;
}

.brand-logo:not([src]) + .logo-placeholder,
.brand-logo[src=""] + .logo-placeholder {
  display: grid;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: 0;
}

h2 {
  font-size: 25px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
}

h3 {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
}

.lead {
  font-size: 25px;
  line-height: 1.2;
  font-weight: 800;
}

.actions,
.trial-form,
.login-form,
.trial-result,
.cabinet,
.order-form,
.payment-summary {
  display: grid;
  gap: 16px;
}

.actions-stack {
  gap: 12px;
}

.button {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.primary {
  color: #000000;
  background: var(--accent);
  border-color: var(--accent);
}

.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.secondary {
  color: #ffffff;
  background: #000000;
  border-color: var(--border);
}

.button:disabled,
.link-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.trial-form,
.login-form {
  gap: 14px;
}

.trial-form label,
.login-form label {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.trial-form input,
.login-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: #000000;
  color: var(--text);
}

.trial-form input::placeholder,
.login-form input::placeholder {
  color: var(--text-muted);
}

.trial-form input:focus,
.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.form-error,
.form-success {
  margin: 0;
  font-weight: 700;
}

.form-error {
  color: var(--error);
}

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

.link-button {
  width: fit-content;
  justify-self: center;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.text-link {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.centered {
  justify-self: center;
  text-align: center;
}

.site-footer {
  width: 100%;
  max-width: 430px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  padding: 22px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.site-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.helper-text {
  color: var(--text-secondary);
}

.legal-page {
  padding-bottom: 0;
}

.legal-section {
  display: grid;
  gap: 12px;
}

.legal-list,
.plain-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.plain-list {
  list-style: none;
}

.legal-list div {
  display: grid;
  gap: 3px;
}

.legal-list dt {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.legal-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 700;
}

.section-row,
.account-summary,
.slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid currentColor;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.success {
  color: var(--success);
}

.copy-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.copy-card.compact {
  min-height: 50px;
}

.copy-card code {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.35;
}

.copy-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #000000;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
}

.copy-button.is-copied {
  border-color: var(--accent);
  color: var(--accent);
}

.account-summary {
  padding-bottom: 2px;
}

.meta-label {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
}

.account-name {
  margin-top: 3px;
  font-size: 18px;
  font-weight: 800;
}

.panel,
.tariff-calculator,
.paid-keys {
  display: grid;
  gap: 16px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.info-card {
  min-height: 88px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #000000;
}

.info-card span {
  font-size: 14px;
  font-weight: 700;
}

.info-card strong {
  min-width: 0;
  font-size: 16px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.period-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.period-options label {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #000000;
  font-weight: 700;
  text-align: center;
}

.period-options label:has(input:checked) {
  border-color: var(--accent);
  color: #000000;
  background: var(--accent);
}

.period-options input {
  accent-color: #000000;
}

.device-slider {
  display: grid;
  gap: 12px;
  font-weight: 700;
}

.slider-head output {
  min-width: 36px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #000000;
  font-weight: 800;
}

.device-slider input[type="range"] {
  width: 100%;
  height: 6px;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--range-progress, 0%), rgba(255, 255, 255, 0.22) var(--range-progress, 0%));
  outline: none;
}

.device-slider input[type="range"]::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  appearance: none;
  border: 2px solid #000000;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.device-slider input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 2px solid #000000;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.total-price {
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
}

.paid-subscriptions-list {
  display: grid;
  gap: 12px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.paid-subscription {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.subscription-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.subscription-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.subscription-meta dt {
  color: var(--text-muted);
  font-weight: 600;
}

.subscription-meta dd {
  margin: 0;
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
}

.empty-state {
  color: var(--text-secondary);
}

.logout-form {
  display: grid;
}

.payment-summary {
  width: 100%;
}

@media (min-width: 720px) {
  .page {
    align-items: start;
  }
}

@media (max-width: 370px) {
  .page {
    padding: 16px;
  }

  h1 {
    font-size: 30px;
  }

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