/* ============================================================
   AL QADA TEAM — استمارة العملاء التفاعلية
   الهوية: كحلي ليلي عميق × ذهبي دافئ — فخامة عربية حديثة
   Mobile-first · RTL · خطا Alexandria و IBM Plex Sans Arabic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@500;700;800&family=IBM+Plex+Sans+Arabic:wght@400;500;700&display=swap');

:root {
  --navy: #0d1b2e;
  --navy-2: #14273f;
  --navy-3: #1d3557;
  --gold: #d9a83c;
  --gold-soft: #f0d9a3;
  --paper: #f4f6f9;
  --card: #ffffff;
  --ink: #1c2431;
  --muted: #6b7686;
  --line: #e4e8ee;
  --danger: #c43d3d;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(13, 27, 46, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  background: var(--navy);
  background-image:
    radial-gradient(1200px 500px at 85% -10%, rgba(217, 168, 60, .12), transparent 60%),
    radial-gradient(900px 400px at 0% 110%, rgba(29, 53, 87, .8), transparent 60%);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- الترويسة ---------------- */

.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 34px 20px 10px;
  color: #fff;
  text-align: center;
}

.hero .brand {
  font-family: 'Alexandria', sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 3px;
  color: var(--gold);
}

.hero h1 {
  font-family: 'Alexandria', sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 5.4vw, 34px);
  line-height: 1.5;
  margin-top: 10px;
}

.hero p {
  color: #b9c4d4;
  font-size: 15px;
  margin-top: 8px;
}

/* ---------------- حاوية الاستمارة ---------------- */

.aq-wizard {
  max-width: 720px;
  margin: 22px auto 60px;
  padding: 0 16px;
}

/* مسار الأقسام — التوقيع البصري: عقدة لكل قسم ظاهر فقط */
.aq-path {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.aq-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #93a2b8;
  font-size: 12.5px;
  transition: all .35s ease;
}
.aq-node i { font-style: normal; font-size: 14px; }
.aq-node b { font-weight: 500; }
.aq-node.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
  box-shadow: 0 4px 18px rgba(217, 168, 60, .35);
}
.aq-node.active b { font-weight: 700; }
.aq-node.done {
  background: rgba(217, 168, 60, .16);
  border-color: rgba(217, 168, 60, .4);
  color: var(--gold-soft);
}
.aq-link {
  width: 14px;
  height: 1px;
  background: rgba(255, 255, 255, .18);
}

/* شريط التقدم — نسبته من الأقسام الظاهرة فقط */
.aq-progress {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
  margin-bottom: 20px;
}
.aq-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  border-radius: 99px;
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}

/* ---------------- بطاقة الخطوة ---------------- */

.aq-stage { min-height: 340px; }

.aq-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

@keyframes slideNext { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
@keyframes slidePrev { from { opacity: 0; transform: translateX(26px); }  to { opacity: 1; transform: none; } }
.aq-card.slide-in-next { animation: slideNext .35s ease both; }
.aq-card.slide-in-prev { animation: slidePrev .35s ease both; }

.aq-eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--navy-3);
  background: #eef2f8;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 12px;
}

.aq-title {
  font-family: 'Alexandria', sans-serif;
  font-weight: 700;
  font-size: clamp(19px, 4.6vw, 24px);
  line-height: 1.6;
  color: var(--navy);
}

.aq-subtitle { color: var(--muted); font-size: 14.5px; margin-top: 6px; }

.aq-fields { margin-top: 22px; display: grid; gap: 20px; }

/* ---------------- الحقول ---------------- */

.aq-label {
  display: block;
  font-weight: 500;
  font-size: 14.5px;
  margin-bottom: 8px;
  color: var(--ink);
}

.aq-input {
  width: 100%;
  font-family: inherit;
  font-size: 16px; /* يمنع تكبير iOS التلقائي */
  padding: 13px 15px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.aq-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 168, 60, .18);
}
.aq-input::placeholder { color: #a4aebc; }
.aq-textarea { resize: vertical; min-height: 96px; }
.aq-other { margin-top: 10px; }

/* بطاقات الاختيار السريع */
.aq-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.aq-options.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.aq-option {
  font-family: inherit;
  text-align: right;
  background: #fbfcfe;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  display: grid;
  gap: 3px;
  transition: all .18s ease;
}
.aq-option:hover { border-color: #c9d3e0; transform: translateY(-1px); }
.aq-option:focus-visible { outline: 3px solid rgba(217, 168, 60, .5); outline-offset: 2px; }
.aq-option.selected {
  border-color: var(--gold);
  background: #fdf8ec;
  box-shadow: 0 3px 14px rgba(217, 168, 60, .18);
}
.aq-opt-icon { font-size: 21px; }
.aq-opt-label { font-weight: 700; font-size: 14.5px; color: var(--navy); }
.aq-opt-desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* لوحات الألوان */
.aq-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.aq-palette {
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 13px;
  background: #fbfcfe;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  transition: all .18s ease;
}
.aq-palette i {
  width: 19px; height: 19px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, .08);
  flex-shrink: 0;
}
.aq-palette span { color: var(--ink); }
.aq-palette.selected { border-color: var(--gold); background: #fdf8ec; }
.aq-palette.custom { position: relative; }
.aq-palette.custom input[type=color] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%;
}

/* رفع الملف */
.aq-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 16px;
  border: 2px dashed #c9d3e0;
  border-radius: 12px;
  background: #fbfcfe;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
}
.aq-file:hover { border-color: var(--gold); }
.aq-file.has-file { border-color: var(--gold); background: #fdf8ec; border-style: solid; }
.aq-file-icon { font-size: 24px; color: var(--navy-3); }
.aq-file-text { font-size: 14px; color: var(--muted); }
.aq-file-name { font-size: 13.5px; font-weight: 700; color: var(--navy); }

/* رسالة الخطأ */
.aq-error {
  margin-top: 16px;
  background: #fdeeee;
  color: var(--danger);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
}

/* ---------------- أزرار التنقل ---------------- */

.aq-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.aq-btn {
  font-family: 'Alexandria', sans-serif;
  font-weight: 700;
  font-size: 15px;
  border: 0;
  border-radius: 12px;
  padding: 14px 30px;
  cursor: pointer;
  transition: all .2s ease;
}
.aq-btn.primary {
  background: var(--gold);
  color: var(--navy);
  box-shadow: 0 6px 20px rgba(217, 168, 60, .35);
}
.aq-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 9px 26px rgba(217, 168, 60, .45); }
.aq-btn.primary:disabled { opacity: .6; cursor: wait; transform: none; }
.aq-btn.primary.send { background: linear-gradient(120deg, var(--gold), #e8c46b); }
.aq-btn.ghost {
  background: rgba(255, 255, 255, .08);
  color: #c8d2e0;
  border: 1px solid rgba(255, 255, 255, .18);
}
.aq-btn.ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.aq-btn:focus-visible { outline: 3px solid rgba(217, 168, 60, .5); outline-offset: 2px; }

/* ---------------- شاشة الشكر ---------------- */

.aq-thanks {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 52px 26px;
  text-align: center;
  animation: slideNext .45s ease both;
}
.aq-thanks-mark {
  width: 68px; height: 68px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-size: 30px;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 26px rgba(217, 168, 60, .4);
}
.aq-thanks h2 {
  font-family: 'Alexandria', sans-serif;
  color: var(--navy);
  font-size: 22px;
  margin-bottom: 10px;
}
.aq-thanks p { color: var(--muted); font-size: 15px; line-height: 1.9; }
.aq-thanks-next {
  margin-top: 16px;
  background: #fdf8ec;
  border: 1px solid #f0e2bd;
  border-radius: 10px;
  padding: 13px;
  color: var(--ink) !important;
}

.aq-empty { color: #b9c4d4; text-align: center; padding: 40px; }

/* التذييل */
.footer {
  text-align: center;
  color: #6d7c92;
  font-size: 12.5px;
  padding: 0 16px 30px;
}
.footer b { color: var(--gold); }

/* ---------------- الوصولية والحركة ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 480px) {
  .aq-card { padding: 22px 16px; }
  .aq-node b { display: none; }      /* على الشاشات الصغيرة: أيقونات فقط في المسار */
  .aq-node { padding: 7px 10px; }
  .aq-nav { position: sticky; bottom: 10px; }
  .aq-btn { flex: 1; padding: 14px 18px; }
}
