/* =====================================================================
   هوية مجموعة الزهراء عليها السلام
   خلفية أبيض/رمادي — لمسات أخضر وذهبي
   ===================================================================== */

:root {
  --white: #ffffff;
  --gray-50: #f6f7f8;
  --gray-100: #eef0f2;
  --gray-200: #e4e7eb;
  --gray-300: #d3d8de;
  --gray-400: #aab2bd;
  --gray-500: #717a86;
  --gray-600: #515a66;
  --gray-700: #39414c;
  --ink: #1f2a24;

  --green-900: #0f3d2e;
  --green-700: #15583c;
  --green-600: #1b6b47;
  --green-500: #218856;
  --green-100: #d9ebe1;
  --green-50: #eef6f1;

  --gold-700: #9a7a1c;
  --gold-600: #b8901f;
  --gold-500: #c9a227;
  --gold-400: #d9b84f;
  --gold-300: #e8c766;
  --gold-50: #fbf6e6;

  --danger: #b4452f;
  --danger-bg: #fbecea;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(15, 61, 46, 0.06), 0 1px 3px rgba(15, 61, 46, 0.05);
  --shadow-md: 0 6px 20px rgba(15, 61, 46, 0.08), 0 2px 6px rgba(15, 61, 46, 0.05);
  --shadow-lg: 0 18px 50px rgba(15, 61, 46, 0.14);
  --gold-line: linear-gradient(90deg, var(--gold-300), var(--gold-600), var(--gold-300));
  --green-grad: linear-gradient(135deg, var(--green-700), var(--green-500));

  --font: 'Tajawal', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 100% -10%, var(--green-50), transparent 60%),
    radial-gradient(900px 480px at -10% 0%, var(--gold-50), transparent 55%),
    var(--gray-50);
  background-attachment: fixed;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--green-600); text-decoration: none; }
a:hover { color: var(--green-700); }

/* ------------------------------- Header ------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--gray-200);
}
.site-header::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--gold-line);
  opacity: 0.7;
}
.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  background: var(--green-900);
  flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 800; font-size: 1.04rem; color: var(--green-700); }
.brand-sub { font-size: 0.74rem; color: var(--gray-500); font-weight: 500; }

/* ------------------------------- Layout ------------------------------ */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 22px 18px 64px;
}

.page-intro { text-align: center; margin: 8px 0 22px; }
.page-intro h1 {
  font-size: 1.5rem;
  margin: 0 0 6px;
  color: var(--green-700);
  font-weight: 800;
}
.page-intro p { margin: 0; color: var(--gray-600); font-size: 0.95rem; }

/* ------------------------------- Card -------------------------------- */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 22px;
  margin-bottom: 18px;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.card-head .step-badge {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--green-grad);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
  flex: none;
}
.card-head h2 { margin: 0; font-size: 1.12rem; color: var(--green-700); font-weight: 800; }
.card-head .hint { font-size: 0.8rem; color: var(--gray-500); font-weight: 500; }

/* --------------------------- Step indicator -------------------------- */
.steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.steps .dot {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  font-size: 0.82rem;
  color: var(--gray-500);
  font-weight: 600;
}
.steps .dot b {
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--gray-200); color: var(--gray-600);
  display: grid; place-items: center; font-size: 0.72rem;
}
.steps .dot.active { border-color: var(--green-500); color: var(--green-700); background: var(--green-50); }
.steps .dot.active b { background: var(--green-grad); color: #fff; }
.steps .dot.done b { background: var(--gold-500); color: #fff; }

/* --------------------------- Service picker -------------------------- */
.category {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.category.open { border-color: var(--green-300, #9fcdb4); box-shadow: var(--shadow-sm); }
.category-head {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; text-align: start;
  color: var(--ink);
}
.category-head:hover { background: var(--gray-50); }
.category-icon {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  font-size: 1.25rem;
}
.category-title { flex: 1; }
.category-title .t { font-weight: 800; font-size: 1rem; color: var(--green-700); }
.category-title .c { font-size: 0.78rem; color: var(--gray-500); }
.chevron { color: var(--gray-400); transition: transform 0.25s; font-size: 1.1rem; }
.category.open .chevron { transform: rotate(180deg); color: var(--green-600); }
.category-body { display: none; padding: 4px 12px 14px; }
.category.open .category-body { display: block; }

.service-option {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 12px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: 11px;
  background: var(--white);
  cursor: pointer;
  font-family: inherit; font-size: 0.95rem;
  text-align: start; color: var(--ink);
  margin-top: 8px;
  transition: all 0.16s;
}
.service-option:hover { border-color: var(--green-500); background: var(--green-50); }
.service-option.selected {
  border-color: var(--green-600);
  background: var(--green-50);
  box-shadow: inset 0 0 0 1px var(--green-600);
}
.service-option .radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--gray-300); flex: none;
  display: grid; place-items: center;
}
.service-option.selected .radio { border-color: var(--green-600); }
.service-option.selected .radio::after {
  content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--green-600);
}
.service-option .name { flex: 1; font-weight: 600; }

/* --------------------------- Featured services ----------------------- */
.featured-box {
  border: 1.5px solid var(--gold-400);
  background: linear-gradient(180deg, var(--gold-50), #fff 70%);
  border-radius: var(--radius-sm);
  padding: 12px 12px 14px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.14);
}
.featured-head {
  font-weight: 800;
  color: var(--gold-700);
  font-size: 0.95rem;
  margin: 2px 4px 4px;
}
.service-option.featured {
  border-color: var(--gold-400);
  background: #fff;
}
.service-option.featured:hover { border-color: var(--gold-600); background: var(--gold-50); }
.service-option.featured.selected {
  border-color: var(--gold-600);
  background: var(--gold-50);
  box-shadow: inset 0 0 0 1px var(--gold-600);
}
.service-option.featured.selected .radio { border-color: var(--gold-600); }
.service-option.featured.selected .radio::after { background: var(--gold-600); }
.service-option .fcat {
  display: block; font-size: 0.72rem; font-weight: 500; color: var(--gray-500);
}
.service-option .fstar { font-size: 0.9rem; }

/* ------------------------------- Form -------------------------------- */

/* بطاقة الخدمة المختارة */
.selected-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, var(--green-50), #fff);
  border: 1.5px solid var(--green-100);
  border-inline-start: 4px solid var(--green-600);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
}
.sb-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-label { font-size: 0.72rem; color: var(--gray-500); font-weight: 600; }
.sb-name { font-weight: 800; color: var(--green-700); font-size: 1.02rem; }
.sb-cat { font-size: 0.78rem; color: var(--gold-700); font-weight: 600; }
.sb-change { padding: 8px 16px; flex: none; }

/* أقسام النموذج */
.form-sec {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 15px 15px 7px;
  margin-bottom: 14px;
  background: #fff;
}
.sec-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 0.95rem; color: var(--green-700);
  margin-bottom: 13px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--gray-200);
}
.sec-ic { font-size: 1.05rem; }

.field { margin-bottom: 15px; }
.field > label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--gray-700);
}
.field .req { color: var(--danger); font-weight: 700; }
.field .opt { color: var(--gray-400); font-weight: 500; font-size: 0.8rem; }

input[type="text"], input[type="tel"], input[type="number"], input[type="password"],
input[type="email"], input[type="search"], textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 11px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(33, 136, 86, 0.14);
}
textarea { resize: vertical; min-height: 80px; }
.field .field-hint { font-size: 0.78rem; color: var(--gray-500); margin-top: 5px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

/* segmented (حيّ / متوفى) */
.segmented { display: flex; gap: 8px; }
.segmented label {
  flex: 1; cursor: pointer;
  padding: 11px; text-align: center;
  border: 1.5px solid var(--gray-200);
  border-radius: 11px;
  font-weight: 700; font-size: 0.92rem;
  color: var(--gray-600);
  transition: all 0.15s;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:checked + label {
  border-color: var(--green-600);
  background: var(--green-50);
  color: var(--green-700);
  box-shadow: inset 0 0 0 1px var(--green-600);
}

/* dynamic fields container */
#dynamicFields:empty { display: none; }
.dynamic-note {
  font-size: 0.8rem; color: var(--gold-700);
  background: var(--gold-50);
  border: 1px solid #f0e2b8;
  padding: 8px 12px; border-radius: 10px;
  margin-bottom: 14px;
}

/* ------------------------------ Buttons ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px;
  border-radius: 12px;
  border: none; cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: 1rem;
  transition: transform 0.08s, box-shadow 0.2s, background 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--green-grad); color: #fff;
  box-shadow: 0 6px 16px rgba(27, 107, 71, 0.28);
  width: 100%;
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(27, 107, 71, 0.36); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: #fff;
  box-shadow: 0 6px 16px rgba(184, 144, 31, 0.3);
}
.btn-whatsapp {
  background: #1faf54; color: #fff; width: 100%;
  box-shadow: 0 6px 16px rgba(31, 175, 84, 0.3);
}
.btn-ghost {
  background: var(--white); color: var(--green-700);
  border: 1.5px solid var(--gray-200);
}
.btn-ghost:hover { border-color: var(--green-500); background: var(--green-50); }
.btn-block { width: 100%; }

/* ------------------------------ Alerts ------------------------------- */
.alert { padding: 11px 14px; border-radius: 11px; font-size: 0.9rem; font-weight: 600; margin-bottom: 14px; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #eecac3; }
.alert-info { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-100); }

/* ----------------------------- Success ------------------------------- */
.success-wrap { text-align: center; }
.success-icon {
  width: 72px; height: 72px; margin: 4px auto 14px;
  border-radius: 50%;
  background: var(--green-grad);
  display: grid; place-items: center;
  color: #fff; font-size: 2.1rem;
  box-shadow: 0 10px 26px rgba(27, 107, 71, 0.3);
}
.success-wrap h2 { color: var(--green-700); margin: 0 0 4px; }
.ref-chip {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 14px 0;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--gold-50);
  border: 1.5px dashed var(--gold-500);
  font-weight: 800; font-size: 1.2rem; color: var(--gold-700);
  letter-spacing: 0.5px;
}
.track-link-box {
  display: flex; gap: 8px; margin: 14px 0;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 11px;
  padding: 8px 8px 8px 12px;
  align-items: center;
}
.track-link-box input { border: none; background: none; padding: 8px 4px; font-size: 0.85rem; color: var(--gray-600); }
.track-link-box input:focus { box-shadow: none; }

/* --------------------------- Status timeline ------------------------- */
.summary-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--gray-200);
  border: 1px solid var(--gray-200);
  border-radius: 12px; overflow: hidden;
  margin-bottom: 18px;
}
@media (max-width: 480px){ .summary-grid { grid-template-columns: 1fr; } }
.summary-grid .cell { background: var(--white); padding: 12px 14px; }
.summary-grid .k { font-size: 0.76rem; color: var(--gray-500); font-weight: 600; margin-bottom: 2px; }
.summary-grid .v { font-weight: 700; color: var(--ink); font-size: 0.96rem; }

.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 999px;
  font-weight: 800; font-size: 0.92rem;
}
.status-pill .ic { width: 9px; height: 9px; border-radius: 50%; }
.st-new      { background: #eaf0fb; color: #2b5dad; } .st-new .ic { background: #2b5dad; }
.st-in_progress { background: var(--gold-50); color: var(--gold-700); } .st-in_progress .ic { background: var(--gold-600); }
.st-deferred { background: #f3eefc; color: #6b4aa0; } .st-deferred .ic { background: #6b4aa0; }
.st-completed{ background: var(--green-50); color: var(--green-700); } .st-completed .ic { background: var(--green-600); }
.st-cancelled{ background: var(--danger-bg); color: var(--danger); } .st-cancelled .ic { background: var(--danger); }

.timeline { list-style: none; margin: 8px 0 0; padding: 0; position: relative; }
.timeline::before {
  content: ''; position: absolute;
  inset-inline-start: 13px; top: 6px; bottom: 6px;
  width: 2px; background: var(--gray-200);
}
.timeline li {
  position: relative; padding-inline-start: 38px; padding-bottom: 18px;
  color: var(--gray-500); font-weight: 600;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li .node {
  position: absolute; inset-inline-start: 5px; top: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--gray-300);
}
.timeline li.reached { color: var(--green-700); }
.timeline li.reached .node { border-color: var(--green-600); background: var(--green-600); }
.timeline li.current .node { box-shadow: 0 0 0 4px rgba(33,136,86,0.18); }
.timeline li .when { display: block; font-size: 0.76rem; color: var(--gray-400); font-weight: 500; }
.timeline li.cancel-node .node { border-color: var(--danger); background: var(--danger); }
.timeline li.cancel-node { color: var(--danger); }

.baraka-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding: 13px 16px;
  background: var(--gold-50); border: 1px solid #f0e2b8; border-radius: 12px;
}
.baraka-row .lbl { font-weight: 700; color: var(--gold-700); }

.expiry-note {
  margin-top: 16px; text-align: center;
  font-size: 0.82rem; color: var(--gray-500);
}

/* ------------------------------ Helpers ------------------------------ */
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--gray-500); }
.mt-12 { margin-top: 12px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.4); border-top-color: #fff;
  animation: spin 0.7s linear infinite; display: inline-block;
}
.spinner-lg { width: 34px; height: 34px; border-color: var(--gray-200); border-top-color: var(--green-600); }
@keyframes spin { to { transform: rotate(360deg); } }

.site-footer {
  text-align: center; padding: 26px 18px 34px;
  color: var(--gray-400); font-size: 0.8rem;
}
.site-footer .gold-sep {
  width: 60px; height: 2px; margin: 0 auto 12px;
  background: var(--gold-line); border-radius: 2px;
}
