/*
Copyright (c) 2025-2026 Korobelnikov Roman Maksimovich (Коробельников Роман Максимович)
All rights reserved. This code is the exclusive property of Korobelnikov Roman Maksimovich.
Unauthorized use, modification, or distribution is prohibited.
*/

/* Кнопка «Поддержка» на правом краю экрана */
.support-tab {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 16px 10px;
  border: none;
  border-radius: 12px 0 0 12px;
  background: #256BFF;
  color: #ffffff;
  font: 700 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 17, 20, 0.18);
  z-index: 9990;
  transition: background 0.15s ease, transform 0.15s ease;
}

.support-tab:hover {
  background: #1554D8;
  transform: translateY(-50%) translateX(-2px);
}

.support-tab:focus-visible {
  outline: 3px solid #DCEBFF;
  outline-offset: -3px;
}

/* Затемнение фона и окно */
.support-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 17, 20, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9998;
}

.support-overlay[hidden] {
  display: none;
}

.support-modal {
  width: min(440px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #D8DEE8;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(16, 17, 20, 0.25);
  padding: 24px;
  animation: support-pop 0.18s ease-out;
}

@keyframes support-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.support-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.support-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #101114;
}

.support-modal__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #667085;
}

.support-modal__close {
  flex: none;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: #F8FAFF;
  color: #101114;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.support-modal__close:hover {
  background: #DCEBFF;
}

.support-field {
  margin-bottom: 14px;
}

.support-field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #101114;
}

.support-field__hint {
  font-weight: 400;
  color: #667085;
}

.support-field__input,
.support-field__textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #D8DEE8;
  border-radius: 10px;
  padding: 10px 12px;
  font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #101114;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.support-field__textarea {
  min-height: 110px;
  resize: vertical;
}

.support-field__input:focus,
.support-field__textarea:focus {
  outline: none;
  border-color: #256BFF;
  box-shadow: 0 0 0 3px rgba(37, 107, 255, 0.15);
}

.support-attach {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.support-attach__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #D8DEE8;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px 12px;
  font: 600 13px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #101114;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.support-attach__btn:hover {
  border-color: #256BFF;
  background: #F8FAFF;
}

.support-attach__preview {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #D8DEE8;
}

.support-attach__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.support-attach__remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(16, 17, 20, 0.65);
  color: #ffffff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.support-submit {
  width: 100%;
  border: none;
  border-radius: 10px;
  background: #256BFF;
  color: #ffffff;
  padding: 12px 16px;
  font: 700 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  cursor: pointer;
  transition: background 0.15s ease;
}

.support-submit:hover:not(:disabled) {
  background: #1554D8;
}

.support-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.support-status {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
}

.support-status--error {
  color: #FF4D4F;
}

.support-done {
  text-align: center;
  padding: 12px 0 4px;
}

.support-done__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #22C55E;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.support-done__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: #101114;
}

.support-done__text {
  margin: 0 0 16px;
  font-size: 14px;
  color: #667085;
}

.support-auth {
  text-align: center;
  padding: 12px 0 4px;
}

.support-auth__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: #101114;
}

.support-auth__text {
  margin: 0 0 16px;
  font-size: 14px;
  color: #667085;
}

.support-auth__btn {
  display: inline-block;
  box-sizing: border-box;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: #256BFF;
  color: #ffffff;
  padding: 12px 16px;
  font: 700 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.support-auth__btn:hover {
  background: #1554D8;
}

/* Антиспам-ловушка: невидимое поле, боты его заполняют, люди — нет */
.support-hp {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 480px) {
  .support-tab {
    padding: 12px 8px;
    font-size: 13px;
  }

  .support-modal {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-modal {
    animation: none;
  }
}
