:root {
  /* Colors — dark theme */
  --color-bg: #05070d;
  --color-text: rgba(255, 255, 255, 0.87);
  --color-text-muted: rgba(255, 255, 255, 0.6);
  --color-text-dim: rgba(255, 255, 255, 0.42);
  --color-glass: rgba(255, 255, 255, 0.12);
  --color-glass-strong: rgba(255, 255, 255, 0.18);
  --color-glass-border: rgba(255, 255, 255, 0.2);
  --color-ink: #ffffff;
  --color-paper: #ffffff;

  /* Orbs */
  --orb-blue-1: #7cc7ff;
  --orb-blue-2: #5aa9ff;
  --orb-blue-3: #a6dcff;

  /* Typography — Font Families */
  --font-davinci: 'Playfair Display', 'Georgia', ui-serif, serif;
  --font-helvetica-now: 'Inter', 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif;

  /* Typography — Scale */
  --text-body-sm: 15px;
  --text-subheading: 22px;
  --text-heading-sm: 26px;
  --text-heading: 43px;
  --text-heading-lg: 52px;

  /* Spacing */
  --spacing-16: 16px;
  --spacing-20: 20px;
  --spacing-28: 28px;
  --spacing-32: 32px;
  --spacing-36: 36px;
  --spacing-40: 40px;

  /* Radii */
  --radius-cards: 20px;
  --radius-links: 2px;
  --radius-buttons: 42px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-helvetica-now);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Floating light-blue orbs */
.orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}

.orb-1 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle at 35% 35%, var(--orb-blue-1), transparent 70%);
  top: -60px;
  left: -80px;
}

.orb-2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle at 60% 40%, var(--orb-blue-2), transparent 70%);
  bottom: -80px;
  right: -100px;
  animation-delay: -6s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle at 50% 50%, var(--orb-blue-3), transparent 70%);
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.35;
  animation-delay: -12s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-28px); }
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--spacing-20);
  padding-top: calc(var(--spacing-16) + env(safe-area-inset-top));
  padding-bottom: calc(var(--spacing-36) + env(safe-area-inset-bottom));
  max-width: 480px;
  margin: 0 auto;
}

/* Header */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--spacing-32);
}

.mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--color-text);
  display: grid;
  place-items: center;
  font-family: var(--font-davinci);
  font-weight: 500;
  font-size: 18px;
  line-height: 1;
  color: var(--color-text);
}

.ghost-link {
  color: var(--color-text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 400;
  border-radius: var(--radius-links);
  padding: 2px 4px;
}

.ghost-link:hover { text-decoration: underline; }

/* Screens */
.screen { display: none; }
.screen.is-active { display: block; animation: rise 320ms ease both; }

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

.screen-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--spacing-16);
}

/* Type */
.kicker {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.display {
  font-family: var(--font-davinci);
  font-weight: 500;
  font-size: clamp(40px, 13vw, 52px);
  line-height: 1;
  letter-spacing: -0.47px;
  color: var(--color-text);
  overflow-wrap: break-word;
  max-width: 100%;
}

.display-sm {
  font-family: var(--font-davinci);
  font-weight: 500;
  font-size: clamp(30px, 10vw, 43px);
  line-height: 1.1;
  letter-spacing: -0.215px;
  color: var(--color-text);
  overflow-wrap: break-word;
  max-width: 100%;
}

.lede {
  font-size: 15px;
  color: var(--color-text-muted);
  max-width: 30ch;
  margin-left: auto;
  margin-right: auto;
}

/* Option cards — glass */
.option-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: var(--spacing-16);
  width: 100%;
}

.option-card {
  width: 100%;
  background: var(--color-glass);
  -webkit-backdrop-filter: blur(45px);
  backdrop-filter: blur(45px);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-cards);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  position: relative;
  cursor: pointer;
  font-family: var(--font-helvetica-now);
  color: var(--color-text);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.option-card:hover {
  background: var(--color-glass-strong);
  border-color: rgba(255, 255, 255, 0.32);
}

.option-card.is-selected {
  background: var(--color-glass-strong);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.option-name {
  font-family: var(--font-davinci);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.13px;
  color: var(--color-text);
}

.option-meta {
  font-size: 12px;
  color: var(--color-text-muted);
}

.option-check {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--color-text);
  transition: background-color 160ms ease;
}

.option-card.is-selected .option-check { background: var(--color-text); }

/* iOS Liquid Glass pill button */
.pill {
  margin-top: var(--spacing-16);
  align-self: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08));
  -webkit-backdrop-filter: blur(45px);
  backdrop-filter: blur(45px);
  border: 1px solid var(--color-glass-border);
  color: var(--color-text);
  border-radius: var(--radius-buttons);
  padding: 14px 32px;
  font-family: 'Inter', 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.pill:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.12));
  transform: translateY(-1px);
}

.pill:disabled {
  opacity: 0.28;
  cursor: not-allowed;
  transform: none;
}

/* Ghost variant of the pill — outline style, used beside primary actions */
.pill-ghost {
  background: none;
  border: 1px solid var(--color-glass-border);
  box-shadow: none;
  color: var(--color-text);
}

.pill-ghost:hover {
  background: var(--color-glass);
  transform: none;
}

.pill-ghost:disabled {
  opacity: 0.28;
  cursor: not-allowed;
  background: none;
}

/* Pill styled as a link (e.g. "Подписаться") */
.pill-link {
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.pill-link:hover { transform: translateY(-1px); }

/* Step navigation row */
.step-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: var(--spacing-16);
}

.step-nav .pill {
  margin-top: 0;
  align-self: auto;
}

/* Back link */
.back-link {
  align-self: center;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-helvetica-now);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--radius-links);
  padding: 2px 4px;
}

.back-link:hover { color: var(--color-text); text-decoration: underline; }

/* Give .steps room to sit inside centered column, left-align its content */
.screen-inner > .steps { align-self: stretch; }

/* Credential card — glass */
.credential-card {
  width: 100%;
  background: var(--color-glass);
  -webkit-backdrop-filter: blur(45px);
  backdrop-filter: blur(45px);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-cards);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-16);
  margin-top: var(--spacing-16);
}

.cred-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--spacing-16);
  text-align: left;
}

.cred-label {
  font-size: 12px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.cred-value {
  font-size: 15px;
  font-weight: 500;
  word-break: break-all;
  text-align: right;
  color: var(--color-text);
}

.cred-value.is-masked {
  letter-spacing: 0.15em;
  color: var(--color-text-dim);
}

/* Footnote */
.footnote {
  font-size: 12px;
  color: var(--color-text-dim);
  margin-top: 4px;
}

/* App description */
.app-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-text-muted);
  max-width: 34ch;
  margin-left: auto;
  margin-right: auto;
}

/* Notice (e.g. "выход БЕЗ ПОТЕРИ ДАННЫХ") */
.notice {
  width: 100%;
  background: var(--color-glass);
  -webkit-backdrop-filter: blur(45px);
  backdrop-filter: blur(45px);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-cards);
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  text-align: left;
}

.notice strong {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #fff;
}

/* Loading screen */
.loading-inner {
  justify-content: center;
  min-height: 60vh;
  gap: var(--spacing-28);
}

.spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--color-text);
  animation: spin 0.9s linear infinite;
}

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

/* Model list — two columns */
.model-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.model-list .option-card { padding: 18px 12px; }

/* Check circle sits ABOVE the model name, not over it */
.model-list .option-card .option-check {
  position: static;
  order: -1;
  align-self: center;
  margin-bottom: 8px;
}

.model-list .option-name {
  font-family: 'Inter', 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.model-list .option-card.is-selected { padding: 18px 12px; }

/* Category list */
.category-list .option-name {
  font-family: 'Inter', 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.category-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: grayscale(1) brightness(1.2) contrast(1.1) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

/* App grid — two columns inside a category */
.app-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.app-list {
  width: 100%;
  margin-top: var(--spacing-16);
}

.app-card {
  width: 100%;
  background: var(--color-glass);
  -webkit-backdrop-filter: blur(45px);
  backdrop-filter: blur(45px);
  border: 1px solid var(--color-glass-border);
  border-radius: 18px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  position: relative;
  cursor: pointer;
  font-family: 'Inter', 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-text);
  transition: background 160ms ease, border-color 160ms ease;
}

.app-card:hover {
  background: var(--color-glass-strong);
  border-color: rgba(255, 255, 255, 0.32);
}

.app-card.is-selected {
  background: var(--color-glass-strong);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.app-card .app-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--color-text);
}

.app-card.is-selected .app-check { background: var(--color-text); }

/* Steps */
.steps {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-16);
  margin-top: var(--spacing-16);
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  width: 100%;
  background: var(--color-glass);
  -webkit-backdrop-filter: blur(45px);
  backdrop-filter: blur(45px);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-cards);
  padding: 20px;
}

.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--color-text-muted);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
}

.step-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text);
  max-width: 32ch;
}

.step-text strong { font-weight: 500; }

.photo-slot {
  width: 100%;
  background: var(--color-glass);
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
  border: 1px dashed var(--color-glass-border);
  border-radius: var(--radius-cards);
  display: grid;
  place-items: center;
  min-height: 120px;
  font-size: 12px;
  color: var(--color-text-dim);
  overflow: hidden;
}

.photo-slot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-cards);
}

.photo-slot.has-photo {
  position: relative;
  border: 1px solid var(--color-glass-border);
  color: transparent;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* iOS-style edge glow on photo cards */
.photo-slot.has-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-cards);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02) 40%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
