/* ============================================================
   GoScore Design System — World-Class Arabic RTL Platform
   Font: Tajawal (display) + IBM Plex Sans Arabic (body)
   Aesthetic: Dark luxury with electric accents
   ============================================================ */

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

/* ============================================================ TOKENS */
:root {
  /* Brand */
  --brand: #00D4FF;
  --brand-2: #7B2FFF;
  --brand-gradient: linear-gradient(135deg, #00D4FF 0%, #7B2FFF 100%);
  --brand-glow: 0 0 40px rgba(0,212,255,0.35);

  /* System colors */
  --qudurat: #818CF8;
  --tahsili: #34D399;
  --mawhibah: #FBBF24;
  --license: #F87171;

  /* Dark base */
  --bg-root: #050810;
  --bg-card: #0D1117;
  --bg-card-2: #111827;
  --bg-hover: #1A2235;
  --border: rgba(255,255,255,0.07);
  --border-bright: rgba(0,212,255,0.25);

  /* Text */
  --text: #F1F5F9;
  --text-2: #94A3B8;
  --text-3: #4B5563;

  /* Status */
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --info: #3B82F6;

  /* Layout */
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);

  /* Typography */
  --font-display: 'Tajawal', sans-serif;
  --font-body: 'IBM Plex Sans Arabic', sans-serif;
}

/* ============================================================ RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-root);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); }

/* ============================================================ SCROLLBAR */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-card); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 4px; }

/* ============================================================ TYPOGRAPHY */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 800; }

.display-1 { font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 900; line-height: 1.1; letter-spacing: -0.03em; }
.display-2 { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 800; line-height: 1.15; }
.heading-1 { font-size: 1.75rem; font-weight: 700; }
.heading-2 { font-size: 1.375rem; font-weight: 700; }
.body-lg { font-size: 1.0625rem; line-height: 1.7; }
.body-sm { font-size: 0.875rem; }
.caption { font-size: 0.75rem; color: var(--text-2); }

/* ============================================================ LAYOUT — DASHBOARD */
.app-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 300;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--brand-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: var(--brand-glow);
}
.logo-text { font-family: var(--font-display); font-size: 1.2rem; font-weight: 900; }
.logo-text span { color: var(--brand); }

.sidebar-user {
  padding: 14px 16px;
  margin: 12px 10px;
  background: var(--bg-card-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--brand); }

.sidebar-nav { flex: 1; padding: 8px 10px; }
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 12px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active {
  background: rgba(0,212,255,0.1);
  color: var(--brand);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  right: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--brand);
  border-radius: 3px;
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-item .badge-count {
  margin-right: auto;
  background: var(--brand-2);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}
.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}

/* Main content */
.main-content {
  flex: 1;
  margin-right: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: rgba(5,8,16,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.topbar-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; }
.topbar-sub { font-size: 11px; color: var(--text-2); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-action {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  font-size: 14px;
  transition: var(--transition);
  cursor: pointer;
}
.topbar-action:hover { border-color: var(--brand); color: var(--brand); }

.page-body { flex: 1; padding: 24px; max-width: 1400px; width: 100%; }

/* Sidebar toggle for mobile */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 18px;
  padding: 4px;
}

/* ============================================================ GRID */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ============================================================ CARD */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}
.card-hover:hover { border-color: var(--border-bright); transform: translateY(-2px); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text); }
.card-glass {
  background: rgba(13,17,23,0.7);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* ============================================================ STAT CARDS */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100%; height: 2px;
  background: var(--stat-color, var(--brand));
}
.stat-card:hover { border-color: rgba(255,255,255,0.12); transform: translateY(-2px); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(var(--stat-rgb, 0,212,255), 0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  color: var(--stat-color, var(--brand));
}
.stat-value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.stat-change { font-size: 11px; color: var(--success); margin-top: 2px; }

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font-body);
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 6px;
}

.btn-primary {
  background: var(--brand-gradient);
  color: #050810;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0,212,255,0.25);
}
.btn-primary:hover { box-shadow: 0 6px 30px rgba(0,212,255,0.45); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-card-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-bright); color: var(--brand); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--bg-hover); }

.btn-danger { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.25); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-success { background: rgba(16,185,129,0.15); color: var(--success); border: 1px solid rgba(16,185,129,0.25); }
.btn-success:hover { background: var(--success); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 14px 32px; font-size: 15px; border-radius: var(--radius); }
.btn-block { width: 100%; }

.btn-icon { padding: 8px; border-radius: 8px; }

/* ============================================================ FORMS */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.required { color: var(--danger); }

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
  font-family: var(--font-body);
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,212,255,0.1); }
.form-control::placeholder { color: var(--text-3); }
.form-control-icon { position: relative; }
.form-control-icon .icon { position: absolute; top: 50%; transform: translateY(-50%); right: 13px; color: var(--text-3); font-size: 14px; pointer-events: none; }
.form-control-icon input, .form-control-icon select { padding-right: 38px; }
.form-control-icon .icon-left { left: 13px; right: auto; }
.form-control-icon input.has-left { padding-right: 14px; padding-left: 38px; }

textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control option { background: var(--bg-card-2); }

.form-error { font-size: 11px; color: var(--danger); margin-top: 4px; display: none; }
.form-error.show { display: block; }
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-valid { border-color: var(--success); }

/* ============================================================ BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-primary { background: rgba(0,212,255,0.12); color: var(--brand); }
.badge-success { background: rgba(16,185,129,0.12); color: var(--success); }
.badge-danger { background: rgba(239,68,68,0.12); color: var(--danger); }
.badge-warning { background: rgba(245,158,11,0.12); color: var(--warning); }
.badge-info { background: rgba(59,130,246,0.12); color: var(--info); }
.badge-secondary { background: var(--bg-hover); color: var(--text-2); }
.badge-qudurat { background: rgba(129,140,248,0.12); color: var(--qudurat); }
.badge-tahsili { background: rgba(52,211,153,0.12); color: var(--tahsili); }
.badge-mawhibah { background: rgba(251,191,36,0.12); color: var(--mawhibah); }
.badge-license { background: rgba(248,113,113,0.12); color: var(--license); }

/* ============================================================ TABLE */
.table-wrapper { overflow-x: auto; }
table.gs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.gs-table thead th {
  padding: 10px 14px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
table.gs-table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.gs-table tbody tr:hover { background: var(--bg-hover); }
table.gs-table tbody tr:last-child td { border-bottom: none; }

/* ============================================================ MODAL */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-header {
  padding: 20px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: none;
  color: var(--text-2);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.modal-close:hover { background: var(--danger); color: #fff; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
}

/* ============================================================ ALERTS */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
}
.alert i { margin-top: 1px; flex-shrink: 0; font-size: 15px; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); color: #6EE7B7; }
.alert-danger { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #FCA5A5; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25); color: #FCD34D; }
.alert-info { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.25); color: #93C5FD; }

/* ============================================================ TOAST */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  min-width: 240px;
  max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideUp 0.3s ease;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.info { border-color: var(--brand); }
.toast i { font-size: 15px; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.info i { color: var(--brand); }

/* ============================================================ AVATAR */
.avatar {
  border-radius: 50%;
  background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-family: var(--font-display);
  color: #050810;
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-md { width: 40px; height: 40px; font-size: 15px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 80px; height: 80px; font-size: 28px; }

/* ============================================================ EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
}
.empty-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.empty-text { font-size: 13px; color: var(--text-2); margin-bottom: 20px; }

/* ============================================================ DROPDOWN */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 180px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 500;
  display: none;
  overflow: hidden;
}
.dropdown-menu.open { display: block; animation: fadeIn 0.15s ease; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text); }
.dropdown-item.danger:hover { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); }

/* ============================================================ PROGRESS */
.progress-bar {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 6px;
  background: var(--brand-gradient);
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.progress-fill.success { background: var(--success); }
.progress-fill.danger { background: var(--danger); }
.progress-fill.warning { background: var(--warning); }

/* ============================================================ PAGINATION */
.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn {
  min-width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.page-btn:hover { border-color: var(--brand); color: var(--brand); }
.page-btn.active { background: var(--brand-gradient); color: #050810; font-weight: 700; border-color: transparent; }

/* ============================================================ CHART CONTAINER */
.chart-wrap { position: relative; height: 220px; }

/* ============================================================ EXAM CARDS */
.exam-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.exam-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--sys-color, var(--brand));
}
.exam-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

/* ============================================================ SCORE CIRCLE */
.score-circle {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: conic-gradient(var(--score-color, var(--brand)) var(--score-deg, 0deg), var(--bg-hover) 0deg);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.score-circle::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--bg-card);
}
.score-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}
.score-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 900; }
.score-label { font-size: 10px; color: var(--text-2); }

/* ============================================================ QUESTION UI */
.question-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.question-number { font-size: 11px; color: var(--text-2); margin-bottom: 8px; }
.question-text { font-size: 16px; font-weight: 600; line-height: 1.7; margin-bottom: 20px; }
.answer-grid { display: grid; gap: 10px; }
.answer-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}
.answer-option:hover { border-color: var(--brand); background: rgba(0,212,255,0.05); }
.answer-option.selected { border-color: var(--brand); background: rgba(0,212,255,0.08); color: var(--brand); }
.answer-option.correct { border-color: var(--success); background: rgba(16,185,129,0.08); color: var(--success); }
.answer-option.wrong { border-color: var(--danger); background: rgba(239,68,68,0.08); color: var(--danger); }
.answer-letter {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}

/* Exam timer */
.exam-timer {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.exam-timer.warning { color: var(--warning); animation: pulse 1s ease infinite; }
.exam-timer.danger { color: var(--danger); animation: pulse 0.5s ease infinite; }

/* Q nav */
.q-nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px,1fr)); gap: 6px; }
.q-nav-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.q-nav-btn:hover { border-color: var(--brand); color: var(--brand); }
.q-nav-btn.answered { background: rgba(0,212,255,0.12); border-color: var(--brand); color: var(--brand); }
.q-nav-btn.active { background: var(--brand-gradient); color: #050810; font-weight: 700; border-color: transparent; }

/* ============================================================ LANDING PAGE */
.landing-body { background: var(--bg-root); }
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  height: 70px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(5,8,16,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--bg-hover); }
.nav-link.active { color: var(--brand); }
.nav-cta { display: flex; gap: 8px; }

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 5% 80px;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0,212,255,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(123,47,255,0.1) 0%, transparent 60%);
}
.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 80%);
  opacity: 0.4;
}
.hero-content { position: relative; z-index: 1; max-width: 780px; }
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(0,212,255,0.08);
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 24px;
}
.hero-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: pulse 2s ease infinite; }
.hero-title { margin-bottom: 20px; }
.hero-title .line-1 { display: block; color: var(--text-2); font-size: 0.6em; font-weight: 400; margin-bottom: 8px; font-family: var(--font-body); }
.gradient-text { background: var(--brand-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-desc { font-size: 1.1rem; color: var(--text-2); line-height: 1.7; margin-bottom: 36px; max-width: 580px; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; justify-content: center; margin-top: 64px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat-num { font-family: var(--font-display); font-size: 2rem; font-weight: 900; background: var(--brand-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-stat-label { font-size: 12px; color: var(--text-2); }

/* Section */
.section { padding: 80px 5%; }
.section-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--brand); margin-bottom: 12px; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; margin-bottom: 14px; }
.section-desc { font-size: 1rem; color: var(--text-2); line-height: 1.7; max-width: 560px; }

/* Feature cards */
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: var(--transition);
}
.feature-card:hover { border-color: var(--border-bright); transform: translateY(-3px); }
.feature-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: rgba(0,212,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}
.feature-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.feature-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.6; }

/* Pricing */
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: var(--transition);
  position: relative;
}
.pricing-card.popular {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), var(--brand-glow);
}
.pricing-badge {
  position: absolute;
  top: -14px;
  right: 50%;
  transform: translateX(50%);
  background: var(--brand-gradient);
  color: #050810;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 16px;
  border-radius: 20px;
}
.pricing-price { font-family: var(--font-display); }
.pricing-price .amount { font-size: 2.5rem; font-weight: 900; }
.pricing-price .currency { font-size: 1rem; color: var(--text-2); }
.pricing-price .period { font-size: 0.875rem; color: var(--text-2); }
.pricing-features { list-style: none; margin: 20px 0; display: grid; gap: 10px; }
.pricing-features li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.pricing-features li i { color: var(--success); font-size: 13px; flex-shrink: 0; }

/* System cards */
.sys-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.sys-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--sys-color);
}
.sys-card:hover { border-color: var(--sys-color); transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
.sys-icon { font-size: 40px; margin-bottom: 12px; display: block; }
.sys-name { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.sys-desc { font-size: 13px; color: var(--text-2); line-height: 1.6; }

/* Testimonials */
.testi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.testi-stars { color: var(--mawhibah); font-size: 13px; margin-bottom: 12px; }
.testi-text { font-size: 14px; color: var(--text-2); line-height: 1.7; margin-bottom: 16px; font-style: italic; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  gap: 12px;
}
.faq-q i { color: var(--brand); flex-shrink: 0; transition: transform 0.3s; }
.faq-item.open .faq-q i { transform: rotate(180deg); }
.faq-a { font-size: 13.5px; color: var(--text-2); line-height: 1.7; padding-bottom: 18px; display: none; }
.faq-item.open .faq-a { display: block; }

/* Contact form */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.contact-info-item { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.contact-info-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(0,212,255,0.1);
  border: 1px solid var(--border-bright);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--brand);
  flex-shrink: 0;
}
.contact-info-label { font-size: 11px; font-weight: 700; color: var(--text-2); margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.05em; }
.contact-info-value { font-size: 14px; font-weight: 600; }

/* Footer */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 48px 5% 24px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand p { font-size: 13.5px; color: var(--text-2); line-height: 1.7; margin-top: 12px; max-width: 280px; }
.footer-col h4 { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); margin-bottom: 14px; }
.footer-col a { display: block; font-size: 13.5px; color: var(--text-2); margin-bottom: 8px; transition: var(--transition); }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 24px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); }
.social-links { display: flex; gap: 8px; }
.social-link {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-2);
  transition: var(--transition);
}
.social-link:hover { border-color: var(--brand); color: var(--brand); }

/* ============================================================ AUTH PAGE */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-root);
}
.auth-visual {
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  position: relative;
  overflow: hidden;
}
.auth-visual-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(0,212,255,0.08) 0%, transparent 70%);
}
.auth-form-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
}
.auth-box { width: 100%; max-width: 420px; }
.auth-logo { margin-bottom: 32px; }
.auth-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.auth-subtitle { font-size: 13.5px; color: var(--text-2); margin-bottom: 28px; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 12px;
  color: var(--text-3);
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-footer-link { text-align: center; font-size: 13px; color: var(--text-2); margin-top: 20px; }
.auth-footer-link a { color: var(--brand); font-weight: 600; }

/* ============================================================ LANDING PAGE TABS */
.tab-list { display: flex; gap: 4px; background: var(--bg-card-2); border-radius: var(--radius-sm); padding: 4px; border: 1px solid var(--border); width: fit-content; }
.tab-btn {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.tab-btn.active { background: var(--brand-gradient); color: #050810; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================ ANIMATIONS */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes slideUp { from{transform:translateY(16px);opacity:0} to{transform:translateY(0);opacity:1} }
@keyframes modalIn { from{transform:scale(0.92) translateY(16px);opacity:0} to{transform:scale(1) translateY(0);opacity:1} }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
@keyframes gradientShift { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
@keyframes reveal { from{opacity:0;transform:translateY(24px)} to{opacity:1;transform:translateY(0)} }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Stagger */
.stagger > * { animation: reveal 0.6s ease both; }
.stagger > *:nth-child(1){animation-delay:.05s}
.stagger > *:nth-child(2){animation-delay:.1s}
.stagger > *:nth-child(3){animation-delay:.15s}
.stagger > *:nth-child(4){animation-delay:.2s}
.stagger > *:nth-child(5){animation-delay:.25s}
.stagger > *:nth-child(6){animation-delay:.3s}

/* ============================================================ UTILITIES */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-full { width: 100%; }
.relative { position: relative; }
.hidden { display: none !important; }

/* ============================================================ RESPONSIVE */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); box-shadow: -20px 0 60px rgba(0,0,0,0.5); }
  .main-content { margin-right: 0; }
  .sidebar-toggle { display: block; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .landing-nav .nav-links { display: none; }
  .hero-stats { gap: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero { padding: 100px 5% 60px; }
  .section { padding: 60px 5%; }
  .hero-actions { flex-direction: column; align-items: center; }
  .grid-4 { grid-template-columns: 1fr; }
  .page-body { padding: 16px; }
  .topbar { padding: 0 16px; }
}

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 299;
}
.sidebar-overlay.open { display: block; }
