/* مودال تماس و فرم — مشترک، در هر صفحه‌ای که دکمهٔ تماس دارد
   تولیدشده از about-me.html — سیستم طراحی: design-system/nariman-yadollahi/MASTER.md */

/* ══ CONTACT MODAL ═══════════════════════════════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4, 8, 16, .85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  padding: var(--space-sm);
  overflow-y: auto;
}
.modal[hidden] { display: none; }

.modal-card {
  /* margin:auto وسط می‌چیند وقتی جا هست، و وقتی کارت از صفحه بلندتر
     است بالایش را نمی‌بُرد — برخلاف align-items:center */
  margin: auto;
  background: var(--color-surface-3);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 48px 44px;
  width: 100%;
  max-width: 480px;
  position: relative;
  direction: rtl;
  text-align: right;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .7);
}

.modal-close {
  position: absolute;
  inset-inline-end: 20px;            /* در RTL = چپ، همان جای قبلی */
  top: 20px;
  width: 44px; height: 44px;         /* هدف لمسی ۴۴×۴۴ */
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-fg-subtle);
  font-size: 22px;
  line-height: 1;
  font-family: inherit;
  border-radius: 50%;
  transition: color .18s ease-out, background .18s ease-out;
}
.modal-close:hover { color: var(--color-fg); background: var(--color-surface-2); }

.modal-title {
  font-size: 1.375rem;
  font-weight: var(--weight-bold);
  color: var(--color-fg);
  margin-bottom: var(--space-xs);
}
.modal-desc {
  font-size: var(--text-small);
  color: var(--color-fg-muted);
  margin-bottom: var(--space-lg);
  line-height: 1.8;
}

/* ══ FORM ════════════════════════════════════════════════════════════ */
.field { margin-bottom: var(--space-sm); }
.field:last-of-type { margin-bottom: var(--space-md); }

/* برچسب همیشه دیده می‌شود — placeholder هرگز جای label نیست */
.field label {
  display: block;
  font-size: 0.75rem;
  color: var(--color-fg-muted);
  margin-bottom: 6px;
}
.field input,
.field textarea {
  width: 100%;
  padding: 12px 16px;
  min-height: 48px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  color: var(--color-fg);
  font-family: inherit;
  font-size: 0.9375rem;
  direction: rtl;
  transition: border-color .18s ease-out;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input::placeholder,
.field textarea::placeholder { color: var(--color-fg-subtle); }
.field input:focus,
.field textarea:focus { border-color: var(--color-accent); }
/* :focus-visible سراسری حلقهٔ فوکوس را می‌دهد؛ outline را حذف نمی‌کنیم */

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--color-danger); }
.field-error {
  display: block;
  font-size: 0.75rem;
  color: var(--color-danger);
  margin-top: 6px;
  min-height: 1em;
}

.form-submit {
  width: 100%;
  min-height: 48px;
  padding: 15px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-family: inherit;
  font-weight: var(--weight-bold);
  font-size: 1rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(1, 184, 254, .3);
  transition: box-shadow .18s ease-out, transform .18s ease-out;
}
.form-submit:hover { box-shadow: 0 0 50px rgba(1, 184, 254, .5); transform: translateY(-2px); }
.form-submit:active { transform: translateY(0); }
.form-submit[disabled] { opacity: .6; cursor: progress; transform: none; }

.form-status {
  margin-top: var(--space-sm);
  text-align: center;
  font-size: var(--text-small);
  line-height: 1.7;
}
.form-status.ok   { color: var(--color-accent); }
.form-status.fail { color: var(--color-danger); }

@media (max-width: 820px) {
  .modal-card { padding: 40px 24px; border-radius: 18px; }
  .story-img-wrap { aspect-ratio: 16/9; }
}

@media (prefers-reduced-motion: reduce) {
  .form-submit:hover { transform: none; }
}

/* خدمتی که کاربر رویش کلیک کرده — تا بداند درخواستش دربارهٔ چیست */
.modal-plan {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-small);
  font-weight: var(--weight-label);
  color: var(--color-accent);
  background: var(--color-accent-faint);
  border: 1px solid rgba(1,184,254,.4);
  border-radius: 40px;
  padding: 6px 16px;
  margin-bottom: var(--space-md);
}
