/* ============================================
   Компонент модального окна "Опасное производственное предприятие"
   ============================================ */

/* Оверлей модального окна */
.hazardous-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: none !important;
  align-items: center;
  justify-content: center;
  z-index: 99999 !important;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
  box-sizing: border-box;
  visibility: hidden;
}

.hazardous-modal-overlay.show {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Контейнер модального окна */
.hazardous-modal-container {
  position: relative;
  background-color: #e9f1fc;
  border: 1px solid #ffffff;
  border-radius: 5px;
  max-width: none;
  width: 60%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px 35px 30px;
  box-sizing: border-box;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hazardous-modal-overlay:not([aria-hidden="true"]) .hazardous-modal-container,
.hazardous-modal-overlay.show .hazardous-modal-container {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Кнопка закрытия */
.hazardous-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 32px;
  color: #152333;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  z-index: 1;
}

.hazardous-modal-close:hover {
  color: #e60012;
}

/* Контент модального окна */
.hazardous-modal-content {
  width: 100%;
}

/* Заголовок */
.hazardous-modal-title {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-style: normal;
  font-size: 30px;
  line-height: 100%;
  letter-spacing: 0%;
  color: #152333;
  margin: 0 0 12px 0;
  text-transform: uppercase;
}

/* Описание */
.hazardous-modal-description {
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-style: normal;
  font-size: 14px;
  line-height: 100%;
  letter-spacing: 0%;
  color: #152333;
  margin: 0px 0 50px 0;
}

/* Форма */
.hazardous-modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Ряд полей */
.hazardous-modal-form-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

/* Поле формы */
.hazardous-modal-field {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 200px;
}

.hazardous-modal-field-full {
  width: 100%;
  flex: 1 1 100%;
}

/* Лейбл */
.hazardous-modal-label {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 120%;
  color: #152333;
  margin-bottom: 8px;
}

/* Поле ввода */
.hazardous-modal-input,
.hazardous-modal-textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1.2px solid #152333;
  border-radius: 3px;
  background-color: #e9f1fc;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-style: normal;
  font-size: 16px;
  line-height: 16px;
  letter-spacing: 0%;
  color: #152333;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.hazardous-modal-input:focus,
.hazardous-modal-textarea:focus {
  outline: none;
  border-color: #152333;
}

.hazardous-modal-input::placeholder,
.hazardous-modal-textarea::placeholder {
  color: rgba(21, 35, 51, 0.5);
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 16px;
}

.hazardous-modal-textarea {
  resize: vertical;
  min-height: 90px;
}

/* Действия формы */
.hazardous-modal-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  margin-top: 5px;
}

.hazardous-modal-actions:hover .hazardous-modal-submit,
.hazardous-modal-actions:hover .hazardous-modal-submit-arrow {
  box-shadow: 0 0 20px rgba(21, 35, 51, 0.6), 0 0 40px rgba(21, 35, 51, 0.4);
  transform: translateY(-2px);
}

.hazardous-modal-actions:hover .hazardous-modal-submit {
  color: #ffffff;
}

.hazardous-modal-actions:hover .hazardous-modal-submit-arrow {
  box-shadow: 0 0 20px rgba(230, 0, 18, 0.6), 0 0 40px rgba(230, 0, 18, 0.4);
}

/* Кнопка отправки */
.hazardous-modal-submit {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-style: normal;
  font-size: 13px;
  line-height: 120%;
  letter-spacing: 0%;
  text-align: center;
  color: #ffffff;
  background: #152333;
  padding: 15px 32px;
  border-radius: 5px;
  border: none;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  cursor: pointer !important;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-transform: uppercase;
  flex: 1;
}

.hazardous-modal-submit:hover {
  text-decoration: none;
}

.hazardous-modal-submit:disabled {
  background-color: #91a2b8;
  cursor: not-allowed;
  color: #ffffff;
}

.hazardous-modal-submit:hover {
  background-color: #0f1a26;
}

.hazardous-modal-submit:disabled {
  background-color: #91a2b8;
  cursor: not-allowed;
}

/* Кнопка-стрелка */
.hazardous-modal-submit-arrow {
  background: #e60012;
  border: none;
  border-radius: 5px;
  padding: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.hazardous-modal-submit-arrow:disabled {
  background-color: #91a2b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.hazardous-modal-submit-arrow img {
  width: 15px;
  height: 15px;
  display: block;
  filter: brightness(0) invert(1);
  position: relative;
  z-index: 1;
}

/* Согласие */
.hazardous-modal-consent {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: -5px;
}

/* Чекбокс */
.hazardous-modal-checkbox {
  width: 18px;
  height: 18px;
  border: 1px solid #152333;
  border-radius: 3px;
  background-color: #ffffff;
  flex-shrink: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
  margin-top: 2px;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.hazardous-modal-checkbox:checked {
  background-color: #152333;
  border-color: #152333;
}

.hazardous-modal-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Текст согласия */
.hazardous-modal-consent-text {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 11px;
  line-height: 150%;
  color: #152333;
  cursor: pointer;
  user-select: none;
}

.hazardous-modal-consent-text a {
  color: #152333;
  text-decoration: underline;
}

.hazardous-modal-consent-text a:hover {
  text-decoration: none;
}

/* Стили для модального окна с сообщением (success/error) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
}

.modal-popup {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 40px 30px;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal-popup {
  transform: scale(1);
}

.modal-popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 28px;
  color: #152333;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.modal-popup-close:hover {
  color: #e60012;
}

.modal-popup-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-popup-success .modal-popup-icon {
  background-color: #28a745;
  color: #ffffff;
}

.modal-popup-error .modal-popup-icon {
  background-color: #e60012;
  color: #ffffff;
}

.modal-popup-title {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: #152333;
  margin: 0 0 15px 0;
}

.modal-popup-message {
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: #152333;
  margin: 0 0 30px 0;
  line-height: 1.5;
}

.modal-popup-button {
  margin-top: 20px;
}

.modal-popup-button button {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: #ffffff;
  background-color: #e60012;
  border: none;
  border-radius: 5px;
  padding: 12px 40px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.modal-popup-button button:hover {
  background-color: #cc0010;
}

/* Адаптивность */
@media (max-width: 768px) {
  .hazardous-modal-container {
    padding: 30px 20px 25px;
    width: 95%;
    border-radius: 5px;
  }

  .hazardous-modal-title {
    font-size: 18px;
    padding-right: 30px;
  }

  .hazardous-modal-form-row {
    flex-direction: column;
    gap: 15px;
  }

  .hazardous-modal-field {
    min-width: 100%;
  }

  .hazardous-modal-actions {
    flex-wrap: wrap;
  }

  .hazardous-modal-submit {
    flex: 1;
    min-width: 0;
  }

  .modal-overlay {
    padding: 20px;
  }

  .modal-popup {
    padding: 30px 20px;
  }

  .modal-popup-title {
    font-size: 20px;
  }

  .modal-popup-message {
    font-size: 14px;
  }
}
