/* Onboarding: brand stage (desktop) + step column. */

.ob {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100dvh;
}

@media (min-width: 960px) {
  .ob { grid-template-columns: minmax(380px, 5fr) 6fr; }
}

/* ---------- Stage ---------- */
.ob-stage {
  display: none;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: hidden;
  padding: var(--s-6);
  background: var(--brand);
  color: #FFFFFF;
}
[data-theme="dark"] .ob-stage { background: var(--brand-deep); }

@media (min-width: 960px) {
  .ob-stage {
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    gap: var(--s-6);
  }
}

.ob-stage::after {
  content: "";
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  right: -25%;
  bottom: -20%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(112, 238, 245, 0.28), transparent 65%);
  pointer-events: none;
}
.ob-stage > * { position: relative; }

/* On the brand stage the accent would sink into the purple, so the mark takes the second brand colour */
.ob-stage .logo {
  --logo-mark: var(--cyan);
  /* Head mark on purple: the critter's on-brand body (.mc-on-brand), else it sinks. */
  --lm-body: var(--brand-300);
  --lm-shade: var(--brand-bright);
  --lm-tearfringe: #FFFFFF;
  color: #FFFFFF;
  font-size: var(--fs-24);
}

/* Зверёк — главное лицо стейджа. Мягкий свет за ним и тень на полу, которая
   сжимается, когда он подпрыгивает. */
.ob-hero {
  align-self: center;
  justify-self: center;
  position: relative;
  width: min(40vh, 280px);
  aspect-ratio: 1;
}
.ob-hero::before {
  content: "";
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, rgba(255, 255, 255, 0.16), transparent 62%);
  pointer-events: none;
}
.ob-hero__pet { position: absolute; inset: 0; cursor: pointer; }
.ob-hero__pet .mascot { width: 100%; height: 100%; }
.ob-hero__shadow {
  position: absolute;
  left: 26%;
  right: 26%;
  bottom: 2%;
  height: 5%;
  border-radius: 50%;
  background: rgba(20, 6, 40, 0.35);
  filter: blur(3px);
}

.ob-stage__caption {
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.ob-steps {
  display: flex;
  gap: var(--s-5);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-14);
  font-weight: 600;
}
.ob-steps__item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: rgba(255, 255, 255, 0.72);
  transition: color var(--dur-state) var(--ease-out);
}
.ob-steps__num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: background-color var(--dur-state) var(--ease-out), color var(--dur-state) var(--ease-out), border-color var(--dur-state) var(--ease-out);
}
.ob-steps__num svg { width: 14px; height: 14px; }
.ob-steps__item.is-current { color: #FFFFFF; }
.ob-steps__item.is-current .ob-steps__num { background: #FFFFFF; color: var(--brand-deep); border-color: #FFFFFF; }
.ob-steps__item.is-done { color: #FFFFFF; }
.ob-steps__item.is-done .ob-steps__num { background: var(--cyan); color: #141A27; border-color: var(--cyan); }

/* ---------- Main column ---------- */
.ob-main {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.ob-bar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--s-4);
  padding: calc(var(--s-4) + env(safe-area-inset-top, 0px)) var(--gutter) var(--s-4);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.ob-bar__logo { font-size: var(--fs-18); }
.ob-bar__progress {
  grid-column: 1 / -1;
  grid-row: 2;
  height: 3px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  overflow: hidden;
}
.ob-bar__fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0.3333);
  transform-origin: left center;
}
.ob-bar__count {
  display: inline-flex;
  gap: 0.4em;
  font-size: var(--fs-14);
  color: var(--text-2);
  overflow: hidden;
}
.ob-bar__num { display: inline-block; color: var(--text); }

@media (min-width: 960px) {
  .ob-bar {
    grid-template-columns: 1fr auto;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    padding-top: var(--s-6);
    padding-inline: var(--s-7);
  }
  .ob-bar__logo { visibility: hidden; }
  .ob-bar__progress { display: none; }
  .ob-bar__count { grid-column: 1; grid-row: 1; justify-self: start; }
  .ob-bar__logo { display: none; }
}

.ob-viewport {
  display: grid;
  /* minmax(0, 1fr), not the implicit auto column: that one grew to the widest content of a step, and on a phone
     the last step (one-line name, plan badges) pushed the whole page sideways (Vlad, 10.10). */
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: var(--s-5) var(--gutter) calc(var(--s-7) + env(safe-area-inset-bottom, 0px));
  overflow-x: clip;
}
@media (min-width: 960px) {
  .ob-viewport { padding: var(--s-5) var(--s-7) var(--s-8); }
}

.ob-step {
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
}
.ob-step:focus { outline: none; }

.ob-step__head { margin-bottom: var(--s-6); }
.ob-step__title {
  font-size: clamp(2rem, 7vw, 2.75rem);
  margin-bottom: var(--s-3);
}
.ob-step__lead {
  color: var(--text-2);
  font-size: var(--fs-18);
  max-width: 40ch;
}

.ob-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
.ob-row { display: grid; gap: var(--s-4); }
@media (min-width: 520px) {
  .ob-row--2 { grid-template-columns: 1fr 1fr; }
}

.ob-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-3);
}
.ob-actions .btn--primary { flex: 1; }
.ob-actions .btn--ghost { flex: none; padding-inline: var(--s-4); }
/* Phone: the main button takes the row, the back arrow next to it is a square (Vlad 26.10: the row pushed the
   whole form past the screen). */
@media (max-width: 599px) {
  .ob-actions .btn--primary { flex: 1 1 0; min-width: 0; justify-content: center; }
  .ob-actions [data-back] { width: 56px; padding: 0; justify-content: center; }
}

/* ---------- Профиль, приехавший из ЛК (не редактируется) ---------- */
.ob-lxp {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.ob-lxp__avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 800;
}
.ob-lxp__body { min-width: 0; display: grid; gap: 2px; }
.ob-lxp__name { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }
.ob-lxp__meta { font-size: var(--fs-14); color: var(--text-2); }
.ob-lxp__mail { font-size: var(--fs-12); color: var(--text-3); }

/* ---------- Согласие ---------- */
.ob-note {
  display: flex;
  gap: var(--s-2);
  align-items: flex-start;
  margin-top: var(--s-4);
  color: var(--text-3);
  font-size: var(--fs-14);
}
.ob-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
/* Вход в презентацию до логина — тихая ссылка под заметкой о пароле. */
.ob-promo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: 600 var(--fs-14)/1.4 var(--font-ui);
  cursor: pointer;
}
.ob-promo svg { width: 14px; height: 14px; }
.ob-promo:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- OS picker ---------- */
.os-picker {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: var(--s-3);
}
.os-picker legend {
  padding: 0;
  margin-bottom: var(--s-3);
  font-size: var(--fs-14);
  font-weight: 600;
}
.os-picker__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
.os-option {
  position: relative;
  display: grid;
  justify-items: start;
  gap: var(--s-4);
  padding: var(--s-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-state) var(--ease-out);
}
[data-theme="dark"] .os-option { background: var(--surface-2); border-color: var(--border); }
.os-option:hover { border-color: var(--text-3); }
.os-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.os-option__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text);
  transition: background-color var(--dur-state) var(--ease-out), color var(--dur-state) var(--ease-out);
}
[data-theme="dark"] .os-option__icon { background: var(--bg); }
.os-option__icon svg { width: 22px; height: 22px; }
.os-option__name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-18); line-height: 1.2; }
.os-option__meta { display: block; margin-top: 2px; font-family: var(--font-ui); font-size: var(--fs-12); font-weight: 500; color: var(--text-3); }

.os-option.is-selected { background: var(--accent-soft); border-color: transparent; }
.os-option.is-selected .os-option__icon { background: var(--accent); color: #FFFFFF; }
.os-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }

.os-frame {
  position: absolute;
  inset: -1px;
  border: 2px solid var(--accent);
  border-radius: inherit;
  box-shadow: var(--glow-accent);
  pointer-events: none;
}

/* ---------- Result step ---------- */
.ob-profile {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
[data-theme="dark"] .ob-profile { background: var(--surface); }
.ob-profile__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 800;
}
.ob-profile__body { min-width: 0; flex: 1; }
.ob-profile__name { font-weight: 600; overflow-wrap: anywhere; }
.ob-profile__meta { font-size: var(--fs-14); color: var(--text-2); }
.ob-profile__edit {
  border: 0;
  background: transparent;
  padding: var(--s-2);
  color: var(--accent-text);
  font-size: var(--fs-14);
  font-weight: 600;
  border-radius: var(--r-sm);
}
.ob-profile__edit:hover { text-decoration: underline; text-underline-offset: 3px; }

.features {
  display: grid;
  margin: 0 0 var(--s-5);
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}
.features__item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--border);
}
.features__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--success-soft);
  color: var(--success);
}
.features__icon svg { width: 16px; height: 16px; }
.features__title { font-weight: 600; line-height: 1.3; }
.features__desc { display: block; font-size: var(--fs-14); font-weight: 400; color: var(--text-2); }
.features__item.is-limited .features__icon { background: var(--surface-2); color: var(--text-2); }

.ob-callout {
  display: flex;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-14);
}
.ob-callout svg { width: 18px; height: 18px; flex: none; color: var(--text); margin-top: 1px; }
.ob-callout strong { color: var(--text); }

/* ---------- Page wipe ---------- */
.wipe {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: grid;
  place-items: center;
  visibility: hidden;
  background: var(--brand);
  color: #FFFFFF;
}
[data-theme="dark"] .wipe { background: var(--brand-deep); }
