/*
  Плавающая кнопка «Отзыв» и панель обратной связи.
  Цвета и шрифт — как на сайте (app/static/style.css): тёмный #1C1C1C,
  зелёный акцент #A9CE9A / #6B9C5A, рамки #E2E2DB, шрифт Inter.
  Все классы начинаются с fb-, чтобы не пересекаться со стилями страниц.
  Подключается и на главной, где style.css нет, поэтому всё описано здесь.
*/

/* ---------- Кнопка в правом нижнем углу ---------- */
.fb-button {
  position: fixed;
  right: 20px;
  /* env(safe-area-inset-bottom) — запас над системной полосой iPhone */
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  background: #1C1C1C;
  color: #FFFFFF;
  font: 600 14px/1 'Inter', system-ui, sans-serif;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  cursor: pointer;
}
.fb-button:hover { background: #333330; }
.fb-button:focus-visible, .fb-close:focus-visible, .fb-submit:focus-visible, .fb-again:focus-visible {
  outline: 3px solid #6B9C5A;
  outline-offset: 3px;
}
.fb-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Без JavaScript вместо кнопки — обычная ссылка на /feedback */
.fb-noscript {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 60;
  padding: 12px 18px; border-radius: 999px; background: #1C1C1C; color: #FFFFFF;
  font: 600 14px 'Inter', system-ui, sans-serif; text-decoration: none;
}

/* ---------- Панель ---------- */
.fb-panel {
  position: fixed;
  right: 20px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  z-index: 61;
  width: 380px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid #E2E2DB;
  border-radius: 16px;
  background: #FFFFFF;
  color: #1C1C1C;
  font: 400 14px/1.5 'Inter', system-ui, sans-serif;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}
.fb-panel[hidden], .fb-form[hidden], .fb-done[hidden], .fb-error[hidden] { display: none; }
.fb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.fb-title { margin: 0; font-size: 18px; font-weight: 700; }
.fb-close {
  flex: none; width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: #F6F6F3; color: #1C1C1C; font-size: 22px; line-height: 1; cursor: pointer;
}
.fb-intro { margin: 0 0 14px; color: #5B5B56; }

/* ---------- Поля формы ---------- */
.fb-label { display: block; margin: 12px 0 6px; font-weight: 600; font-size: 13px; color: #3A3A36; }
.fb-input {
  display: block; width: 100%; box-sizing: border-box;
  padding: 10px 12px; border: 1px solid #E2E2DB; border-radius: 10px;
  background: #FFFFFF; color: #1C1C1C; font: 400 15px 'Inter', system-ui, sans-serif;
}
.fb-input:focus { outline: 2px solid #A9CE9A; border-color: #6B9C5A; }
textarea.fb-input { resize: vertical; min-height: 110px; }
.fb-counter { margin-top: 4px; font-size: 12px; color: #6E6E6A; text-align: right; }
.fb-consent { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 12px; font-size: 13px; color: #3A3A36; cursor: pointer; }
.fb-consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: #6B9C5A; }
.fb-consent a { color: #3A6B2B; text-decoration: underline; text-underline-offset: 3px; }
.fb-captcha { min-height: 65px; margin: 4px 0 10px; font-size: 13px; color: #6E6E6A; }
.fb-error { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: #FBEEEC; color: #9B3328; font-size: 13px; }

/* Ловушка для ботов — убрана с экрана, но остаётся в форме */
.fb-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.fb-submit, .fb-again {
  display: block; width: 100%; min-height: 46px; border: 0; border-radius: 10px;
  background: #A9CE9A; color: #1C1C1C; font: 600 15px 'Inter', system-ui, sans-serif; cursor: pointer;
}
.fb-submit:disabled { opacity: 0.6; cursor: progress; }
.fb-done { text-align: center; padding: 10px 0 4px; }
.fb-done-title { margin: 6px 0 4px; font-size: 20px; font-weight: 700; }
.fb-done .fb-again { margin-top: 16px; }

/* ---------- Телефон ---------- */
@media (max-width: 640px) {
  /* Компактная круглая кнопка: только значок (подпись остаётся для экранных читалок) */
  .fb-button { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 48px; height: 48px; padding: 0; justify-content: center; }
  .fb-button-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* Запас внизу страницы: последние кнопки (например, «Оплатить») не прячутся под значком */
  html.has-fb body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  /* Панель — «шторка» снизу во всю ширину */
  .fb-panel {
    left: 0; right: 0; bottom: 0; width: auto; max-height: 90vh;
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .fb-input { font-size: 16px; } /* 16px — чтобы iPhone не увеличивал страницу при вводе */
}

@media print { .fb, .fb-noscript { display: none !important; } }
