/* ========================================
   МОДАЛЬНОЕ ОКНО ФОРМЫ ЗАПИСИ
   ======================================== */

.ac-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ac-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.ac-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ac-modal-overlay.is-active .ac-modal {
  transform: scale(1) translateY(0);
}

.ac-modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: relative;
}

.ac-modal-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: #1a1a1a;
}

.ac-modal-subtitle {
  font-size: 14px;
  color: #666;
  margin: 6px 0 0;
}

.ac-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  padding: 0;
}

.ac-modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.ac-modal-close::before,
.ac-modal-close::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 2px;
  background: #666;
  border-radius: 1px;
}

.ac-modal-close::before {
  transform: rotate(45deg);
}

.ac-modal-close::after {
  transform: rotate(-45deg);
}

.ac-modal-body {
  padding: 24px;
}

.ac-modal-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #666;
  background: rgba(0, 0, 0, 0.04);
  padding: 6px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.ac-modal-source::before {
  content: '📍';
  font-size: 16px;
}

.ac-modal-form .form-row {
  margin-bottom: 14px;
}

.ac-modal-form .form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.ac-modal-form .form-input:focus {
  outline: none;
  border-color: var(--ac-btn-primary-bg, #0b5cff);
}

.ac-modal-form .form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #666;
  margin: 16px 0;
}

.ac-modal-form .form-check input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.ac-modal-form .form-check a {
  color: var(--ac-btn-primary-bg, #0b5cff);
  text-decoration: none;
}

.ac-modal-form .form-check a:hover {
  text-decoration: underline;
}

.ac-modal-form .form-submit {
  width: 100%;
  padding: 14px 24px;
  background: var(--ac-btn-primary-bg, #0b5cff);
  color: var(--ac-btn-primary-text, #fff);
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ac-modal-form .form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(11, 92, 255, 0.3);
}

.ac-modal-form .form-submit:active {
  transform: translateY(0);
}

.ac-modal-form .form-status {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 14px;
  min-height: 20px;
}

.ac-modal-form .form-status.success {
  color: #10b981;
  font-weight: 600;
}

.ac-modal-form .form-status.error {
  color: #ef4444;
}

/* Мобильная адаптация */
@media (max-width: 640px) {
  .ac-modal {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 95vh;
  }
  
  .ac-modal-header {
    padding: 20px 20px 14px;
  }
  
  .ac-modal-title {
    font-size: 20px;
    padding-right: 36px;
  }
  
  .ac-modal-body {
    padding: 20px;
  }
  
  .ac-modal-close {
    width: 32px;
    height: 32px;
    top: 16px;
    right: 16px;
  }
}

/* Скрываем скролл body когда модалка открыта */
body.ac-modal-open {
  overflow: hidden;
}
