.eng-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
}

.eng-modal:not([hidden]) {
  pointer-events: auto;
}

.eng-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
}

.eng-modal__dialog {
  position: relative;
  width: min(100%, 440px);
  max-height: min(92vh, 640px);
  overflow: auto;
  padding: 1.5rem 1.35rem 1.25rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.98), rgba(11, 17, 32, 0.98));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  color: #e2e8f0;
  animation: engModalIn 0.35s ease;
}

@keyframes engModalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .eng-modal__dialog {
    animation: none;
  }
}

.eng-modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.5);
  color: #f8fafc;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.eng-modal__close:hover {
  background: rgba(71, 85, 105, 0.85);
}

.eng-modal__title {
  margin: 0 2rem 0.35rem 0;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  color: #f8fafc;
}

.eng-modal__desc {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #94a3b8;
}

.eng-modal__field {
  margin-bottom: 0.85rem;
}

.eng-modal__field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
}

.eng-modal__field input,
.eng-modal__field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #020617;
  color: #f1f5f9;
  font: inherit;
}

.eng-modal__field input:focus,
.eng-modal__field textarea:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
  border-color: #3b82f6;
}

.eng-modal__field textarea {
  resize: vertical;
  min-height: 96px;
}

.eng-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.eng-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.eng-modal__btn--primary {
  flex: 1 1 100%;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border: none;
}

.eng-modal__btn--primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.eng-modal__btn--primary:disabled {
  opacity: 0.7;
  cursor: wait;
}

.eng-modal__btn--primary.is-success {
  background: linear-gradient(135deg, #059669, #10b981);
}

.eng-modal__btn--primary.is-error {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
}

.eng-modal__btn--ghost {
  flex: 1 1 calc(50% - 0.25rem);
  background: rgba(30, 41, 59, 0.65);
  color: #e2e8f0;
  border-color: #334155;
}

.eng-modal__btn--ghost:hover {
  background: rgba(51, 65, 85, 0.85);
}

.eng-modal__hint {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

.eng-modal__hint.is-error {
  color: #fca5a5;
}

.eng-modal__hint.is-success {
  color: #6ee7b7;
}

body.eng-modal-open {
  overflow: hidden;
}

@media (max-width: 380px) {
  .eng-modal__btn--ghost {
    flex: 1 1 100%;
  }
}
