/* نظام تصميم مطابق لتطبيق sndk.app — نفس ألوان lib/utils/theme.dart
   (MedicalColors) ونفس السلّم النصّي، منقولاً حرفياً إلى متغيرات CSS. */

:root {
  --primary: #0A7B93; /* نفس تعديل التباين في ColorScheme.light.primary */
  --primary-brand: #0B829B;
  --primary-dark: #0A6E82;
  --secondary-teal: #0FA3BD;
  --accent-purple: #667EEA;
  --success: #56AB2F;
  --warning: #FF9500;
  --error: #C62828;
  --error-soft: #FF6B6B;
  --info: #17A2B8;

  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #FAFBFC;
  --text: #1A202C;
  /* كان #718096 (نسبة تباين 4.02:1 على أبيض — أقلّ من ٤٫٥:١ التي يشترطها
     WCAG AA للنص العادي). نفس عائلة اللون الرمادي المائل للأزرق، أغمق
     بمقدار يكفي فقط (نسبة 5.4:1) — لا رمادياً محايداً يفقد الهوية اللونية. */
  --text-muted: #5D6B82;
  --border: #E2E8F0;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 10px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(to bottom, #FFFFFF, #F8FAFC);
  min-height: 100%;
}

body {
  font-family: 'Cairo', 'Tajawal', -apple-system, 'Segoe UI', Tahoma, sans-serif;
  color: var(--text);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

/* ─────────────────────────── شريط علوي ─────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

/* شبكة بثلاثة أعمدة لا صفٌّ مرن: العمود الأول (بداية السطر — اليمين في
   RTL) لزرّ الدرج، الأوسط للشعار مُمركَزاً حقيقةً بصرف النظر عن عرض ما
   يجاوره، والثالث (اليسار) لأزرار الحساب. عمودا الطرفين `1fr` متساويان
   فيبقى الأوسط في المنتصف دائماً حتى لو اختلف عرض محتوى الطرفين. */
.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 16px;
  color: var(--primary);
  justify-self: center;
}
.brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.topbar-actions { display: flex; gap: 8px; justify-self: end; }
.nav-toggle-btn { justify-self: start; }

/* ─────────────────────────── بطاقات زجاجية ─────────────────────────── */

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(226, 232, 240, 0.6);
}

.card-pad { padding: 20px; }

/* ─────────────────────────── أزرار ─────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-filled {
  background: var(--primary);
  color: #fff;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--primary);
}
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ─────────────────────────── شرائح معلومات ─────────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* ─────────────────────────── تبويبات ─────────────────────────── */

.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 4px;
  box-shadow: var(--shadow);
  margin: 0 16px 16px;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  background: transparent;
  border: none;
}
.tab.active { background: var(--primary); color: #fff; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─────────────────────────── نصوص وحالات ─────────────────────────── */

h1, h2, h3 { margin: 0; }
.title-lg { font-size: 20px; font-weight: 800; }
.title-md { font-size: 16px; font-weight: 700; }
.text-muted { color: var(--text-muted); font-size: 13px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  margin: 20px 0 12px;
}
.section-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 123, 147, 0.12);
  color: var(--primary);
}

.state-box {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}
.state-box svg { opacity: 0.5; margin-bottom: 12px; }

.skeleton {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, #EEF1F5 25%, #E4E9EF 37%, #EEF1F5 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  height: 84px;
  margin-bottom: 12px;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
}
.banner-warn { background: rgba(255, 149, 0, 0.12); color: #8a5200; }
.banner-error { background: rgba(198, 40, 40, 0.10); color: var(--error); }
.banner-info { background: rgba(23, 162, 184, 0.10); color: #0d6f7d; }

/* ─────────────────────────── مودال ─────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-sheet {
  background: var(--surface);
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 20px 20px 28px;
  animation: slideUp 0.2s ease;
}
@media (min-width: 560px) {
  .modal-overlay { align-items: center; }
  .modal-sheet { border-radius: 20px; max-height: 84vh; }
}
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.field {
  display: block;
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 15px;
  margin-bottom: 12px;
  font-family: inherit;
  color: var(--text);
}
.field:focus { outline: none; border-color: var(--primary); }
label.field-label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; display: block; }

/* ─────────────────────────── تقويم الحجز ─────────────────────────── */

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 12px 0;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
}
.cal-day.blocked { color: #C7CDD6; background: #F3F4F6; cursor: not-allowed; }
.cal-day.selected { background: var(--primary); color: #fff; }
.cal-day.today { border-color: var(--primary); }
.cal-day.empty { visibility: hidden; }

/* ─────────────────────────── متفرقات ─────────────────────────── */

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(15, 163, 189, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary-teal);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.row { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-dark {
  border: 2px solid rgba(10,123,147,0.25);
  border-top-color: var(--primary);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────────── الصفحة التعريفية ─────────────────────────── */

.hero {
  text-align: center;
  padding: 56px 16px 24px;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 20px 0;
}
@media (min-width: 560px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: start;
}
.feature-card .section-icon { flex-shrink: 0; }
.feature-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.feature-card p { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin: 0; }

.cta-band {
  background: linear-gradient(135deg, var(--primary-brand), var(--secondary-teal));
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.cta-band p { color: rgba(255,255,255,0.9); font-size: 13px; margin: 6px 0 16px; }
.cta-band .btn-filled { background: #fff; color: var(--primary); }

footer.site-footer {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 12px;
}
