/* ========================================
   DDIT — Forms & Modal
   ======================================== */

/* ---- Modal overlay ---- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 30, 0.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.active { display: flex; }

/* ---- Modal card ---- */
/* Note: JS still works — it targets #formModal.active, #closeModal, #contactForm */
.modal-content {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(12, 12, 30, 0.32);
  position: relative;
  animation: modalIn 0.32s var(--ease) forwards;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* Close button (top-left in RTL) */
.modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-3);
  padding: 6px 8px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { color: var(--ink); background: var(--bg-2); }

/* ---- Form heading ---- */
.contact-form h2 {
  text-align: center;
  margin-block-end: 26px;
  font-size: 1.35rem;
}

/* ---- Form groups (keep class for JS validation compatibility) ---- */
.form-group {
  margin-block-end: 14px;
}

.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin-block-end: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--r1);
  transition: border-color 0.2s, box-shadow 0.2s;
  direction: rtl;
  appearance: none;
}

.form-group input::placeholder { color: var(--ink-3); font-size: 14px; }

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(124, 53, 240, 0.1);
}

/* Select arrow */
.form-group select {
  cursor: pointer;
  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='%238888A8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 18px;
  padding-left: 36px;
}

/* ---- Validation states ---- */
.form-group.has-error input,
.form-group.has-error select {
  border-color: #e05252;
  box-shadow: 0 0 0 3px rgba(224, 82, 82, 0.1);
}

.error-message {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #c94040;
  font-weight: 500;
}

/* ---- Form messages ---- */
.form-message {
  padding: 12px 16px;
  border-radius: var(--r1);
  margin-block-end: 16px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
}
.form-message.success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.form-message.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .modal-content {
    padding: 28px 20px;
    border-radius: 16px;
  }
  .contact-form h2 { font-size: 1.2rem; }
}
