/* Al Mawarid — site styles
 *
 * Color tokens derived from the Al Mawarid logo:
 *   - Gold (icon)        : #E8B73D and its tints
 *   - Cool charcoal-grey : the warm grey used for "Al Mawarid" + Arabic text
 *   - Lighter grey       : the softer grey of "manpower" sub-line
 * No pure black anywhere — keeps the brand visually cohesive.
 */
:root {
  --gold:        #E8B73D;
  --gold-soft:   #F4D87C;
  --gold-light:  #FBF3DC;
  --gold-deep:   #8A6A14;
  --cream:       #FDF8E9;
  --ink:         #2C3138;   /* main text — softer than pure black, matches logo */
  --ink-soft:    #6E747B;   /* secondary text — matches logo's "manpower"/Arabic grey */
  --muted:       #9DA1A6;   /* tertiary/hint — matches the lightest logo grey */
  --line:        #E5E7EB;
  --line-soft:   #F3F4F6;
  --bg:          #FFFFFF;
  --shadow-sm:   0 2px 8px rgba(20,20,20,.04);
  --shadow-md:   0 8px 24px rgba(20,20,20,.06);
  --shadow-lg:   0 18px 48px rgba(20,20,20,.10);
  --radius:      14px;
  --radius-lg:   22px;
}

/* The HTML5 `hidden` attribute should always hide. Several of our own rules
 * (`.field { display: flex }`, `.modal[aria-hidden="false"] { display: flex }`,
 * etc.) have higher specificity than the user-agent default `[hidden] { display: none }`
 * and would otherwise leak. !important reasserts the spec. */
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
}
body.rtl { font-family: 'Tajawal', 'Poppins', sans-serif; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ===================== TOPBAR ===================== */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-logo { display: block; width: auto; }
.brand-text { line-height: 1.1; }
.brand-ar  { font-weight: 700; font-size: 18px; color: var(--ink); font-family: 'Tajawal', sans-serif; }
.brand-en  { font-weight: 600; font-size: 13px; color: var(--gold-deep); letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: var(--muted); text-transform: lowercase; letter-spacing: .5px; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav a:hover { color: var(--ink); }
.nav a.is-active { color: var(--ink); border-bottom-color: var(--gold); }

/* Lang dropdown */
.lang { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; color: var(--ink);
  transition: border-color .15s;
}
.lang-btn:hover { border-color: var(--gold); }
.lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  margin: 0; list-style: none;
  box-shadow: var(--shadow-md);
  min-width: 170px;
  opacity: 0; transform: translateY(-4px) scale(.98); pointer-events: none;
  transition: opacity .12s, transform .12s;
}
.rtl .lang-menu { right: auto; left: 0; }
.lang.is-open .lang-menu { opacity: 1; transform: none; pointer-events: auto; }
.lang-menu a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: 8px;
  color: var(--ink-soft); text-decoration: none; font-size: 14px;
}
.lang-menu a:hover { background: var(--gold-light); color: var(--ink); }
.lang-menu a.is-active { color: var(--gold-deep); background: var(--gold-light); }
.lang-code-sm { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ===================== HERO ===================== */
.hero {
  background: linear-gradient(180deg, var(--cream) 0%, #fff 100%);
  padding: 80px 0 100px;
  text-align: center;
}
.hero-title {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  margin: 0 0 22px;
  line-height: 1.15;
  letter-spacing: -.5px;
  color: var(--ink);
}
.hero-title-gold { color: var(--gold); }
.hero-sub {
  font-size: clamp(15px, 1.4vw, 17px);
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto 40px;
}
.hero-cta {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 26px;
  border-radius: 999px;
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1.5px solid transparent;
  transition: transform .12s, box-shadow .18s, background .18s, color .18s, border-color .18s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--gold); color: var(--ink);
  box-shadow: 0 4px 14px rgba(232,183,61,.35);
}
.btn-primary:hover { background: var(--gold-soft); box-shadow: 0 6px 18px rgba(232,183,61,.45); }
.btn-outline {
  background: #fff; color: var(--ink); border-color: var(--gold);
}
.btn-outline:hover { background: var(--gold-light); }
.btn-wa { gap: 10px; }
.btn-block { width: 100%; margin-top: 14px; }

/* ===================== FEATURES ===================== */
.features { padding: 80px 0 100px; }
.section-title {
  text-align: center;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--ink);
  letter-spacing: -.3px;
}
.section-rule {
  display: block; width: 60px; height: 3px;
  background: var(--gold); margin: 0 auto 50px; border-radius: 2px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.feature-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold-soft);
}
.feature-icon { margin-bottom: 18px; display: flex; justify-content: center; }
.feature-card h3 { margin: 0 0 10px; font-size: 18px; font-weight: 700; }
.feature-card p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }

@media (max-width: 880px) {
  .feature-grid { grid-template-columns: 1fr; }
  .hero { padding: 60px 0 80px; }
  .nav { gap: 18px; }
  .nav a:not(.lang-btn):not(.brand) { font-size: 13px; }
}

/* ===================== MODALS ===================== */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.modal[aria-hidden="false"] { display: flex; }
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 20, 20, .55);
  backdrop-filter: blur(2px);
}
.modal-panel {
  position: relative;
  background: #fff;
  border-radius: 18px;
  max-width: 720px;
  width: 100%;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  z-index: 1;
  animation: modal-pop .25s ease;
}
.modal-panel.modal-sm { max-width: 480px; }
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: transparent; border: none;
  font-size: 32px; line-height: 1; cursor: pointer;
  color: var(--muted); padding: 6px 10px;
  transition: color .15s;
}
.rtl .modal-close { right: auto; left: 16px; }
.modal-close:hover { color: var(--ink); }

.modal-title {
  font-size: 24px; font-weight: 700; margin: 0 0 8px;
  text-align: center; color: var(--ink);
}
.modal-sub {
  text-align: center;
  color: var(--ink-soft);
  margin: 0 0 28px; font-size: 14px;
}

/* form grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin-bottom: 22px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }
.field-phone label::after { content: ' *'; color: #C0392B; }
.field label {
  font-size: 12px; font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .4px;
}
.field input, .field select, .field textarea {
  height: 46px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0 14px;
  font: inherit; font-size: 14px;
  color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
  width: 100%;
}
.field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5L6 6.5L11 1.5' stroke='%231A1A1A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.rtl .field select {
  background-position: left 14px center;
  padding-right: 14px; padding-left: 36px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232,183,61,.2);
}
.field input.has-error, .field select.has-error { border-color: #C0392B; }
.field .hint { font-size: 11.5px; color: var(--gold-deep); }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

/* review step */
.review-list {
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  background: var(--line-soft);
  padding: 18px;
  border-radius: 12px;
}
.review-list .row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.review-list .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.review-list .val { font-weight: 600; font-size: 14px; overflow-wrap: break-word; }
.review-list .row.phone .val { color: var(--gold-deep); }
.review-actions { display: flex; gap: 12px; }
.review-actions .btn { flex: 1; }
@media (max-width: 600px) { .review-list { grid-template-columns: 1fr; } }

.success-mark { display: flex; justify-content: center; margin-bottom: 14px; }

/* WhatsApp lang picker */
.wa-langs {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.wa-lang {
  display: block; padding: 12px 14px;
  background: var(--gold-light); color: var(--ink);
  border-radius: 999px; text-align: center;
  text-decoration: none; font-weight: 600; font-size: 14px;
  transition: background .15s;
}
.wa-lang:hover { background: var(--gold-soft); }

/* ==================================================================
 * Phone combo — 20% country dial-code + 80% national number, one unit
 * ================================================================ */
.phone-combo {
  position: relative;
  display: grid;
  grid-template-columns: minmax(96px, 22%) 1fr;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: visible;
  transition: border-color .15s, box-shadow .15s;
}
.phone-combo:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232,183,61,.20);
}
.phone-combo.has-error { border-color: #B5530F; box-shadow: 0 0 0 3px rgba(181,83,15,.15); }

/* Dial-code button (left 20%) */
.phone-cc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--cream);
  border: none;
  border-inline-end: 1px solid var(--line);
  border-radius: 11px 0 0 11px;
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background .12s;
  user-select: none;
}
[dir="rtl"] .phone-cc { border-radius: 0 11px 11px 0; }
.phone-cc:hover { background: var(--gold-light); }
.phone-cc-flag { font-size: 18px; line-height: 1; }
.phone-cc-code { font-size: 13px; letter-spacing: .2px; }

/* National number input (right 80%) */
.phone-national {
  border: none !important;
  background: transparent !important;
  height: 100% !important;
  padding: 0 14px !important;
  font: inherit;
  font-size: 16px !important;
  color: var(--ink);
  outline: none !important;
  border-radius: 0 11px 11px 0 !important;
  letter-spacing: .3px;
  width: 100%;
}
[dir="rtl"] .phone-national {
  border-radius: 11px 0 0 11px !important;
  text-align: right;
}
.phone-national::placeholder { color: var(--muted); font-weight: 500; }

/* Dropdown menu */
.phone-cc-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  min-width: 280px;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(20,20,20,.14);
  padding: 6px;
  z-index: 100;
}
.phone-cc-menu[hidden] { display: none; }
.phone-cc-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  outline: none;
  margin-bottom: 6px;
  background: var(--line-soft);
}
.phone-cc-search:focus { border-color: var(--gold); background: #fff; }
.phone-cc-option {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  text-align: start;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
}
.phone-cc-option:hover, .phone-cc-option.is-active { background: var(--gold-light); }
.phone-cc-option .flag { font-size: 18px; line-height: 1; }
.phone-cc-option .name { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-cc-option .code { color: var(--ink-soft); font-size: 12.5px; font-weight: 600; letter-spacing: .3px; }
.phone-cc-empty { padding: 12px 10px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* ==================================================================
 * Searchable select — replaces every native <select> with a button +
 * popover list (search bar appears when option count > 7).
 * Original <select> stays in the DOM (clipped) so form validation works.
 * ================================================================ */
.ss-wrap { position: relative; display: block; width: 100%; }
.ss-original {
  position: absolute !important;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
  margin: 0; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
}
.ss-button {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  text-align: start;
  transition: border-color .15s, box-shadow .15s;
}
.ss-button:hover { border-color: var(--gold-soft); }
.ss-wrap.is-open .ss-button,
.ss-button:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232,183,61,.20);
}
.ss-wrap.has-error .ss-button { border-color: #B5530F; box-shadow: 0 0 0 3px rgba(181,83,15,.15); }
.ss-wrap.is-disabled .ss-button { background: var(--line-soft); color: var(--muted); cursor: not-allowed; }

.ss-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ss-label.is-placeholder { color: var(--muted); font-weight: 500; }
.ss-chev { flex: 0 0 10px; color: var(--ink-soft); transition: transform .15s; }
.ss-wrap.is-open .ss-chev { transform: rotate(180deg); }

.ss-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  inset-inline-end: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(20,20,20,.14);
  padding: 6px;
  z-index: 100;
  max-height: 320px;
  display: flex;
  flex-direction: column;
}
.ss-menu.drop-up {
  top: auto;
  bottom: calc(100% + 6px);
}
.ss-menu[hidden] { display: none; }

.ss-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  font-size: 13.5px;
  outline: none;
  margin-bottom: 6px;
  background: var(--line-soft);
  color: var(--ink);
  box-sizing: border-box;
}
.ss-search::placeholder { color: var(--muted); }
.ss-search:focus { border-color: var(--gold); background: #fff; box-shadow: 0 0 0 2px rgba(232,183,61,.18); }

.ss-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
}
.ss-group {
  padding: 8px 10px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
}
.ss-option {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  text-align: start;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ss-option:hover, .ss-option.is-active { background: var(--gold-light); }
.ss-option.is-selected {
  color: var(--gold-deep);
  font-weight: 700;
  background: var(--cream);
}
.ss-option.is-selected.is-active { background: var(--gold-light); }
.ss-empty {
  padding: 18px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ==================================================================
 * Photo upload card (apply form) — gold-themed drop area + circular preview
 * ================================================================ */
.photo-upload { margin: 0 0 18px; }
.photo-drop {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 1.5px dashed var(--gold-soft);
  border-radius: 14px;
  background: var(--cream);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
  position: relative;
}
.photo-drop:hover { border-color: var(--gold); background: #fff; }
.photo-drop.has-photo { border-style: solid; border-color: var(--gold); background: #fff; }
/* required-photo error state */
.photo-upload.has-error .photo-drop { border-color: #B5530F; background: #FEF6F0; box-shadow: 0 0 0 3px rgba(181,83,15,.14); }
.req-star { color: #B5530F; font-weight: 700; }
.photo-preview {
  width: 64px; height: 64px; flex: 0 0 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-soft) 100%);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gold-deep);
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(20,20,20,.08);
}
.photo-preview img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.photo-text { flex: 1; min-width: 0; }
.photo-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.photo-sub   { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.photo-remove {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff; color: var(--ink-soft);
  font-size: 18px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.photo-remove:hover { background: #FEF2F2; color: #991B1B; border-color: #FCA5A5; }
.photo-drop:not(.has-photo) .photo-remove { display: none; }

/* ==================================================================
 * Yes/No segmented toggle (in_saudi)
 * ================================================================ */
.yesno-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.yesno-opt {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  transition: border-color .12s, background .12s, color .12s;
  user-select: none;
}
.yesno-opt:hover { border-color: var(--gold-soft); }
.yesno-opt input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.yesno-opt:has(input:checked) {
  border-color: var(--gold);
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 0 0 3px rgba(232,183,61,.18);
}
.yesno-opt:has(input:checked) .yesno-label::before {
  content: '✓ ';
  color: var(--gold-deep);
  font-weight: 800;
}
