/* صفحة التواصل — تبني على رموز styles.css ولا تكرّرها. */

/* `hidden` يُخفي مهما كان `display` العنصر. بطاقة «وصلت رسالتك» لها `display:grid`،
   وقاعدةُ الصفحة تغلب إخفاءَ المتصفّح الافتراضي — فظهرت قبل أن يُرسَل شيء. */
[hidden] { display: none !important; }

:root { --bad: #b3261e; }
@media (prefers-color-scheme: dark) { :root { --bad: #f2b8b5; } }

.contact { padding-top: 48px; padding-bottom: 64px; }

/* ── الترويسة ── */
.contact-hero { max-width: 680px; margin-bottom: 36px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 600; color: var(--green);
  background: color-mix(in srgb, var(--green) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--green) 22%, transparent);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 16px;
}
.contact-hero h1 { font-size: clamp(1.9rem, 4.4vw, 2.6rem); line-height: 1.3; letter-spacing: -.3px; }
.contact-hero .lead { color: var(--muted); font-size: 1.08rem; margin-top: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 20px; list-style: none; }
.pills li { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .92rem; }
.pills svg { width: 18px; height: 18px; color: var(--green); flex: none; }

/* ── التخطيط: النموذج وجانبه ── */
.contact-grid {
  display: grid; gap: 24px; align-items: start;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
}

.card {
  position: relative; min-width: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.form-card { padding: 28px; display: grid; gap: 28px; }

/* ── الخطوات الثلاث ── */
.step { display: grid; gap: 14px; border: 0; min-width: 0; }
.step-title {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font-weight: 700; font-size: 1.02rem;
}
.step-title .num {
  display: inline-grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--green); font-size: .85rem;
}
.step-title small { margin-inline-start: auto; font-weight: 400; font-size: .84rem; color: var(--muted); }

/* ── نوع الرسالة: بطاقاتٌ تُرى دفعةً واحدة، لا قائمة منسدلة ── */
.kinds { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kind {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  padding: 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--sand); cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.kind:hover { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.kind input { position: absolute; opacity: 0; pointer-events: none; }
.kind .ic {
  display: grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--card); border: 1px solid var(--line); color: var(--green);
  transition: background .15s, color .15s, border-color .15s;
}
.kind .ic svg { width: 20px; height: 20px; }
.kind b { display: block; font-size: .98rem; }
.kind .d { display: block; margin-top: 2px; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.kind.is-checked {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 7%, var(--card));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent);
}
.kind.is-checked .ic { background: var(--green); border-color: var(--green); color: #fff; }
.kind:has(input:focus-visible) { outline: 2px solid var(--amber); outline-offset: 2px; }
.step.invalid .kind { border-color: var(--bad); }

/* ── الحقول ── */
.fields { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label { font-weight: 600; font-size: .92rem; }
.field em { font-style: normal; font-weight: 400; font-size: .82rem; color: var(--muted); }

.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--sand); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input::placeholder, .field textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}
.field input:focus, .field textarea:focus {
  outline: none; background: var(--card); border-color: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 16%, transparent);
}
.field textarea { min-height: 170px; resize: vertical; line-height: 1.75; }
.field.invalid input, .field.invalid textarea { border-color: var(--bad); }

/* الأيقونة على اليمين والكتابة من اليسار: البريد والرقم يُكتبان LTR في صفحةٍ RTL،
   فالمسافة تُقاس بالجهة الفعلية لا المنطقية — وإلا وقعت الأيقونة فوق النصّ. */
.control { position: relative; }
.control svg {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}
.control input { padding-right: 44px; text-align: left; }

.meta { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; color: var(--muted); }
.meta #bodyCount { flex: none; font-variant-numeric: tabular-nums; }

/* الحقل المخفيّ: مقصوصٌ في مكانه لا مدفوعٌ خارج الشاشة. `left:-9999px` في صفحةٍ
   RTL صار مساحة تمريرٍ حقيقية بعرض عشرة آلاف بكسل. */
.trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── الإرسال ── */
.submit { display: grid; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 28px; border-radius: 14px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background .15s, opacity .15s, transform .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn.primary { width: 100%; background: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-700); }
.btn.quiet { border-color: var(--line); background: var(--card); color: var(--ink); }
.btn.quiet:hover { transform: translateY(-2px); }
.btn[disabled] { opacity: .75; cursor: progress; }
.btn .spin {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
.btn.is-sending .spin { display: inline-block; }
.btn.is-sending .arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn .spin { animation-duration: 2.4s; } }

.status {
  display: none; padding: 12px 14px; border-radius: 12px; font-size: .92rem;
  color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--bad) 28%, transparent);
}
.status.show { display: block; }
.privacy { text-align: center; font-size: .82rem; color: var(--muted); }
.privacy a { color: var(--green); }

/* ── الجانب ── */
.aside { display: grid; gap: 16px; }
.aside .card { padding: 22px; }
.aside h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 1rem; }
.aside h2 svg { width: 18px; height: 18px; color: var(--green); flex: none; }
.aside p, .aside li { color: var(--muted); font-size: .92rem; }
.aside ul { display: grid; gap: 4px; padding-inline-start: 18px; }
.aside a { color: var(--green); font-weight: 600; text-decoration: none; }
.aside a:hover { text-decoration: underline; }
.aside .en { padding: 0 6px; font-size: .86rem; color: var(--muted); text-align: left; }

/* ── تمّ الإرسال ── */
.sent { display: grid; justify-items: center; gap: 12px; padding: 44px 28px; text-align: center; }
.sent .check {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--green);
}
.sent .check svg { width: 30px; height: 30px; }
.sent h2 { font-size: 1.4rem; }
.sent p { max-width: 420px; color: var(--muted); }
.sent:focus { outline: none; }

/* ── الشاشات الضيّقة ── */
@media (min-width: 901px) { .aside { position: sticky; top: 88px; } }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .contact { padding-top: 32px; }
  .form-card { padding: 20px; gap: 24px; }
  .fields { grid-template-columns: 1fr; }
}
/* الجوال: عمودان والأيقونة فوق النصّ — أربع بطاقاتٍ متراصّة كانت تملأ الشاشة
   قبل أن يصل المرسل إلى ما يكتبه. */
@media (max-width: 480px) {
  .kind { flex-direction: column; gap: 10px; padding: 12px; }
  .kind .ic { width: 34px; height: 34px; }
  .kind .d { font-size: .8rem; }
}
