@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/static/vendor/fonts/open-sans/open-sans-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/static/vendor/fonts/open-sans/open-sans-var-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/static/vendor/fonts/open-sans/open-sans-var-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/static/vendor/fonts/open-sans/open-sans-var-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

:root {
  --grad-sky: linear-gradient(180deg, #C9DDEB, #F3E9DC);
  --bg-primary: #F7F3EB;
  --bg-surface: #FFFFFF;
  --bg-secondary: #F3EEE5;
  --border-color: #E7E0D6;
  --text-primary: #1F1F1F;
  --text-secondary: #6E6963;
  --text-muted: #9B948A;
  --accent-primary: #171717;
  --accent-danger: #B8433A;
  --accent-success: #33B15C;
  --hero: #F9E3C8;
  --sky-halo: rgba(201, 221, 235, .6);
  --card-shadow: 0 18px 44px rgba(31, 26, 20, .13), 0 2px 6px rgba(31, 26, 20, .04), inset 0 1px 0 rgba(255, 255, 255, .9);
  --row-shadow: 0 12px 30px rgba(31, 26, 20, .09), 0 1px 3px rgba(31, 26, 20, .04);
  --line-shadow: 0 6px 16px rgba(31, 26, 20, .12), 0 0 0 1px rgba(31, 26, 20, .05);
  --sweep-sheen: rgba(255, 255, 255, .22);
  --ink-face: radial-gradient(120% 160% at 88% -40%, rgba(159, 194, 222, .42), transparent 55%), radial-gradient(90% 120% at 0% 130%, rgba(249, 227, 200, .22), transparent 60%), linear-gradient(180deg, #2C2C2C, #111111);
  --ink-text: #FFFFFF;
  --ink-shadow: 0 10px 24px rgba(23, 23, 23, .26), inset 0 1px 0 rgba(255, 255, 255, .16);
  --plate-rose-bg: #F6DEDB;
  --plate-rose-fg: #B05252;
  --plate-sky-bg: #E3EEF6;
  --plate-sky-fg: #4E7FA6;
  --plate-peach-bg: #FBEBD8;
  --plate-peach-fg: #B9772E;
  --plate-green-bg: #E4F2E7;
  --plate-green-fg: #2E7D45;
  --font-body: "Open Sans", "Segoe UI", "SF Pro Text", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

:root[data-theme="dark"] {
  --grad-sky: linear-gradient(180deg, #0F1523, #0F1523);
  --bg-primary: #0F1523;
  --bg-surface: #252C3E;
  --bg-secondary: #2A3244;
  --border-color: #333B4E;
  --text-primary: #F2EDE3;
  --text-secondary: #A9AEBC;
  --text-muted: #7E8595;
  --accent-primary: #F2EDE3;
  --accent-danger: #E88C81;
  --hero: #2A3244;
  --sky-halo: rgba(142, 190, 226, .3);
  --card-shadow: 0 18px 44px rgba(0, 0, 0, .5);
  --row-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --line-shadow: 0 6px 16px rgba(0, 0, 0, .35);
  --sweep-sheen: rgba(255, 255, 255, .08);
  --ink-face: #F2EDE3;
  --ink-text: #0F1523;
  --ink-shadow: 0 10px 24px rgba(0, 0, 0, .4);
  --plate-rose-bg: #3A2A33;
  --plate-rose-fg: #E88C81;
  --plate-sky-bg: #2A3244;
  --plate-sky-fg: #8EBEE2;
  --plate-peach-bg: #2A3244;
  --plate-peach-fg: #E0A25E;
  --plate-green-bg: #2A3244;
  --plate-green-fg: #74C68E;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  background-image: var(--grad-sky);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
}

.topbar {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-surface) 70%, transparent);
  box-shadow: var(--line-shadow);
}

.lang-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font: 650 13px/1 var(--font-body);
  letter-spacing: .04em;
  cursor: pointer;
}

.lang-btn[aria-pressed="true"] {
  background: var(--ink-face);
  color: var(--ink-text);
  box-shadow: var(--ink-shadow);
}

.banner {
  width: calc(100% - 32px);
  max-width: 1008px;
  margin: 8px auto 0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 20px;
  background: var(--bg-surface);
  box-shadow: var(--row-shadow);
}

.banner-icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--plate-rose-bg);
  color: var(--plate-rose-fg);
}

.banner[data-kind="slow"] .banner-icon {
  background: var(--plate-sky-bg);
  color: var(--plate-sky-fg);
}

.banner-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.4;
}

.banner-retry {
  flex: none;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink-face);
  color: var(--ink-text);
  box-shadow: var(--ink-shadow);
  font: 650 15px/1 var(--font-body);
  cursor: pointer;
}

.stage {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 16px 48px;
}

.card {
  position: relative;
  padding: 18px;
  border-radius: 24px;
  background: var(--bg-surface);
  box-shadow: var(--card-shadow);
}

.card-center {
  max-width: 480px;
  margin: 24px auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.plate {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--plate-sky-bg);
  color: var(--plate-sky-fg);
  box-shadow: var(--row-shadow);
}

.plate-peach {
  background: var(--plate-peach-bg);
  color: var(--plate-peach-fg);
}

.plate-rose {
  background: var(--plate-rose-bg);
  color: var(--plate-rose-fg);
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

h1 {
  margin: 0;
  font-size: 33px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.25;
}

p {
  margin: 0;
}

.lead {
  font-size: 16px;
  color: var(--text-secondary);
}

.micro {
  font-size: 13px;
  color: var(--text-muted);
}

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

.chip {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--bg-secondary);
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font: 650 17px/1.2 var(--font-body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}

.btn:active {
  transform: scale(.97);
}

.btn-primary {
  background: var(--ink-face);
  color: var(--ink-text);
  box-shadow: var(--ink-shadow);
}

.btn-line {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--line-shadow);
}

.returning {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 12px 0 0;
}

.returning .micro {
  margin: 0;
}

.btn-compact {
  min-height: 48px;
  font-size: 15px;
}

.btn.is-disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn.is-pending {
  pointer-events: none;
  cursor: progress;
}

.btn-spinner {
  display: none;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
}

.btn.is-pending .btn-spinner {
  display: inline-block;
}

.btn.is-pending > svg {
  display: none;
}

.btn:focus-visible,
.lang-btn:focus-visible,
.banner-retry:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

.apply-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 4px 0;
}

.hero-points {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-point {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 550;
}

.hero-point-plate {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg-surface) 75%, transparent);
  box-shadow: var(--row-shadow);
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step + .step {
  padding-top: 22px;
  border-top: 1px solid var(--border-color);
}

.step-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-badge {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-face);
  color: var(--ink-text);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(23, 23, 23, .22);
}

.step[data-step="done"] .step-badge {
  background: var(--accent-success);
  color: var(--ink-text);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--accent-success) 40%, transparent);
}

.step[data-step="waiting"] .step-badge {
  background: transparent;
  color: var(--text-secondary);
  box-shadow: inset 0 0 0 1.6px color-mix(in srgb, var(--text-primary) 28%, var(--bg-surface));
}

.step-badge-check {
  display: none;
}

.step[data-step="done"] .step-badge-check {
  display: inline-flex;
}

.step[data-step="done"] .step-badge-number {
  display: none;
}

.step-status {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.step[data-step="active"] .step-status {
  color: var(--plate-sky-fg);
}

.step[data-step="done"] .step-status {
  color: var(--plate-green-fg);
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.step[data-step="waiting"] > :not(.step-head) {
  opacity: .55;
}

.step[data-step="waiting"] .step-title h2 {
  color: var(--text-secondary);
}

.signin-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-done-line {
  display: none;
  color: var(--plate-green-fg);
  font-size: 15px;
  font-weight: 650;
}

#step-signin[data-step="done"] .signin-actions {
  display: none;
}

#step-signin[data-step="done"] .step-done-line {
  display: block;
}

.step-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tg-actions,
.tg-wait,
.tg-done {
  display: none;
}

#step-telegram[data-state="unlinked"] .tg-actions,
#step-telegram[data-state="waiting"] .tg-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#step-telegram[data-state="waiting"] .tg-wait {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--plate-sky-bg) 70%, transparent);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 550;
}

#step-telegram[data-state="linked"] .tg-done {
  display: block;
  color: var(--plate-green-fg);
  font-size: 15px;
  font-weight: 650;
}

.wait-spinner {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--plate-sky-fg);
  border-top-color: transparent;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 14px;
  font-weight: 650;
}

.nick-help {
  margin: 0;
  overflow-wrap: anywhere;
}

.denied-note {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--plate-rose-bg);
  color: var(--plate-rose-fg);
}

.denied-note h2 {
  margin: 0;
  font-size: 16px;
}

.denied-note .micro {
  color: inherit;
  overflow-wrap: anywhere;
}

.nick-field {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 16px;
  border: 2px solid transparent;
  border-radius: 18px;
  background: var(--bg-primary);
}

.nick-field:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 6px var(--sky-halo);
}

.invite-by {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-secondary);
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.nick-input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 0 0 2px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: 550 16px/1.2 var(--font-body);
}

.nick-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.field-error {
  font-size: 14px;
  font-weight: 550;
  color: var(--accent-danger);
}

.preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-link {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bg-primary);
  font: 500 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.pay-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.opt {
  position: relative;
  display: block;
  cursor: pointer;
}

.opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.opt-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid transparent;
  border-radius: 18px;
  background: var(--bg-surface);
  box-shadow: var(--row-shadow);
}

.opt input:checked + .opt-card {
  border-color: var(--accent-primary);
}

.opt input:focus-visible + .opt-card {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

.opt-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.opt-title {
  font-size: 16px;
  font-weight: 650;
}

.opt-sub {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.opt-radio {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-text);
}

.opt-radio svg {
  opacity: 0;
}

.opt input:checked + .opt-card .opt-radio {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.opt input:checked + .opt-card .opt-radio svg {
  opacity: 1;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
  display: block;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-card {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--bg-surface);
  box-shadow: var(--row-shadow);
  font-size: 15px;
  font-weight: 600;
}

.chip input:checked + .chip-card {
  border-color: var(--accent-primary);
}

.chip input:focus-visible + .chip-card {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

.social-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.social-name {
  font-size: 14px;
  font-weight: 650;
}

.social-input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 0 0 2px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: 550 16px/1.2 var(--font-body);
}

.social-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.send-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.send-hint {
  text-align: center;
}

.form-error {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--plate-rose-bg);
  color: var(--plate-rose-fg);
  font-size: 14px;
  font-weight: 600;
}

.conflict {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.conflict-mail {
  color: inherit;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.tg-notice {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skeleton {
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(31, 26, 20, .06), rgba(31, 26, 20, .12), rgba(31, 26, 20, .06));
  background-size: 200% 100%;
}

:root[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .1), rgba(255, 255, 255, .05));
  background-size: 200% 100%;
}

.skeleton-title {
  height: 32px;
  width: 60%;
}

.skeleton-line {
  height: 16px;
  width: 100%;
}

.skeleton-line.short {
  width: 70%;
}

.skeleton-block {
  height: 56px;
  border-radius: 18px;
}

.cabinet-root:empty {
  display: none;
}

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

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@keyframes sweep {
  0%, 70% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .card,
  .hero {
    animation: rise-in .45s cubic-bezier(.22, .9, .32, 1) both;
  }

  .btn-spinner,
  .wait-spinner {
    animation: spin 1s linear infinite;
  }

  .skeleton {
    animation: shimmer 1.6s linear infinite;
  }

  .btn-primary:not(.is-disabled):not(.is-pending)::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent, var(--sweep-sheen), transparent);
    animation: sweep 3.4s ease-in-out infinite;
    pointer-events: none;
  }
}

@media (max-width: 359px) {
  h1 {
    font-size: 28px;
  }
}

@media (min-width: 1024px) {
  .topbar {
    padding: 24px 16px 8px;
  }

  .stage {
    padding-top: 24px;
  }

  h1 {
    font-size: 38px;
  }

  .apply-grid {
    grid-template-columns: minmax(0, 1fr) 480px;
    gap: 56px;
    align-items: start;
  }

  .hero {
    position: sticky;
    top: 32px;
    padding: 24px 0 0;
    gap: 16px;
  }

  .hero .lead {
    font-size: 18px;
  }

  .card-center {
    margin-top: 48px;
  }
}
