/* =====================================================================
   تواصل معنا — هيرو فيه مسطرة دوام حيّة (مفتوح/مغلق بتوقيت دمشق)
   وقنوات سريعة، وفورم "طلب معلومات" بخانات جدول لوحة وختم استلام.
   الكلاسات بتبلش بـ cx-   (التفاعل: assets/js/contact.js)
   ===================================================================== */

.cx { --cx-err: #b4442f; --cx-ok: #3aa66b; }

/* =====================================================================
   E-01 الهيرو
   ===================================================================== */
.cx-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background-color: var(--dh-ink);
  background-image: radial-gradient(60% 60% at 80% 20%, rgba(217, 169, 63, 0.1), transparent 65%);
}
.cx-hero__grid,
.cx-hero__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--c) 1px, transparent 1px),
    linear-gradient(90deg, var(--c) 1px, transparent 1px),
    linear-gradient(var(--c2) 1px, transparent 1px),
    linear-gradient(90deg, var(--c2) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  background-position: center top;
}
.cx-hero__grid { --c: rgba(217, 235, 235, 0.06); --c2: rgba(217, 235, 235, 0.025); }
.cx-hero__glow {
  --c: rgba(242, 210, 127, 0.4);
  --c2: rgba(242, 210, 127, 0.14);
  opacity: 0;
  transition: opacity 0.5s ease;
  -webkit-mask-image: radial-gradient(circle 220px at var(--mx, 50%) var(--my, 50%), #000, transparent 75%);
  mask-image: radial-gradient(circle 220px at var(--mx, 50%) var(--my, 50%), #000, transparent 75%);
}
.cx-hero.is-lit .cx-hero__glow { opacity: 1; }

.cx-hero__in {
  display: grid;
  gap: 3rem;
  padding-block: clamp(7.5rem, 15vw, 9.5rem) clamp(3.5rem, 7vw, 5.5rem);
}
@media (min-width: 1024px) {
  .cx-hero__in { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); align-items: center; gap: clamp(2.5rem, 5vw, 5rem); }
}
.cx-title {
  margin-top: 1.4rem;
  font-size: clamp(2.8rem, 1.5rem + 4.6vw, 5.6rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.cx-title em {
  font-style: normal;
  color: transparent;
  background:
    linear-gradient(135deg, var(--dh-gold-light), var(--dh-gold)) no-repeat right / 0% 100%,
    #fff;
  -webkit-background-clip: text;
  background-clip: text;
  transition: background-size 1.3s var(--dh-ease-io) 0.7s;
}
.is-visible .cx-title em { background-size: 100% 100%; }
.cx-lead {
  margin-top: 1.2rem;
  max-width: 34rem;
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
  line-height: 1.85;
  color: rgba(217, 235, 235, 0.75);
}
.cx-up {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s ease, transform 1s var(--dh-ease);
  transition-delay: calc(var(--i, 0) * 110ms + 200ms);
}
.is-visible .cx-up { opacity: 1; transform: none; }

/* حالة الدوام */
.cx-live {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.9rem 0.45rem 1rem;
  border: 1px solid rgba(217, 235, 235, 0.2);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  background: rgba(14, 43, 43, 0.6);
}
.cx-live i {
  position: relative;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--dh-muted);
}
.cx-live.is-open i { background: var(--cx-ok); }
.cx-live.is-open i::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--cx-ok);
  animation: cx-ping 1.8s ease-out infinite;
}
.cx-live span { font-weight: 500; color: rgba(217, 235, 235, 0.7); }
.cx-hero .cx-live { margin-top: 1.75rem; }

/* قنوات سريعة */
.cx-channels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 2rem;
  max-width: 36rem;
  border: 1px solid rgba(217, 235, 235, 0.16);
}
.cx-ch {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.25rem 0.85rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(217, 235, 235, 0.16);
  text-align: start;
  color: #fff;
  isolation: isolate;
  transition: color 0.35s ease;
}
.cx-ch:nth-child(odd) { border-inline-end: 1px solid rgba(217, 235, 235, 0.16); }
.cx-ch:nth-last-child(-n + 2) { border-bottom: 0; }
.cx-ch::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, var(--dh-gold-light), var(--dh-gold));
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.5s var(--dh-ease);
}
.cx-ch svg { grid-row: span 2; width: 1.5rem; height: 1.5rem; color: var(--dh-gold-light); transition: color 0.35s ease; }
.cx-ch b { font-size: 0.98rem; font-weight: 800; }
.cx-ch span { font-size: 0.8rem; color: rgba(217, 235, 235, 0.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 0.35s ease; }
.cx-ch span[dir="ltr"] { text-align: right; }
.cx-ch:hover,
.cx-ch:focus-visible { color: var(--dh-ink); }
.cx-ch:hover::before,
.cx-ch:focus-visible::before { transform: none; }
.cx-ch:hover svg,
.cx-ch:hover span,
.cx-ch:focus-visible svg,
.cx-ch:focus-visible span { color: var(--dh-ink); }
.cx-ch:focus-visible { outline: 2px solid var(--dh-gold); outline-offset: -2px; }

/* ---------- مسطرة الدوام الأسبوعية ---------- */
.cx-week {
  position: relative;
  padding: 1.25rem 1.25rem 1rem;
  border: 1px solid rgba(217, 235, 235, 0.16);
  background: rgba(14, 43, 43, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 40px 80px -50px rgba(0, 0, 0, 0.7);
}
.cx-week__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(217, 235, 235, 0.14);
}
.cx-week__head h2 { font-size: 0.95rem; font-weight: 800; }
.cx-week__head h2 small { display: block; font-size: 0.75rem; font-weight: 600; color: rgba(217, 235, 235, 0.55); }
.cx-clock { font-family: var(--dh-mono); font-size: 1.6rem; font-weight: 500; color: var(--dh-gold-light); font-variant-numeric: tabular-nums; direction: ltr; }
.cx-clock small { font-size: 0.6em; color: rgba(217, 235, 235, 0.5); margin-inline-start: 0.35rem; }

.cx-week__grid {
  display: grid;
  grid-template-columns: 2rem repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 1rem;
}
.cx-axis {
  position: relative;
  height: var(--bar, 210px);
  margin-top: 1.6rem;
  font-family: var(--dh-mono);
  font-size: 0.62rem;
  color: rgba(217, 235, 235, 0.45);
}
.cx-axis span { position: absolute; inset-inline-start: 0; transform: translateY(-50%); }
.cx-day { display: grid; gap: 0.4rem; text-align: center; }
.cx-day__name { font-size: 0.72rem; font-weight: 700; color: rgba(217, 235, 235, 0.6); white-space: nowrap; }
.cx-day__name .s { display: none; }
@media (max-width: 559px) {
  .cx-day__name .l { display: none; }
  .cx-day__name .s { display: inline; }
  .cx-week { --bar: 170px; padding-inline: 0.9rem; }
  .cx-week__grid { grid-template-columns: 1.6rem repeat(7, minmax(0, 1fr)); gap: 0.25rem; }
  .cx-day__name { font-size: 0.66rem; }
}
.cx-day__bar {
  position: relative;
  height: var(--bar, 210px);
  border: 1px solid rgba(217, 235, 235, 0.14);
  background-image: linear-gradient(rgba(217, 235, 235, 0.08) 1px, transparent 1px);
  background-size: 100% 25%;
  overflow: hidden;
}
/* ساعات الدوام 9 → 18 */
.cx-day__band {
  position: absolute;
  inset-inline: 0;
  top: calc(9 / 24 * 100%);
  height: calc(9 / 24 * 100%);
  background-color: rgba(217, 169, 63, 0.16);
  background-image: repeating-linear-gradient(-45deg, rgba(242, 210, 127, 0.28) 0 1px, transparent 1px 6px);
  border-block: 1px solid rgba(242, 210, 127, 0.55);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.9s var(--dh-ease) calc(var(--di, 0) * 70ms + 0.5s);
}
.is-visible .cx-day__band { transform: none; }
.cx-day.is-closed .cx-day__bar {
  background-image:
    repeating-linear-gradient(45deg, rgba(217, 235, 235, 0.07) 0 1px, transparent 1px 8px),
    linear-gradient(rgba(217, 235, 235, 0.08) 1px, transparent 1px);
  background-size: auto, 100% 25%;
}
.cx-day.is-closed .cx-day__name { color: rgba(217, 235, 235, 0.35); }
.cx-day.is-today .cx-day__bar { border-color: var(--dh-gold); box-shadow: 0 0 0 1px var(--dh-gold), 0 0 24px -6px rgba(217, 169, 63, 0.7); }
.cx-day.is-today .cx-day__name { color: var(--dh-gold-light); }
.cx-now {
  position: absolute;
  inset-inline: -1px;
  top: var(--now, 50%);
  height: 2px;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}
.cx-now::before {
  content: "";
  position: absolute;
  inset-inline-start: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}
.cx-week__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(217, 235, 235, 0.14);
  font-size: 0.8rem;
  color: rgba(217, 235, 235, 0.6);
}
.cx-week__foot b { color: #fff; font-weight: 700; }
.cx-legend { display: flex; gap: 1rem; }
.cx-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.cx-legend span::before { content: ""; width: 0.7rem; height: 0.7rem; border: 1px solid rgba(242, 210, 127, 0.6); background: rgba(217, 169, 63, 0.25); }
.cx-legend span + span::before { border-color: rgba(217, 235, 235, 0.25); background: repeating-linear-gradient(45deg, rgba(217, 235, 235, 0.25) 0 1px, transparent 1px 3px); }

/* =====================================================================
   E-02 الفورم: نموذج طلب معلومات
   ===================================================================== */
.cx-main { padding-block: clamp(4.5rem, 9vw, 7rem); }
.cx-layout { display: grid; gap: 2.5rem; }
@media (min-width: 1024px) {
  .cx-layout { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(2.5rem, 4vw, 4rem); align-items: start; }
  .cx-aside { position: sticky; top: 6.5rem; }
}

.cx-sheet {
  position: relative;
  overflow: hidden;
  overflow: clip;
  padding: 0.5rem;
  background: var(--dh-paper);
  box-shadow: 0 0 0 1px var(--dh-line-2), 0 40px 80px -50px rgba(20, 57, 57, 0.45);
}
.cx-sheet__in { position: relative; border: 1px solid var(--dh-line-2); }
.cx-sheet__head {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  border-bottom: 1px solid var(--dh-line-2);
  background: var(--dh-teal-50);
}
.cx-sheet__head > div { display: grid; gap: 0.15rem; padding: 0.8rem 1rem; min-width: 0; }
.cx-sheet__head > div + div { border-inline-start: 1px solid var(--dh-line-2); }
.cx-sheet__head span { font-size: 0.7rem; font-weight: 700; color: var(--dh-muted); }
.cx-sheet__head b { font-size: 0.95rem; font-weight: 800; color: var(--dh-teal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-sheet__head b.m { font-family: var(--dh-mono); font-weight: 500; font-size: 0.85rem; color: var(--dh-gold-600); }
@media (max-width: 559px) {
  .cx-sheet__head { grid-template-columns: 1fr 1fr; }
  .cx-sheet__head > div:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--dh-line-2); }
  .cx-sheet__head > div:nth-child(2) { border-inline-start: 0; }
}

/* مواضيع جاهزة */
.cx-topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 1rem;
  border-bottom: 1px solid var(--dh-line-2);
}
.cx-topics > span { margin-inline-end: 0.35rem; font-size: 0.8rem; font-weight: 700; color: var(--dh-muted); }
.cx-topic {
  height: 2.25rem;
  padding-inline: 0.85rem;
  border: 1px solid var(--dh-line-2);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dh-teal);
  background: var(--dh-paper);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.cx-topic:hover { border-color: var(--dh-teal); }
.cx-topic[aria-pressed="true"] { background: var(--dh-teal); border-color: var(--dh-teal); color: #fff; }
.cx-topic:focus-visible { outline: 2px solid var(--dh-gold); outline-offset: 2px; }

/* الخانات */
.cx-cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cx-cell {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.35rem;
  padding: 0.95rem 1rem 0.85rem;
  border-bottom: 1px solid var(--dh-line-2);
  cursor: text;
  transition: background-color 0.3s ease;
}
.cx-cell--full { grid-column: 1 / -1; }
.cx-cell:nth-child(1) { border-inline-end: 1px solid var(--dh-line-2); }
@media (max-width: 559px) {
  .cx-cells { grid-template-columns: 1fr; }
  .cx-cell:nth-child(1) { border-inline-end: 0; }
}
.cx-cell::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  background: var(--dh-gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--dh-ease);
}
.cx-cell:focus-within { background: var(--dh-teal-50); }
.cx-cell:focus-within::after { transform: none; }
.cx-cell__lbl {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--dh-muted);
}
.cx-cell__lbl i { font-style: normal; color: var(--dh-gold-600); }
.cx-cell__lbl small { font-family: var(--dh-mono); font-size: 0.72rem; font-weight: 500; }
.cx-cell input,
.cx-cell textarea {
  width: 100%;
  padding: 0.2rem 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dh-text);
}
.cx-cell input[dir="ltr"] { text-align: left; }
.cx-cell textarea { min-height: 9rem; resize: vertical; line-height: 1.8; }
.cx-cell input::placeholder,
.cx-cell textarea::placeholder { color: rgba(90, 107, 107, 0.55); font-weight: 500; }
.cx-err { min-height: 0; font-size: 0.78rem; font-weight: 600; color: var(--cx-err); }
.cx-err:empty { display: none; }
.cx-cell.is-invalid { background: rgba(180, 68, 47, 0.04); }
.cx-cell.is-invalid::after { transform: none; background: var(--cx-err); }
.cx-cell.is-invalid .cx-cell__lbl { color: var(--cx-err); }

.cx-sheet__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}
.cx-sheet__foot p { font-size: 0.8rem; color: var(--dh-muted); }
.cx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.cx-send { min-width: 13rem; }
.cx-send .cx-spin { display: none; width: 1.2rem; height: 1.2rem; }
.cx-send.is-loading { pointer-events: none; }
.cx-send.is-loading .cx-spin { display: block; animation: cx-rot 0.9s linear infinite; }
.cx-send.is-loading .cx-arrow { display: none; }
.cx-alt { font-size: 0.85rem; font-weight: 700; color: var(--dh-teal); text-decoration: underline; text-decoration-color: var(--dh-gold); text-underline-offset: 4px; }
.cx-alt:focus-visible { outline: 2px solid var(--dh-gold); outline-offset: 3px; }
.cx-status {
  margin: 0 1rem 1rem;
  padding: 0.85rem 1rem;
  border-inline-start: 3px solid var(--dh-gold);
  background: var(--dh-teal-50);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.75;
  color: var(--dh-teal);
}
.cx-status:empty { display: none; }
.cx-status.is-error { border-color: var(--cx-err); color: var(--cx-err); background: rgba(180, 68, 47, 0.06); }
.cx-shake { animation: cx-shake 0.45s ease; }

/* ختم الاستلام */
.cx-stamp {
  position: absolute;
  z-index: 3;
  bottom: 22%;
  left: 6%;
  width: clamp(8.5rem, 22vw, 11rem);
  color: var(--dh-gold-600);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: rotate(-12deg);
}
.cx-sheet.is-stamped .cx-stamp { visibility: visible; }
.cx-stamp svg { direction: ltr; width: 100%; height: auto; overflow: visible; }
.cx-stamp text { font-family: var(--dh-mono); font-size: 9.5px; font-weight: 500; letter-spacing: 1.5px; fill: currentColor; }
.cx-stamp .ar { font-family: Cairo, sans-serif; font-size: 15px; font-weight: 900; letter-spacing: 0; }
.cx-stamp .dt { font-size: 9px; letter-spacing: 1px; }
.cx-sheet.is-stamped .cx-stamp { animation: cx-stamp 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; }
.cx-sheet.is-stamped .cx-sheet__in { animation: cx-thud 0.4s ease 0.32s; }
.cx-sheet.is-stamped .cx-cells,
.cx-sheet.is-stamped .cx-topics { opacity: 0.55; transition: opacity 0.6s ease 0.4s; }

/* ---------- الجانب ---------- */
.cx-aside { display: grid; gap: 1.25rem; }
.cx-box {
  padding: 1.25rem 1.3rem;
  border: 1px solid var(--dh-line-2);
  background: var(--dh-paper);
}
.cx-box h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--dh-teal);
}
.cx-box h3 b { font-family: var(--dh-mono); font-weight: 500; font-size: 0.72rem; color: var(--dh-gold-600); }
.cx-box p { margin-top: 0.6rem; font-size: 0.92rem; line-height: 1.85; color: var(--dh-muted); }
.cx-box .cx-live { margin-top: 0.85rem; color: var(--dh-teal); background: var(--dh-teal-50); border-color: var(--dh-line-2); }
.cx-box .cx-live span { color: var(--dh-muted); }
.cx-hours { display: grid; gap: 0.4rem; margin-top: 0.85rem; font-size: 0.9rem; }
.cx-hours li { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 0.4rem; border-bottom: 1px dashed var(--dh-line-2); }
.cx-hours li:last-child { border-bottom: 0; }
.cx-hours b { font-weight: 700; color: var(--dh-text); }
.cx-hours span { color: var(--dh-muted); }

/* ماذا يحدث بعد الإرسال */
.cx-steps { counter-reset: cxs; display: grid; gap: 0; margin-top: 0.9rem; }
.cx-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.75rem;
  padding-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--dh-muted);
}
.cx-steps li::before {
  counter-increment: cxs;
  content: "0" counter(cxs);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--dh-line-2);
  font-family: var(--dh-mono);
  font-size: 0.72rem;
  color: var(--dh-gold-600);
  background: var(--dh-paper);
}
.cx-steps li::after {
  content: "";
  position: absolute;
  top: 2rem;
  bottom: 0;
  inset-inline-start: calc(1rem - 0.5px);
  width: 1px;
  background: var(--dh-line-2);
}
.cx-steps li:last-child { padding-bottom: 0; }
.cx-steps li:last-child::after { display: none; }
.cx-steps b { display: block; color: var(--dh-teal); font-weight: 800; }

/* =====================================================================
   حركات
   ===================================================================== */
@keyframes cx-ping { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
@keyframes cx-rot { to { transform: rotate(360deg); } }
@keyframes cx-shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}
@keyframes cx-stamp {
  0% { opacity: 0; transform: scale(2.2) rotate(-24deg); }
  60% { opacity: 1; transform: scale(0.92) rotate(-11deg); }
  100% { opacity: 0.92; transform: scale(1) rotate(-12deg); }
}
@keyframes cx-thud { 0%, 100% { transform: none; } 40% { transform: translateY(2px) scale(0.997); } }

@media (prefers-reduced-motion: reduce) {
  .cx-up, .cx-title em, .cx-day__band, .cx-ch::before, .cx-cell::after { transition: none; }
  .cx-up { opacity: 1; transform: none; }
  .cx-title em { background-size: 100% 100%; }
  .cx-day__band { transform: none; }
  .cx-live.is-open i::after, .cx-shake, .cx-sheet.is-stamped .cx-sheet__in { animation: none; }
  .cx-sheet.is-stamped .cx-stamp { animation: none; opacity: 0.92; transform: rotate(-12deg); }
}
