/* ================================================
   FEEDBACK MODAL — feedback.css
   Цветовая схема: #F58220
   ================================================ */

/* ===== КНОПКА-ТРИГГЕР ===== */
.open-feedback-btn {
  display: inline-block;
  padding: 14px 36px;
  background: #F58220;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  font-family: 'Roboto', sans-serif;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(245, 130, 32, 0.28);
  text-decoration: none;
}
.open-feedback-btn:hover {
  background: #d96e10;
  box-shadow: 0 4px 16px rgba(245, 130, 32, 0.38);
}
.open-feedback-btn:active {
  transform: scale(0.98);
}

/* ===== ОВЕРЛЕЙ МОДАЛЬНОГО ОКНА ===== */
#feedbackModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  background: rgba(20, 30, 50, 0.60);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#feedbackModal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ===== ОКНО ФОРМЫ ===== */
.fb-modal-window {
  position: relative;
  background: #fff;
  border-radius: 4px;
  padding: 36px 40px 32px 40px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  margin: auto;
  box-shadow: 0 8px 40px rgba(20, 30, 60, 0.22);
  animation: fbModalIn 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow-y: auto;
}

@keyframes fbModalIn {
  from { 
    opacity: 0; 
    transform: translateY(-30px) scale(0.96); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

/* ===== КНОПКА ЗАКРЫТЬ ===== */
.fb-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 28px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  font-family: Arial, sans-serif;
  z-index: 10;
}
.fb-modal-close:hover {
  color: #F58220;
  background: #fff4ea;
}

/* ===== ЗАГОЛОВОК ===== */
.fb-modal-window h3 {
  font-size: 22px;
  font-weight: 600;
  color: #1a2540;
  margin: 0 0 6px 0;
  letter-spacing: -0.3px;
  font-family: 'Roboto', sans-serif;
}

.fb-modal-subtitle {
  font-size: 14px;
  color: #6b7a99;
  margin: 0 0 20px 0;
  font-family: 'Roboto', sans-serif;
}

/* ===== РАЗДЕЛИТЕЛЬ ===== */
.fb-modal-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #f0e8de, transparent);
  margin-bottom: 22px;
}

/* ===== ДЕКОРАТИВНАЯ ПОЛОСА СВЕРХУ ===== */
.fb-modal-window::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #F58220, #ffaa55);
  border-radius: 6px 6px 0 0;
}

/* ===== РУЧКА ДЛЯ МОБИЛЬНЫХ (скрыта по умолчанию) ===== */
.fb-handle {
  display: none;
}

/* ===== ГРУППА ПОЛЯ ===== */
#feedbackForm .fb-form-group {
  margin-bottom: 16px;
}

/* ===== LABEL ===== */
#feedbackForm label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374161;
  margin-bottom: 6px;
  font-family: 'Roboto', sans-serif;
}

#feedbackForm label .fb-req {
  color: #e74c3c;
  margin-left: 2px;
}

.fb-field-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fb-field-icon svg {
  flex-shrink: 0;
  opacity: 0.55;
  color: #F58220;
}

/* ===== ПОЛЯ ВВОДА ===== */
#feedbackForm input[type="text"],
#feedbackForm input[type="tel"],
#feedbackForm input[type="email"],
#feedbackForm textarea,
#feedbackForm select {
  display: block;
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  font-family: 'Roboto', sans-serif;
  color: #222;
  background: #fdf9f5;
  border: 1.5px solid #e8d5c0;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  resize: vertical;
  box-sizing: border-box;
}

#feedbackForm input[type="text"]:focus,
#feedbackForm input[type="tel"]:focus,
#feedbackForm input[type="email"]:focus,
#feedbackForm textarea:focus,
#feedbackForm select:focus {
  border-color: #F58220;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.12);
}

#feedbackForm input::placeholder,
#feedbackForm textarea::placeholder {
  color: #bfb0a0;
}

/* ===== SELECT ===== */
#feedbackForm select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23F58220' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
  cursor: pointer;
}

/* ===== FILE INPUT — ИСПРАВЛЕНО ===== */
.fb-file-wrapper {
  margin-top: 10px;
}

.fb-file-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex-wrap: wrap;
}

.fb-file-btn {
  flex-shrink: 0;
  padding: 9px 18px;
  background: #fff4ea;
  border: 1.5px solid #f5c99a;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #F58220;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  font-family: 'Roboto', sans-serif;
}

.fb-file-label:hover .fb-file-btn {
  background: #fde8cc;
  border-color: #F58220;
}

.fb-file-name {
  font-size: 13px;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
  font-family: 'Roboto', sans-serif;
}

#feedbackForm input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== CHECKBOX ===== */
.fb-form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  margin-top: 8px;
}

.fb-form-check-input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #F58220;
  cursor: pointer;
}

.fb-form-check-label {
  font-size: 13px;
  font-weight: 400;
  color: #6b7a99;
  line-height: 1.5;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
}

.fb-form-check-label a {
  color: #F58220;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fb-form-check-label a:hover {
  color: #d96e10;
}

/* ===== КНОПКА ОТПРАВИТЬ ===== */
.fb-submit-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #F58220 0%, #ff9a44 100%);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  transition: opacity 0.2s, box-shadow 0.2s, transform 0.1s;
  box-shadow: 0 4px 16px rgba(245, 130, 32, 0.32);
}

.fb-submit-btn:hover {
  opacity: 0.93;
  box-shadow: 0 6px 24px rgba(245, 130, 32, 0.42);
}

.fb-submit-btn:active {
  transform: scale(0.98);
}

.fb-submit-btn:disabled {
  background: #e8c4a0;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 1;
}

/* ===== СТАТУС ОТПРАВКИ ===== */
#feedbackStatus {
  margin-top: 16px;
  padding: 13px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  display: none;
  text-align: center;
  font-family: 'Roboto', sans-serif;
  line-height: 1.5;
}

#feedbackStatus.fb-success {
  display: block;
  background: #d4edda;
  color: #155724;
  border: 1.5px solid #c3e6cb;
}

#feedbackStatus.fb-error {
  display: block;
  background: #f8d7da;
  color: #721c24;
  border: 1.5px solid #f5c6cb;
}

/* ========================================
   TABLET — 601px … 900px
   ======================================== */
@media (min-width: 601px) and (max-width: 900px) {
  .fb-modal-window {
    max-width: 88vw;
    padding: 32px 32px 28px;
  }
}

/* ========================================
   MOBILE — max-width: 600px
   ======================================== */
@media (max-width: 600px) {

  /* Bottom-sheet для мобильных */
  #feedbackModal.is-open {
    align-items: flex-end;
    padding: 0;
  }

  .fb-modal-window {
    border-radius: 20px 20px 0 0;
    padding: 16px 20px 40px 20px; /* ИСПРАВЛЕНО: уменьшен верхний padding */
    max-width: 100vw;
    width: 100vw;
    max-height: 92vh;
    overflow-y: auto;
    animation: fbSlideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    margin: 0;
  }

  /* ИСПРАВЛЕНО: Убираем декоративную полосу на мобильных */
  .fb-modal-window::before {
    display: none;
  }

  @keyframes fbSlideUp {
    from { 
      transform: translateY(100%); 
      opacity: 0.7; 
    }
    to { 
      transform: translateY(0); 
      opacity: 1; 
    }
  }

  /* Ручка-индикатор */
  .fb-handle {
    display: block;
    width: 36px;
    height: 4px;
    background: #d9c8b8;
    border-radius: 2px;
    margin: 0 auto 16px; /* ИСПРАВЛЕНО: уменьшен отступ */
  }

  .fb-modal-window h3 {
    font-size: 20px;
    margin-top: 0;
  }

  .fb-modal-subtitle {
    font-size: 13px;
    margin-bottom: 18px;
  }

  /* ИСПРАВЛЕНО: Крестик закрытия — sticky + правильное позиционирование */
  .fb-modal-close {
    position: sticky;
    top: 16px;
    right: 16px;
    font-size: 26px;
    width: 30px;
    height: 30px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  /* Поля — font-size 16px предотвращает автозум на iOS */
  #feedbackForm label {
    font-size: 13px;
  }

  #feedbackForm input[type="text"],
  #feedbackForm input[type="tel"],
  #feedbackForm input[type="email"],
  #feedbackForm textarea,
  #feedbackForm select {
    font-size: 16px;
    padding: 12px 14px;
    border-radius: 4px;
  }

  .fb-submit-btn {
    font-size: 16px;
    padding: 15px 24px;
    border-radius: 4px;
  }

  .fb-form-check-label {
    font-size: 12px;
  }

  .fb-file-wrapper {
    margin-top: 12px;
  }

  .fb-file-name {
    max-width: 180px;
    font-size: 12px;
  }

  .fb-file-btn {
    font-size: 12px;
    padding: 8px 14px;
  }

  /* Кнопка-триггер */
  .open-feedback-btn {
    display: block;
    width: 100%;
    font-size: 16px;
    padding: 15px 24px;
    box-sizing: border-box;
  }
}

/* Фикс для предотвращения горизонтального скролла */
body.fb-modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}
TABLET — 601px … 900px — ОБНОВЛЕНО
   ======================================== */
@media (min-width: 601px) and (max-width: 900px) {
  .fb-modal-window {
    max-width: 88vw;
  }

  .fb-modal-header {
    padding: 32px 32px 0 32px;
  }

  .fb-modal-body {
    padding: 0 32px 28px 32px;
  }
}