:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #1a1a1a);
  --hint: var(--tg-theme-hint-color, #8a8a8e);
  --link: var(--tg-theme-link-color, #2f7ee6);
  --btn: var(--tg-theme-button-color, #2f7ee6);
  --btn-text: var(--tg-theme-button-text-color, #ffffff);
  --card: var(--tg-theme-secondary-bg-color, #f2f3f5);
  --accent: #3a8dde;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

#app { max-width: 560px; margin: 0 auto; padding: 16px; min-height: 100vh; }

.screen { display: none; animation: fade .25s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero { text-align: center; padding: 32px 8px 24px; }
.hero-emoji { font-size: 64px; line-height: 1; }
.hero h1 { font-size: 24px; margin: 16px 0 12px; }
.hero-sub { color: var(--hint); font-size: 15px; margin: 12px 0 0; }

.discount-badge {
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 12px 24px; margin: 8px 0;
  background: linear-gradient(135deg, #2f7ee6, #56a2f0);
  color: #fff; border-radius: 16px;
  box-shadow: 0 8px 24px rgba(47,126,230,.35);
}
.discount-label { font-size: 12px; opacity: .9; text-transform: uppercase; letter-spacing: .5px; }
.discount-value { font-size: 30px; font-weight: 700; }

.btn {
  width: 100%; border: none; border-radius: 14px; padding: 15px;
  font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 16px;
}
.btn-primary { background: var(--btn); color: var(--btn-text); }
.btn-primary:active { opacity: .85; }

.tabs { display: flex; gap: 6px; background: var(--card); padding: 4px; border-radius: 12px; }
.tab {
  flex: 1; border: none; background: transparent; color: var(--hint);
  padding: 9px 4px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.tab.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.tab-content { display: none; padding: 20px 4px 8px; }
.tab-content.active { display: block; }
.card-emoji { font-size: 44px; text-align: center; }
.tab-content h2 { text-align: center; margin: 8px 0 16px; }
.tab-content ul { padding-left: 20px; color: var(--text); }
.tab-content li { margin: 6px 0; }
.stat { color: var(--accent); font-weight: 600; }

blockquote {
  margin: 12px 0; padding: 14px 16px; background: var(--card);
  border-radius: 12px; font-style: italic;
}
blockquote cite { display: block; margin-top: 8px; font-style: normal; color: var(--hint); font-size: 13px; }

.form-title { text-align: center; margin: 8px 0 12px; }
.discount-inline {
  text-align: center; background: var(--card); padding: 10px;
  border-radius: 12px; margin-bottom: 16px; font-size: 14px;
}

.method-switch { display: flex; gap: 8px; margin-bottom: 16px; }
.method {
  flex: 1; border: 2px solid var(--card); background: var(--bg); color: var(--text);
  padding: 12px 6px; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.method.active { border-color: var(--btn); color: var(--btn); }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--hint); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; border: 1.5px solid var(--card); border-radius: 12px;
  padding: 13px; font-size: 16px; background: var(--bg); color: var(--text);
  font-family: inherit; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--btn); }

.error { color: #e0483d; font-size: 14px; text-align: center; min-height: 20px; margin: 4px 0 0; }

/* --- Мини-квиз --- */
.quiz-top { display: flex; align-items: center; gap: 12px; padding: 8px 0 4px; }
.quiz-back {
  border: none; background: var(--card); color: var(--text);
  width: 36px; height: 36px; border-radius: 50%; font-size: 18px;
  cursor: pointer; flex: 0 0 auto; line-height: 1;
}
.quiz-progress {
  flex: 1; height: 8px; background: var(--card); border-radius: 8px; overflow: hidden;
}
.quiz-progress-bar {
  height: 100%; width: 0; border-radius: 8px;
  background: linear-gradient(90deg, #2f7ee6, #56a2f0);
  transition: width .35s ease;
}
.quiz-step { flex: 0 0 auto; font-size: 13px; color: var(--hint); font-weight: 600; }

.quiz-question {
  text-align: center; font-size: 22px; margin: 32px 8px 24px; line-height: 1.3;
}
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  width: 100%; text-align: left; border: 2px solid var(--card); background: var(--bg);
  color: var(--text); padding: 16px 18px; border-radius: 14px;
  font-size: 16px; font-weight: 500; cursor: pointer;
  transition: transform .1s ease, border-color .15s ease, background .15s ease;
}
.quiz-option:active { transform: scale(.98); }
.quiz-option.selected {
  border-color: var(--btn); background: rgba(47,126,230,.08); font-weight: 600;
}
