:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #1565d8;
  --primary-2: #0f9f77;
  --accent: #f59e0b;
  --danger: #d92d20;
  --shadow: 0 18px 45px rgba(23, 32, 51, .10);
  --soft-shadow: 0 12px 30px rgba(23, 32, 51, .07);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Tajawal", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}
body::selection { background: rgba(21,101,216,.18); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }
img { max-width: 100%; display: block; }

.app-shell { min-height: 100vh; padding-top: 70px; padding-bottom: 90px; }
.welcome {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(21,101,216,.10), rgba(15,159,119,.08)),
    radial-gradient(circle at 20% 20%, rgba(245,158,11,.14), transparent 28%),
    var(--bg);
}
.welcome-panel {
  width: min(520px, 100%);
  text-align: center;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(255,255,255,.75);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.pop { animation: popIn .42s ease both; }
.brand-logo {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 12px 24px rgba(21,101,216,.18);
}
.welcome h1 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 42px); }
.welcome p { margin: 0 auto 24px; color: var(--muted); line-height: 1.8; }

.actions { display: grid; gap: 12px; }
.btn {
  min-height: 46px;
  padding: 11px 16px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--soft-shadow); }
.btn.primary { background: var(--primary); color: white; }
.btn.green { background: var(--primary-2); color: white; }
.btn.turquoise { background: #0ea5e9; color: white; }
.btn.light { background: white; color: var(--primary); border: 1px solid #b9d4ff; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.warn { background: #fff7ed; color: #9a4b00; border: 1px solid #fed7aa; }
.btn.danger { background: #fff1f0; color: var(--danger); border: 1px solid #fecdca; }
.btn.danger.solid { background: var(--danger); color: white; border-color: var(--danger); }
.btn.icon { width: 44px; height: 44px; padding: 0; font-size: 20px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.topbar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: min(1160px, calc(100% - 28px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px clamp(16px, 3vw, 28px);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.72), rgba(240,246,255,.52));
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: 0 18px 45px rgba(23,32,51,.08), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(24px) saturate(160%);
}
.topbrand { display: flex; align-items: center; gap: 10px; font-weight: 900; }
.topbrand img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.desktop-nav { display: flex; gap: 8px; align-items: center; }
.desktop-nav .nav-btn { background: transparent; color: var(--muted); padding: 10px 12px; border-radius: var(--radius); }
.desktop-nav .nav-btn.active { color: var(--primary); background: #eaf2ff; font-weight: 800; }

.page {
  width: min(1160px, calc(100% - 32px));
  margin: 14px auto;
}
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(23, 32, 51, .05);
}
.panel { padding: 18px; }
.lift { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.lift:hover { transform: translateY(-3px); box-shadow: var(--soft-shadow); border-color: #c8d8f2; }
.fade-in { animation: fadeIn .28s ease both; }
.hero-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #ffffff, #eef6ff);
  padding: 12px 16px;
}
.section-title { margin: 0; font-size: 18px; }
.hero-strip .muted { margin: 4px 0 0; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hide { display: none !important; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; text-align: right; }
.field label { font-weight: 800; color: #344054; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: white;
  padding: 12px 13px;
  outline: none;
  color: var(--ink);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21,101,216,.12);
}
.checkbox, .radio-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: white;
}
.radio-card { min-height: 76px; }
.radio-card.selected {
  border-color: #8bbcff;
  background: #eaf2ff;
  color: var(--primary);
  font-weight: 900;
}
.role-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.role-card {
  display: grid;
  gap: 6px;
  padding: 24px 16px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: var(--soft-shadow);
  direction: ltr;
}
.role-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(21,101,216,.12);
}
.role-card:active { transform: translateY(0); }
.role-icon { font-size: 40px; display: block; }
.role-title { font-size: 20px; font-weight: 900; color: var(--ink); display: block; }
.role-desc { font-size: 13px; color: var(--muted); display: block; line-height: 1.4; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.step {
  height: 8px;
  background: #d9dee8;
  border-radius: 999px;
}
.step.done { background: var(--primary); }
.step.current { background: var(--accent); }

.searchbar {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.chip {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  color: var(--muted);
}
.chip.active { background: #eaf2ff; color: var(--primary); border-color: #b9d4ff; font-weight: 800; }

.pro-card { padding: 14px; display: grid; gap: 12px; }
.pro-head { display: flex; gap: 12px; align-items: center; }
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #eaf2ff;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 900;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #ecfdf3;
  color: #047857;
  font-weight: 800;
}
.badge-warn { background: #fff7ed; color: #9a4b00; }
.field-hint { font-size: 12px; color: var(--muted); margin: -6px 0 10px; line-height: 1.5; }
.diploma-section { padding: 10px; background: #f0f4ff; border-radius: var(--radius); display: grid; gap: 8px; }
.diploma-section .field-hint { margin: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; align-items: center; }
.stars-display { color: #f59e0b; font-size: 15px; direction: ltr; }
.recommended-badge { background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 800; padding: 2px 10px; border-radius: 999px; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.request-card {
  display: grid;
  gap: 12px;
}
.request-card .field textarea {
  min-height: 96px;
}
.offline-banner {
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  background: #fff7ed;
  color: #9a4b00;
  padding: 12px 14px;
  font-weight: 800;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.avatar.big {
  width: 76px;
  height: 76px;
  font-size: 30px;
}
.info-list {
  display: grid;
  gap: 9px;
}
.info-list p {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.info-list span {
  color: var(--muted);
  font-weight: 800;
}
.settings-card { align-content: start; }
.danger-zone {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.actions.inline { grid-template-columns: 1fr 1fr; }

.badge-verified { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; background: #ecfdf3; color: #067647; }
.badge-pending { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; background: #eff6ff; color: #175cd3; }
.badge-worker { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; background: #f9f5ff; color: #6941c6; }

.modal-overlay {
  position: fixed; z-index: 100; inset: 0;
  display: grid; place-items: center;
  background: rgba(23,32,51,.48);
  backdrop-filter: blur(4px);
  animation: fadeIn .2s ease both;
}
.modal-overlay.hide { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,.2);
  width: min(520px, 100%);
  max-height: 80vh;
  overflow-y: auto;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 16px 20px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); }
.field-group { display: grid; gap: 10px; }
.field-group .field { display: grid; grid-template-columns: 130px 1fr; gap: 8px; align-items: center; }
.field-group .field label { font-weight: 700; color: var(--muted); font-size: 13px; }
.field-group .field span { font-weight: 500; }
.field-group .field a { color: var(--primary); }
.gallery-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.gallery-label { font-weight: 700; color: var(--muted); font-size: 13px; display: block; margin-bottom: 8px; }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; transition: border-color .15s ease, transform .15s ease; }
.gallery-thumb:hover { border-color: var(--primary); transform: scale(1.05); }
.gallery-overlay {
  position: fixed; z-index: 200; inset: 0;
  background: rgba(0,0,0,.88);
  display: grid;
  place-items: center;
  animation: fadeIn .2s ease both;
}
.gallery-image-wrap { display: grid; place-items: center; width: 90vw; height: 85vh; }
.gallery-image { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.gallery-close {
  position: absolute; top: 16px; left: 16px;
  width: 44px; height: 44px;
  background: rgba(255,255,255,.15); color: #fff;
  border: 0; border-radius: 50%;
  font-size: 22px; cursor: pointer;
  display: grid; place-items: center;
  z-index: 10;
  transition: background .15s ease;
}
.gallery-close:hover { background: rgba(255,255,255,.3); }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  background: rgba(255,255,255,.15); color: #fff;
  border: 0; border-radius: 50%;
  font-size: 30px; cursor: pointer;
  display: grid; place-items: center;
  z-index: 10;
  transition: background .15s ease;
}
.gallery-nav:hover { background: rgba(255,255,255,.3); }
.gallery-prev { left: 16px; }
.gallery-next { right: 16px; }
.gallery-counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.6); font-size: 14px;
  direction: ltr;
}
.modal-card {
  width: min(460px, calc(100% - 32px));
  padding: 28px 24px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 12px;
  box-shadow: 0 24px 56px rgba(23,32,51,.18);
  display: grid;
  gap: 14px;
  text-align: center;
}
.modal-card h3 { margin: 0; font-size: 22px; }
.modal-card p { margin: 0; line-height: 1.8; color: var(--muted); }
.whatsapp-number {
  font-size: 28px;
  font-weight: 900;
  color: #075e54;
  background: #e8f5e9;
  padding: 14px;
  border-radius: 12px;
  direction: ltr;
  letter-spacing: 1px;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  left: 0;
  bottom: 12px;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  width: min(480px, calc(100% - 24px));
  margin: 0 auto;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.9);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 8px 32px rgba(23,32,51,.12);
  border-radius: 18px;
  padding: 6px 4px;
}
.bottom-nav button {
  min-width: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 14px;
  padding: 8px 4px;
  display: grid;
  gap: 2px;
  place-items: center;
  font-size: 11px;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.bottom-nav button .ico { font-size: 20px; line-height: 1; }
.bottom-nav button.active { color: var(--primary); background: rgba(21,101,216,.10); font-weight: 800; }
.bottom-nav button:hover { transform: translateY(-2px); }
.home-special {
  transform: translateY(-6px);
  background: var(--primary) !important;
  color: white !important;
  box-shadow: 0 8px 20px rgba(21,101,216,.28);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  padding: 0;
  margin-top: -8px;
}

/* Language Switcher */
.lang-switcher {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 50;
  direction: ltr;
}
.lang-current {
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  border-radius: 10px;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  overflow: hidden;
  min-width: 120px;
}
.lang-dropdown.show { display: block; }
.lang-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: transparent;
  border: none;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: background .12s ease;
}
.lang-dropdown button:hover { background: #f0f4ff; }

/* Language options in settings */
.lang-options { display: flex; gap: 8px; flex-wrap: wrap; }
.section-subtitle {
  margin: 16px 0 10px;
  font-size: 16px;
  color: var(--muted);
  font-weight: 700;
}

.toast {
  position: fixed;
  z-index: 60;
  left: 16px;
  bottom: 92px;
  max-width: min(390px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #101828;
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

.empty {
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,.55);
}

/* verified/traditional badges */
.verified-badge { display: inline-block; background: #ecfdf3; color: #047857; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; margin-right: 6px; vertical-align: middle; }
.trad-badge { display: inline-block; background: #f1f5f9; color: #475569; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; margin-right: 6px; vertical-align: middle; }

/* city + job tags in pro card */
.meta-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.job-tag { background: #e0f2fe; color: #075985; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.city-tag { background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }

/* collapsible filter */
.filter-toggle { display: block; width: 100%; padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-weight: 700; color: var(--ink); text-align: center; cursor: pointer; transition: .2s; box-shadow: var(--soft-shadow); }
.filter-toggle:hover { background: #f0f2f7; }
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-bar .field { flex: 1; min-width: 140px; }
.filter-bar select, .filter-bar input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.filter-bar .btn.ghost { flex: 0 0 auto; padding: 8px 12px; }

/* blocked screen */
.blocked-screen { min-height: 100vh; display: grid; place-items: center; background: #fff; padding: 24px; }
.blocked-card { max-width: 420px; text-align: center; }
.blocked-icon { font-size: 64px; display: block; margin-bottom: 12px; }
.blocked-card h1 { font-size: 24px; margin: 0 0 12px; color: var(--danger); }
.blocked-card p { color: var(--muted); line-height: 1.6; }

@media (max-width: 820px) {
  .desktop-nav { display: none; }
  .bottom-nav { display: grid; }
  .topbar { padding: 10px 14px; width: calc(100% - 18px); top: 8px; border-radius: 14px; }
  .page { width: calc(100% - 24px); margin-top: 10px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .searchbar { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: 1fr; max-width: 320px; margin: 0 auto; }
  .card-actions { grid-template-columns: 1fr; }
  .danger-zone, .actions.inline { grid-template-columns: 1fr; }
  .welcome-panel { padding: 22px; }
  .lang-switcher { top: 12px; left: 12px; }
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
