/* Общая оболочка мини-аппа (канон — как instructions.html). */

:root {
  --bg: #0b0b0f;
  --surface: #13131a;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f2f2f6;
  --muted: rgba(242, 242, 246, 0.55);
  --accent: #8b7cff;
  --accent-soft: rgba(139, 124, 255, 0.14);
  --ok: #5ee9a8;
  --err: #ff7a7a;
  --radius: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  padding: 20px 18px 28px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(100% 70% at 50% -15%, rgba(139, 124, 255, 0.12), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0 auto;
}

.app-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.app-head-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: rgba(139, 124, 255, 0.1);
  border: none;
}

.app-head-text {
  min-width: 0;
  flex: 1;
}

.app-head-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--text);
}

.greet {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.45;
}

.greet a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(139, 124, 255, 0.35);
}

.seg-wrap {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.seg {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 11px 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.seg.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.seg:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.card-accent {
  border-color: rgba(139, 124, 255, 0.22);
  box-shadow: 0 0 0 1px rgba(139, 124, 255, 0.06) inset;
}

.card-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-lead {
  margin: 0 0 12px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}

.steps {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}

.steps li {
  margin: 0 0 8px;
}

.steps li:last-child {
  margin-bottom: 0;
}

.steps strong {
  color: var(--text);
  font-weight: 600;
}

.tips-box {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.tips-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.tips-box .tips-list {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}

.tips-box .tips-list li {
  margin: 0 0 5px;
}

.tips-box .tips-list li:last-child {
  margin-bottom: 0;
}

.btn-primary {
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--radius);
  padding: 15px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #9b8fff, var(--accent) 45%, #6b5bdc);
  box-shadow: 0 10px 32px rgba(107, 91, 220, 0.28);
}

.btn-primary:active {
  transform: scale(0.99);
}

.hint-under {
  margin: 12px 0 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.back-btn {
  display: block;
  width: 100%;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.back-btn:hover {
  border-color: rgba(139, 124, 255, 0.45);
  color: var(--accent);
}

.note {
  margin-top: 12px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.faq-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(139, 124, 255, 0.35);
}

/* Кнопки мастера / форм (совместимо с class="btn btn-primary"). */
.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--radius);
  padding: 15px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
  transition: transform 0.1s, opacity 0.15s;
}

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

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

.btn-primary:disabled {
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 600;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 600;
}

.btn-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: none;
  border: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  opacity: 0.9;
}

.btn-link:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.link-inline {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.err {
  color: var(--err);
  font-size: 0.84rem;
  margin: 0 0 14px;
  display: none;
  line-height: 1.4;
}

.err.show {
  display: block;
}

.loader {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}
