/* Telegram Mini App — совместимые стили без color-mix и внешних шрифтов */

:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #000000);
  --hint: var(--tg-theme-hint-color, #999999);
  --link: var(--tg-theme-link-color, #2481cc);
  --btn: var(--tg-theme-button-color, #2481cc);
  --btn-text: var(--tg-theme-button-text-color, #ffffff);
  --sec: var(--tg-theme-secondary-bg-color, #efeff4);
  --danger: var(--tg-theme-destructive-text-color, #ff3b30);
  --radius: 12px;
  --gap: 10px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 72px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* ——— Текст ——— */
h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.25;
}

h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
}

.subtitle {
  color: var(--hint);
  font-size: 15px;
  margin-bottom: 18px;
  line-height: 1.45;
}

.step-indicator {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--btn);
  background: var(--sec);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.selection-hint {
  font-size: 14px;
  color: var(--hint);
  margin: -6px 0 14px;
}

.selection-hint strong {
  color: var(--btn);
}

/* ——— Шаги анкеты ——— */
.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--sec);
  color: var(--hint);
  border: 2px solid transparent;
}

.step-dot.active {
  background: var(--btn);
  color: var(--btn-text);
}

.step-dot.done {
  background: var(--btn);
  color: var(--btn-text);
  opacity: 0.45;
}

.step-line {
  width: 28px;
  height: 2px;
  background: var(--sec);
  margin: 0 4px;
}

/* ——— Кнопки (сброс нативного вида Telegram WebView) ——— */
button {
  font-family: inherit;
  font-size: inherit;
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

.btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--gap);
}

.btn-primary {
  background: var(--btn);
  color: var(--btn-text);
}

.btn-secondary {
  background: var(--sec);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(128, 128, 128, 0.35);
}

.btn:active,
.menu-card:active,
.option-item:active {
  opacity: 0.85;
}

.btn:disabled {
  opacity: 0.45;
}

/* ——— Пункты выбора ——— */
.option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--sec);
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  user-select: none;
}

.option-item.selected {
  border-color: var(--btn);
  background: var(--bg);
}

.option-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--hint);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
}

.option-item.selected .option-check {
  background: var(--btn);
  border-color: var(--btn);
  color: var(--btn-text);
}

/* ——— Главная: шапка ——— */
.hero {
  background: var(--btn);
  color: var(--btn-text);
  border-radius: 16px;
  padding: 20px 18px;
  margin-bottom: 16px;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  margin-bottom: 4px;
}

.hero-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  color: inherit;
}

.hero-subtitle {
  font-size: 14px;
  opacity: 0.92;
  line-height: 1.4;
  margin-bottom: 14px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 8px 12px;
}

.stat-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-label {
  display: block;
  font-size: 12px;
  opacity: 0.9;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-premium {
  background: rgba(255, 255, 255, 0.25);
  color: var(--btn-text);
}

.badge-free {
  background: var(--sec);
  color: var(--hint);
}

/* ——— Меню ——— */
.menu-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: var(--sec);
  border-radius: var(--radius);
  text-align: left;
}

.menu-card--primary {
  background: var(--btn);
  color: var(--btn-text);
}

.menu-card--primary .menu-card-desc {
  color: rgba(255, 255, 255, 0.85);
}

.menu-card--premium {
  border: 1px solid rgba(255, 180, 0, 0.45);
}

.menu-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.06);
}

.menu-card--primary .menu-icon-wrap {
  background: rgba(255, 255, 255, 0.2);
}

.menu-card-body {
  flex: 1;
  min-width: 0;
}

.menu-card-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.menu-card-desc {
  display: block;
  font-size: 13px;
  color: var(--hint);
  line-height: 1.35;
}

.menu-chevron {
  font-size: 22px;
  color: var(--hint);
  flex-shrink: 0;
  line-height: 1;
}

.menu-card--primary .menu-chevron {
  color: rgba(255, 255, 255, 0.7);
}

/* ——— Карточки ——— */
.card {
  background: var(--sec);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.card--vacancy {
  border-left: 4px solid var(--btn);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.card-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.card-row-icon {
  flex-shrink: 0;
}

.card-salary {
  font-size: 17px;
  font-weight: 700;
  margin: 12px 0 8px;
  color: var(--btn);
}

.card-link {
  color: var(--link);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.divider {
  height: 1px;
  background: rgba(128, 128, 128, 0.2);
  margin: 14px 0;
}

/* ——— Профиль ——— */
.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--sec);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 10px;
}

.profile-section {
  margin-bottom: 14px;
}

.profile-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hint);
  margin-bottom: 6px;
}

.profile-value {
  font-size: 15px;
  line-height: 1.45;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}

.chip {
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid rgba(128, 128, 128, 0.2);
}

.chip--muted {
  color: var(--hint);
}

.progress-bar {
  height: 6px;
  background: rgba(128, 128, 128, 0.2);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--btn);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ——— Premium ——— */
.premium-hero {
  margin-bottom: 8px;
}

.premium-price {
  font-size: 32px;
  font-weight: 700;
  color: var(--btn);
  margin: 8px 0 4px;
}

.premium-duration {
  font-size: 14px;
  color: var(--hint);
  margin-bottom: 8px;
}

.premium-features {
  list-style: none;
}

.premium-features li {
  padding: 10px 0;
  font-size: 15px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}

.premium-features li:last-child {
  border-bottom: none;
}

.card--premium-active {
  text-align: center;
}

.premium-crown {
  font-size: 40px;
  margin-bottom: 8px;
}

/* ——— Прочее ——— */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--link);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 14px;
  padding: 0;
}

.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 15px;
  line-height: 1.4;
}

.alert-error {
  background: rgba(255, 59, 48, 0.12);
  color: var(--danger);
}

.alert-info {
  background: var(--sec);
}

.loader-box {
  text-align: center;
  padding: 48px 16px;
}

.loader-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--sec);
  border-top-color: var(--btn);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 14px;
}

.loader-text {
  color: var(--hint);
  font-size: 15px;
}

.search-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 42vh;
  text-align: center;
  padding: 32px 16px;
}

.search-title {
  font-size: 18px;
  font-weight: 600;
  margin: 16px 0 8px;
}

.search-bar {
  font-family: ui-monospace, monospace;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--btn);
  margin: 8px 0 12px;
}

.search-step {
  color: var(--hint);
  font-size: 15px;
}

.search-countdown {
  margin-top: 14px;
  font-size: 14px;
  color: var(--hint);
}

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

.empty-hint,
.empty-state {
  text-align: center;
  color: var(--hint);
  font-size: 15px;
  padding: 24px 8px;
  line-height: 1.5;
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.bullet-list {
  list-style: none;
}

.bullet-list li {
  font-size: 14px;
  padding: 3px 0;
}
