:root {
  --bg: #060711;
  --bg2: #0a0d1c;
  --card: rgba(13, 17, 34, .78);
  --card2: rgba(18, 23, 44, .92);
  --stroke: rgba(255, 255, 255, .11);
  --stroke2: rgba(255, 255, 255, .18);
  --text: #f7f9ff;
  --muted: #aeb9d6;
  --muted2: #727f9e;
  --purple: #8b5cf6;
  --purple2: #5b38ff;
  --cyan: #00d4ff;
  --green: #34f5a6;
  --red: #ff4d6d;
  --gold: #ffd166;
  --shadow: 0 24px 80px rgba(0, 0, 0, .45);
  --radius: 28px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 2px solid rgba(0, 212, 255, .7); outline-offset: 3px; }

.bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 999px; filter: blur(32px); opacity: .68; }
.orb-a { width: 340px; height: 340px; left: -155px; top: -95px; background: rgba(139, 92, 246, .58); }
.orb-b { width: 320px; height: 320px; right: -150px; top: 130px; background: rgba(0, 212, 255, .32); }
.orb-c { width: 260px; height: 260px; left: 35%; bottom: -170px; background: rgba(91, 56, 255, .42); }
.grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 15%, black 0 18%, transparent 65%);
}

.shell {
  position: relative;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px max(22px, env(safe-area-inset-bottom));
}

.card {
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035)), var(--card);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.logo {
  position: relative;
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  border: 1px solid rgba(255,255,255,.18);
  background:
    radial-gradient(circle at 30% 16%, rgba(255,255,255,.33), transparent 28%),
    linear-gradient(135deg, rgba(139,92,246,.95), rgba(0,212,255,.38));
  box-shadow: 0 18px 45px rgba(139,92,246,.30);
}
.logo svg { width: 33px; height: 33px; fill: #fff; filter: drop-shadow(0 8px 12px rgba(0,0,0,.38)); }
.brand span { display: block; color: var(--cyan); font-size: 11px; line-height: 1; font-weight: 950; letter-spacing: .22em; }
.brand b { display: block; margin-top: 5px; font-size: 15px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ghost-btn {
  flex: none;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--stroke);
  border-radius: 15px;
  color: #dfe8ff;
  background: rgba(255,255,255,.06);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 310px;
  padding: 24px;
  border-radius: 34px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -1px;
  background:
    radial-gradient(circle at 75% 18%, rgba(0,212,255,.18), transparent 34%),
    radial-gradient(circle at 17% 26%, rgba(139,92,246,.28), transparent 40%);
  pointer-events: none;
}
.hero-copy, .hero-panel, .status { position: relative; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
  padding: 8px 11px;
  border: 1px solid rgba(0,212,255,.22);
  border-radius: 999px;
  color: #d7f8ff;
  background: rgba(0,212,255,.075);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 18px var(--green); }
h1, h2, p { margin: 0; }
h1 { max-width: 360px; font-size: clamp(34px, 9vw, 52px); line-height: .92; letter-spacing: -.065em; }
h1 em { color: var(--cyan); font-style: normal; text-shadow: 0 0 28px rgba(0,212,255,.25); }
h2 { font-size: clamp(25px, 6vw, 32px); line-height: 1; letter-spacing: -.045em; }
p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.hero p { max-width: 390px; margin-top: 15px; }

.hero-panel { height: 145px; margin-top: 22px; }
.panel-glow { position: absolute; right: 30px; bottom: 0; width: 145px; height: 70px; border-radius: 50%; background: rgba(0,212,255,.18); filter: blur(22px); }
.mini-device {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(280px, 80%);
  padding: 14px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(20,26,52,.94), rgba(7,10,24,.92));
  box-shadow: 0 30px 85px rgba(0,0,0,.46), inset 0 1px 0 rgba(255,255,255,.08);
  transform: perspective(700px) rotateX(5deg) rotateY(-9deg) rotateZ(1deg);
}
.device-head { display: flex; gap: 6px; margin-bottom: 14px; }
.device-head span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.18); }
.device-head span:nth-child(1) { background: var(--red); }
.device-head span:nth-child(2) { background: var(--gold); }
.device-head span:nth-child(3) { background: var(--green); }
.device-line { width: 60%; height: 10px; margin: 10px 0; border-radius: 99px; background: rgba(255,255,255,.10); }
.device-line.wide { width: 86%; }
.device-code { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 15px; }
.device-code b { height: 34px; border-radius: 12px; background: rgba(0,212,255,.12); border: 1px solid rgba(0,212,255,.20); }
.device-action { margin-top: 12px; padding: 10px; border-radius: 14px; color: #08120e; background: linear-gradient(135deg, var(--green), rgba(0,212,255,.75)); text-align: center; font-size: 11px; font-weight: 950; letter-spacing: .1em; }

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  margin-top: 18px;
  padding: 12px 13px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.11);
  background: rgba(5,8,20,.62);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.status i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 1.7s infinite; }
.status.ok { color: #d9fff0; border-color: rgba(52,245,166,.28); background: rgba(52,245,166,.075); }
.status.err { color: #ffd7df; border-color: rgba(255,77,109,.35); background: rgba(255,77,109,.09); }
.status.demo { color: #fff1c7; border-color: rgba(255,209,102,.30); background: rgba(255,209,102,.08); }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }

.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
  padding: 14px 12px;
  border-radius: 24px;
  overflow: hidden;
}
.bar { position: absolute; left: 32px; right: 32px; top: 31px; height: 2px; background: rgba(255,255,255,.11); }
.bar span { display: block; width: 0%; height: 100%; background: linear-gradient(90deg, var(--purple), var(--cyan)); box-shadow: 0 0 18px rgba(0,212,255,.45); transition: width .32s ease; }
.step { position: relative; display: grid; justify-items: center; gap: 7px; color: var(--muted2); font-size: 11px; font-weight: 850; z-index: 1; }
.step b { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: #12182d; border: 1px solid rgba(255,255,255,.12); font-size: 11px; transition: .2s ease; }
.step.active, .step.done { color: #fff; }
.step.active b, .step.done b { color: #fff; border-color: rgba(139,92,246,.55); background: linear-gradient(135deg, var(--purple), rgba(0,212,255,.48)); box-shadow: 0 0 26px rgba(139,92,246,.34); }
.step.done b { color: #07120f; background: linear-gradient(135deg, var(--green), rgba(0,212,255,.62)); }

.form-card, .success, .security { margin-top: 12px; padding: 22px; border-radius: var(--radius); }
.section-head { margin-bottom: 17px; }
.section-head p { margin-top: 9px; }
.badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  margin-bottom: 12px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(139,92,246,.30);
  color: #e9ddff;
  background: rgba(139,92,246,.14);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.guide {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 20px;
  color: #e9efff;
  background: rgba(255,255,255,.055);
  cursor: pointer;
  text-align: left;
}
.guide b { display: block; margin-bottom: 3px; font-size: 14px; }
.guide small { display: block; color: var(--muted2); font-size: 12px; }
.guide i { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.075); font-style: normal; font-weight: 950; }
.guide-body { display: grid; gap: 8px; margin: -2px 0 15px; }
.guide-body div { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 17px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.045); }
.guide-body b { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 10px; color: #06130f; background: linear-gradient(135deg, var(--green), rgba(0,212,255,.7)); font-size: 11px; }
.guide-body span { color: #dfe7fb; font-size: 13px; line-height: 1.35; }
.guide-body strong { color: #fff; }

.fields { display: grid; gap: 13px; }
.field { position: relative; display: block; }
.field > span { display: block; margin: 0 0 8px; color: #dfe7fb; font-size: 13px; font-weight: 900; }
.field small { display: block; min-height: 16px; margin-top: 7px; color: var(--muted2); font-size: 12px; line-height: 1.35; }
input {
  width: 100%;
  min-height: 58px;
  padding: 16px 15px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 19px;
  outline: none;
  color: var(--text);
  background: rgba(3, 6, 18, .68);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 12px 28px rgba(0,0,0,.17);
  font-size: 16px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input::placeholder { color: rgba(174,185,214,.42); }
input:focus { border-color: rgba(0,212,255,.62); background: rgba(5,9,24,.88); box-shadow: 0 0 0 4px rgba(0,212,255,.10), inset 0 1px 0 rgba(255,255,255,.05); }
.field.valid input { border-color: rgba(52,245,166,.42); }
.field.valid small { color: #bffff0; }
.field.invalid input { border-color: rgba(255,77,109,.62); box-shadow: 0 0 0 4px rgba(255,77,109,.08); }
.field.invalid small { color: #ffbfca; }

.primary-btn, .flat-btn {
  width: 100%;
  min-height: 58px;
  border-radius: 20px;
  margin-top: 15px;
  padding: 0 15px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 950;
  transition: transform .14s ease, opacity .16s ease, filter .16s ease;
}
.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  color: #fff;
  background:
    radial-gradient(circle at 16% 0%, rgba(255,255,255,.38), transparent 26%),
    linear-gradient(135deg, var(--purple) 0%, var(--purple2) 45%, #047da5 100%);
  box-shadow: 0 18px 52px rgba(139,92,246,.30), inset 0 1px 0 rgba(255,255,255,.18);
}
.primary-btn b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 11px; background: rgba(255,255,255,.16); }
.flat-btn { border: 1px solid var(--stroke); color: #dce6ff; background: rgba(255,255,255,.06); }
button:active { transform: translateY(1px) scale(.996); }
button:disabled { opacity: .55; filter: grayscale(.2); cursor: not-allowed; }

.safe-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 15px;
  padding: 13px;
  border-radius: 18px;
  border: 1px solid rgba(255,209,102,.18);
  background: rgba(255,209,102,.07);
  color: #ddd4bf;
  font-size: 12px;
  line-height: 1.4;
}
.safe-note i { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,209,102,.13); color: var(--gold); font-style: normal; font-weight: 950; }

.code-preview { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.code-preview i { height: 53px; display: grid; place-items: center; border-radius: 17px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.055); color: #fff; font-style: normal; font-size: 23px; font-weight: 950; }
.code-preview i.filled { border-color: rgba(0,212,255,.44); box-shadow: 0 0 24px rgba(0,212,255,.14); }
.timer-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding: 14px; border: 1px solid rgba(255,255,255,.10); border-radius: 19px; background: rgba(255,255,255,.045); }
.timer-box span { color: var(--muted); font-size: 13px; }
.timer-box b { color: var(--cyan); font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.password-field input { padding-right: 108px; }
.password-field button { position: absolute; right: 8px; top: 31px; height: 42px; padding: 0 12px; border: 1px solid rgba(255,255,255,.10); border-radius: 14px; color: #dce6ff; background: rgba(255,255,255,.075); cursor: pointer; font-size: 12px; font-weight: 900; }

.success { text-align: center; padding: 28px 22px 22px; }
.success-icon { width: 92px; height: 92px; display: grid; place-items: center; margin: 2px auto 18px; border-radius: 32px; color: #04130f; background: radial-gradient(circle at 30% 18%, rgba(255,255,255,.55), transparent 25%), linear-gradient(135deg, var(--green), rgba(0,212,255,.65)); box-shadow: 0 0 72px rgba(52,245,166,.27); font-size: 54px; font-weight: 1000; }
.success-badge { color: #dffff1; border-color: rgba(52,245,166,.30); background: rgba(52,245,166,.13); }
.success p { max-width: 410px; margin: 10px auto 0; }
.next-list { display: grid; gap: 9px; margin-top: 19px; text-align: left; }
.next-list div { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid rgba(255,255,255,.09); border-radius: 17px; background: rgba(255,255,255,.055); }
.next-list b { flex: none; color: var(--cyan); font-size: 12px; letter-spacing: .08em; }
.next-list span { color: #dfe8ff; font-size: 13px; }
.security { padding: 16px; }
.security b { display: block; margin-bottom: 4px; color: #fff4d7; }
.security span { color: #d5ceb9; font-size: 13px; line-height: 1.42; }

.hidden { display: none !important; }

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 100;
  width: min(492px, calc(100% - 28px));
  margin: 0 auto;
  padding: 14px 15px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 19px;
  color: #f8fbff;
  background: rgba(12,16,32,.96);
  box-shadow: 0 26px 70px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-size: 14px;
  line-height: 1.38;
}
.toast.ok { border-color: rgba(52,245,166,.36); color: #dffff1; }
.toast.err { border-color: rgba(255,77,109,.42); color: #ffdce4; }

.loading, .modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 18px; }
.loading { background: rgba(4,5,14,.58); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.loading-card { width: min(330px, 100%); padding: 24px; border-radius: 28px; text-align: center; }
.spinner { width: 56px; height: 56px; margin: 0 auto 15px; border-radius: 50%; border: 3px solid rgba(255,255,255,.14); border-top-color: var(--cyan); border-right-color: var(--purple); animation: spin .82s linear infinite; }
.loading-card b { display: block; margin-bottom: 6px; }
.loading-card span { color: var(--muted); font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal { z-index: 110; }
.modal-bg { position: absolute; inset: 0; border: 0; background: rgba(4,5,14,.66); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.modal-card { position: relative; width: min(520px, 100%); padding: 23px; border-radius: 30px; }
.modal-close { position: absolute; right: 15px; top: 14px; width: 39px; height: 39px; border: 1px solid rgba(255,255,255,.12); border-radius: 15px; color: #fff; background: rgba(255,255,255,.07); cursor: pointer; font-size: 24px; line-height: 1; }
.help-items { display: grid; gap: 9px; margin-top: 16px; }
.help-items div { padding: 13px; border: 1px solid rgba(255,255,255,.09); border-radius: 17px; background: rgba(255,255,255,.052); }
.help-items b { display: block; margin-bottom: 4px; color: var(--cyan); }
.help-items span { display: block; color: #dce5fb; font-size: 13px; line-height: 1.42; }

@media (min-width: 700px) {
  .shell { width: min(100%, 780px); padding-top: 24px; }
  .hero { min-height: 270px; }
  .hero-panel { position: absolute; right: 24px; bottom: 24px; width: 330px; height: 180px; margin: 0; }
  .hero-copy { max-width: 430px; }
  .form-card, .success { padding: 28px; }
  .fields { grid-template-columns: 1fr 1fr; }
  .field:nth-child(3) { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  .shell { padding-left: 12px; padding-right: 12px; }
  .hero { padding: 20px; border-radius: 30px; }
  .mini-device { width: 88%; }
  .form-card, .success { padding: 19px; border-radius: 25px; }
  .steps { gap: 4px; padding-left: 8px; padding-right: 8px; }
  .bar { left: 26px; right: 26px; }
  .step b { width: 34px; height: 34px; }
  .step span { font-size: 10px; }
  .code-preview { gap: 6px; }
  .code-preview i { height: 48px; border-radius: 15px; }
}

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