/* ============================================================
   Фаст Сервис — сборщик отзывов
   Мобильный-first: ссылка обычно открывается со смартфона
   ============================================================ */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --success: #16a34a;
  --warning: #d97706;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg-top: #4f46e5;
  --bg-bottom: #7c3aed;
  --card-shadow: 0 20px 45px -18px rgba(30, 41, 59, .35);
  --radius: 20px;

  /* Фирменные цвета площадок */
  --yandex: #fc3f1d;
  --google: #4285f4;
  --gis2: #19aa1e;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background-color: var(--bg-top);
  background-image: linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Варианты тематического фона — переключаются в js/config.js (CONFIG.background) */

body.bg-circuit {
  background-image:
    url("../assets/bg-circuit.svg"),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

body.bg-blueprint {
  background-image:
    url("../assets/bg-blueprint.svg"),
    linear-gradient(160deg, #1e3a8a, #1d4ed8);
}

body.bg-repair {
  background-image:
    url("../assets/bg-repair.svg"),
    linear-gradient(165deg, #161032 0%, #2a1b54 50%, #3c1a66 100%);
}

/* Картинка сдвинута вниз на 200px, градиент заполняет всё пространство */
body.bg-circuit,
body.bg-blueprint,
body.bg-repair {
  background-position: center 200px, center top;
}

/* На мобильных fixed-фон работает нестабильно — прокручиваем вместе со страницей */
@media (max-width: 768px) {
  body { background-attachment: scroll; }
}

.hidden { display: none !important; }

.page {
  max-width: 480px;
  margin: 0 auto;
  /* svh — реальная видимая высота окна (без учёта скрытых панелей браузера);
     80px снизу держат футер поднятым, safe-area — отступ над панелью телефона */
  min-height: 100vh;
  min-height: 100svh;
  padding: 14px 16px calc(25px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
}

/* ---------- Карточки-шаги ---------- */

.main {
  flex: 1;
  padding-top: 30px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 24px 20px;
  animation: rise .35s ease both;
}

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

.card-title {
  font-size: 23px;
  line-height: 1.25;
  text-align: center;
  font-weight: 800;
}

.card-subtitle {
  margin-top: 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
}

.badge {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  margin: 2px auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-success { background: #dcfce7; color: var(--success); }
.badge-warning { background: #fef3c7; color: var(--warning); }

/* ---------- Звёзды ---------- */

.stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.star {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px 6px;
  transition: transform .15s ease;
  touch-action: manipulation;
}

.star svg {
  width: 44px;
  height: 44px;
  fill: var(--border);
  transition: fill .15s ease;
}

.star-num {
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1;
  transition: color .15s ease;
}

@media (hover: hover) {
  .star:hover svg { fill: #fbbf24; }
  .star:hover .star-num { color: #b45309; }
  .star:hover { transform: scale(1.08); }
}

.star.active svg { fill: #fbbf24; }
.star.active .star-num { color: #b45309; }

.rating-labels {
  display: flex;
  justify-content: space-between;
  max-width: 300px;
  margin: 8px auto 0;
  color: var(--text-muted);
  font-size: 13px;
}

.hint {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
}

/* ---------- Кнопки площадок ---------- */

.platforms {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.platform-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

@media (hover: hover) {
  .platform-btn:hover {
    border-color: currentColor;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -12px rgba(30, 41, 59, .35);
  }
}

.platform-btn:active { transform: scale(.98); }

.platform-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
}

.platform-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

.icon-yandex { background: var(--yandex); }
.icon-2gis { background: none; }
.icon-2gis svg { width: 44px; height: 44px; }
.icon-google svg { width: 44px; height: 44px; }

.platform-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.platform-info strong { font-size: 16px; }
.platform-info small { color: var(--text-muted); font-size: 13px; }

.arrow {
  color: #cbd5e1;
  display: flex;
  align-items: center;
  transition: color .15s ease, transform .15s ease;
}

@media (hover: hover) {
  .platform-btn:hover .arrow { color: currentColor; transform: translateX(3px); }
}

.link-btn {
  display: block;
  margin: 20px auto 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:hover { color: var(--text); }

/* ---------- Форма обращения ---------- */

#feedback-form {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 15px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: #f8fafc;
  outline: none;
  resize: vertical;
  transition: border-color .15s ease, background .15s ease;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--primary);
  background: #fff;
}

.field input::placeholder,
.field textarea::placeholder { color: #94a3b8; }

.form-error {
  color: #dc2626;
  font-size: 13px;
}

.submit-btn {
  margin-top: 4px;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}

.submit-btn:hover { background: var(--primary-dark); }
.submit-btn:active { transform: scale(.98); }
.submit-btn[disabled] { opacity: .6; cursor: default; }

.privacy-note {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

/* ---------- Подвал ---------- */

.footer {
  margin-top: 12px;
  text-align: center;
  color: rgba(255, 255, 255, .75);
  font-size: 13px;
}

.footer strong { color: #fff; }

/* ---------- Малые экраны ---------- */

@media (max-width: 360px) {
  .star svg { width: 38px; height: 38px; }
  .card { padding: 20px 14px; }
}
