/* ============================================================
   CV Iraq — site styles (on top of Bootstrap 5.3 RTL/LTR)
   Phone first: one column at 360px, a bottom tab bar, big buttons within thumb reach.
   From 900px the menu moves into the header and pages gain a second column.
   Colours, type and spacing live in the tokens below; Bootstrap reads them through its --bs-* variables,
   so every page, including the ones not redesigned yet, takes the same look in light and dark mode.
   ============================================================ */

/* ============ TOKENS ============ */
:root {
  --bg: #ffffff;
  --surface: #f5f7fb;
  --surface-2: #edf1f7;
  --ink: #0f172a;
  --muted: #526077;
  --line: #e3e8f0;
  --brand: #2563eb;
  --brand-press: #1d4ed8;
  --brand-soft: #eaf1ff;
  --brand-text: #1d4ed8;
  --wa: #15803d;
  --wa-press: #166534;
  --ok: #15803d;
  --ok-bg: #e8f7ee;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --err: #b91c1c;
  --err-bg: #fdecec;
  --focus: #2563eb;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .18);
  --scrim: rgba(15, 23, 42, .5);
  /* the jobs map: four steps of one blue, with the label ink each step needs */
  --m0: #edf1f7; --m0-ink: #526077; --m1: #8fb0f4; --m1-ink: #0f172a; --m2: #5e8cec; --m2-ink: #0f172a;
  --m3: #2c5fd6; --m3-ink: #ffffff; --m4: #1a338f; --m4-ink: #ffffff;

  --font: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --head-h: 60px;
  --bar-h: calc(64px + env(safe-area-inset-bottom, 0px));
  --r: 14px;
  --r-sm: 10px;

  /* Older names still used inside page templates */
  --primary: var(--brand);
  --primary-hover: var(--brand-press);
  --primary-light: var(--brand-soft);
  --success: var(--ok);
  --success-light: var(--ok-bg);
  --processing: var(--warn);
  --processing-light: var(--warn-bg);
  --rejected: var(--err);
  --rejected-light: var(--err-bg);
  --white: var(--bg);
  --border: var(--line);
  --text: var(--ink);
  --text-muted: var(--muted);
  --radius: var(--r);
  --radius-md: var(--r-sm);
  --radius-sm: 8px;
  --shadow-sm: none;
  --shadow-md: var(--shadow);
  --shadow-lg: var(--shadow);

  /* Bootstrap reads these */
  --bs-body-font-family: var(--font);
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.7;
  --bs-body-color: var(--ink);
  --bs-body-color-rgb: 15, 23, 42;
  --bs-body-bg: var(--bg);
  --bs-body-bg-rgb: 255, 255, 255;
  --bs-emphasis-color: var(--ink);
  --bs-heading-color: var(--ink);
  --bs-secondary-color: var(--muted);
  --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-bg: var(--surface);
  --bs-border-color: var(--line);
  --bs-border-color-translucent: var(--line);
  --bs-border-radius: 12px;
  --bs-border-radius-sm: 8px;
  --bs-border-radius-lg: 14px;
  --bs-border-radius-xl: 18px;
  --bs-link-color: var(--brand-text);
  --bs-link-color-rgb: 29, 78, 216;
  --bs-link-hover-color: var(--brand-press);
  --bs-link-hover-color-rgb: 29, 78, 216;
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37, 99, 235;
  --bs-success: #15803d;
  --bs-success-rgb: 21, 128, 61;
  --bs-primary-bg-subtle: var(--brand-soft);
  --bs-primary-text-emphasis: var(--brand-text);
  --bs-primary-border-subtle: #bfd3fb;
  --bs-success-bg-subtle: var(--ok-bg);
  --bs-success-text-emphasis: var(--ok);
  --bs-success-border-subtle: #b7e4c7;
  --bs-warning-bg-subtle: var(--warn-bg);
  --bs-warning-text-emphasis: var(--warn);
  --bs-warning-border-subtle: #f6d98a;
  --bs-danger-bg-subtle: var(--err-bg);
  --bs-danger-text-emphasis: var(--err);
  --bs-info-bg-subtle: var(--brand-soft);
  --bs-info-text-emphasis: var(--brand-text);
  --bs-light-bg-subtle: var(--surface);
  --bs-focus-ring-color: rgba(37, 99, 235, .25);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111a2d;
  --surface-2: #16213a;
  --ink: #e8edf7;
  --muted: #9aa6bd;
  --line: #22304d;
  --brand: #3b82f6;
  --brand-press: #60a5fa;
  --brand-soft: #13254a;
  --brand-text: #93b4ff;
  --wa: #15803d;
  --wa-press: #16a34a;
  --ok: #4ade80;
  --ok-bg: #0f2b1c;
  --warn: #fbbf24;
  --warn-bg: #33260b;
  --err: #fca5a5;
  --err-bg: #3a1414;
  --focus: #60a5fa;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --scrim: rgba(0, 0, 0, .6);
  --m0: #16213a; --m0-ink: #9aa6bd; --m1: #2f529c; --m1-ink: #ffffff; --m2: #3d69c8; --m2-ink: #ffffff;
  --m3: #86aef6; --m3-ink: #0b1220; --m4: #cddfff; --m4-ink: #0b1220;

  --bs-body-color-rgb: 232, 237, 247;
  --bs-body-bg-rgb: 11, 18, 32;
  --bs-link-color-rgb: 147, 180, 255;
  --bs-link-hover-color-rgb: 191, 211, 255;
  --bs-link-hover-color: #bfd3ff;
  --bs-primary: #3b82f6;
  --bs-primary-rgb: 59, 130, 246;
  --bs-primary-border-subtle: #2a4a8a;
  --bs-success-border-subtle: #1f5135;
  --bs-warning-border-subtle: #5c4512;
  --bs-focus-ring-color: rgba(96, 165, 250, .35);
  color-scheme: dark;
}

/* ============ BASE ============ */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
  scroll-padding-top: calc(var(--head-h) + 16px);
}
html.menu-open { overflow: hidden; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--bar-h);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { line-height: 1.55; }
body.has-own-bar { padding-bottom: 0; }
/* The content takes the spare height, so on short pages the footer still sits at the bottom of the screen */
#main { flex: 1 0 auto; }
main { flex: 1 0 auto; }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 700; line-height: 1.3; color: var(--ink); letter-spacing: 0; text-wrap: balance; }
h1, .h1 { font-size: clamp(26px, 1.4rem + 1.2vw, 38px); }
h2, .h2 { font-size: clamp(22px, 1.2rem + .8vw, 30px); }
h3, .h3 { font-size: 19px; }
h4, .h4 { font-size: 18px; }
h5, .h5 { font-size: 17px; }
h6, .h6 { font-size: 16px; }
html[lang="en"] h1, html[lang="en"] .h1 { letter-spacing: -0.01em; }
.lead { font-size: 18px; font-weight: 400; color: var(--muted); }
.display-4, .display-6 { font-weight: 700; }

a { color: var(--brand-text); text-underline-offset: 3px; }
a:hover { color: var(--brand-press); }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; }
a, button, summary, label { touch-action: manipulation; }
button, .btn, .chip, .tabbar a, .tabbar button, summary { -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }

.container { padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 900px) { .container { padding-inline: 24px; } }
.container-form { max-width: 800px; }

.skip-link {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--bg); }

/* Numbers, phone numbers and emails read left to right inside Arabic text */
.ltr-number { unicode-bidi: isolate; direction: ltr; display: inline-block; font-variant-numeric: tabular-nums; }
input[type="email"], input[type="url"], input[type="tel"], input[dir="ltr"] { direction: ltr; text-align: start; }
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"], [dir="rtl"] input[type="tel"], [dir="rtl"] input[dir="ltr"] { text-align: right; }

/* Templates use Arabic arrow meanings ("back" = arrow-right, "next" = arrow-left); mirror them on English pages */
[dir="ltr"] .bi-arrow-left::before { content: "\f138"; }
[dir="ltr"] .bi-arrow-right::before { content: "\f12f"; }
[dir="ltr"] .bi-chevron-left::before { content: "\f285"; }
[dir="ltr"] .bi-chevron-right::before { content: "\f284"; }

/* Bootstrap's light-only utilities, made to follow the theme */
.text-muted { color: var(--muted) !important; }
.text-dark, .text-black, .text-body { color: var(--ink) !important; }
/* On a yellow background the text stays dark in both themes */
.bg-warning:not(.badge), .bg-warning:not(.badge) :is(h1, h2, h3, h4, h5, h6, .text-dark) { color: #111827 !important; }
[data-theme="dark"] .limited-banner { color: #111827; }
.bg-light, .bg-white { background-color: var(--surface) !important; }
.bg-body { background-color: var(--bg) !important; }
.border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--line) !important; }
.border-primary { border-color: var(--brand) !important; }
.border-success { border-color: var(--ok) !important; }
.shadow-sm, .shadow { box-shadow: var(--shadow) !important; }
[data-theme="dark"] .text-success { color: var(--ok) !important; }
[data-theme="dark"] .text-primary { color: var(--brand-text) !important; }
[data-theme="dark"] .text-danger { color: var(--err) !important; }
html:not([data-theme="dark"]) .text-danger { color: #b91c1c !important; } /* Bootstrap red is too light on grey */
[data-theme="dark"] .text-warning { color: var(--warn) !important; }
html:not([data-theme="dark"]) .text-warning { color: #b45309 !important; }
.bg-success.bg-opacity-10 { background-color: var(--ok-bg) !important; }
.bg-primary.bg-opacity-10 { background-color: var(--brand-soft) !important; }
hr { border-color: var(--line); opacity: 1; }

/* ============ BUTTONS ============ */
.btn {
  --bs-btn-padding-x: 20px;
  --bs-btn-padding-y: 10px;
  --bs-btn-font-size: 16px;
  --bs-btn-font-weight: 600;
  --bs-btn-line-height: 1.4;
  --bs-btn-border-radius: 12px;
  --bs-btn-focus-box-shadow: 0 0 0 3px var(--bs-focus-ring-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s ease-out;
}
.btn:active { transform: scale(.97); }
.btn > .bi { font-size: 1.05em; line-height: 1; }
.btn .me-1, .btn .me-2, .btn .ms-1 { margin: 0 !important; }
.btn-sm { --bs-btn-padding-x: 14px; --bs-btn-padding-y: 6px; --bs-btn-font-size: 15px; --bs-btn-border-radius: 10px; min-height: 40px; }
.btn-lg { --bs-btn-padding-x: 24px; --bs-btn-padding-y: 12px; --bs-btn-font-size: 17px; --bs-btn-border-radius: 14px; min-height: 54px; }
.btn-link.p-0, .btn-link.btn-sm { min-height: 0; }
.btn.w-100, .d-grid > .btn { display: flex; }

.btn-primary {
  --bs-btn-color: #fff; --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand-press); --bs-btn-hover-border-color: var(--brand-press);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--brand-press); --bs-btn-active-border-color: var(--brand-press);
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
[data-theme="dark"] .btn-primary { --bs-btn-bg: #2563eb; --bs-btn-border-color: #2563eb; --bs-btn-hover-bg: #1d4ed8; --bs-btn-hover-border-color: #1d4ed8; --bs-btn-active-bg: #1d4ed8; }
/* Green is WhatsApp and "done": send on WhatsApp, download the PDF */
.btn-success {
  --bs-btn-color: #fff; --bs-btn-bg: var(--wa); --bs-btn-border-color: var(--wa);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--wa-press); --bs-btn-hover-border-color: var(--wa-press);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--wa-press); --bs-btn-active-border-color: var(--wa-press);
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--wa); --bs-btn-disabled-border-color: var(--wa);
}
.btn-outline-primary {
  --bs-btn-color: var(--brand-text); --bs-btn-bg: var(--bg); --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: var(--brand-text); --bs-btn-hover-bg: var(--brand-soft); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand);
  --bs-btn-disabled-color: var(--muted); --bs-btn-disabled-bg: transparent; --bs-btn-disabled-border-color: var(--line);
}
[data-theme="dark"] .btn-outline-primary { --bs-btn-active-bg: #2563eb; --bs-btn-active-border-color: #2563eb; }
.btn-outline-secondary, .btn-light {
  --bs-btn-color: var(--ink); --bs-btn-bg: var(--bg); --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--surface); --bs-btn-hover-border-color: var(--muted);
  --bs-btn-active-color: var(--ink); --bs-btn-active-bg: var(--surface-2); --bs-btn-active-border-color: var(--muted);
  --bs-btn-disabled-color: var(--muted); --bs-btn-disabled-bg: transparent; --bs-btn-disabled-border-color: var(--line);
}
.btn-secondary {
  --bs-btn-color: var(--ink); --bs-btn-bg: var(--surface-2); --bs-btn-border-color: var(--surface-2);
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--line); --bs-btn-hover-border-color: var(--line);
  --bs-btn-active-color: var(--ink); --bs-btn-active-bg: var(--line); --bs-btn-active-border-color: var(--line);
}
.btn-outline-success {
  --bs-btn-color: var(--ok); --bs-btn-bg: var(--bg); --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: var(--ok); --bs-btn-hover-bg: var(--ok-bg); --bs-btn-hover-border-color: var(--ok);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--wa); --bs-btn-active-border-color: var(--wa);
}
.btn-outline-danger {
  --bs-btn-color: var(--err); --bs-btn-bg: transparent; --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: var(--err); --bs-btn-hover-bg: var(--err-bg); --bs-btn-hover-border-color: var(--err);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #b91c1c; --bs-btn-active-border-color: #b91c1c;
}
.btn-danger {
  --bs-btn-color: #fff; --bs-btn-bg: #b91c1c; --bs-btn-border-color: #b91c1c;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #991b1b; --bs-btn-hover-border-color: #991b1b;
  --bs-btn-active-bg: #991b1b; --bs-btn-active-border-color: #991b1b;
}
.btn-warning {
  --bs-btn-color: #111827; --bs-btn-bg: #fbbf24; --bs-btn-border-color: #fbbf24;
  --bs-btn-hover-color: #111827; --bs-btn-hover-bg: #f59e0b; --bs-btn-hover-border-color: #f59e0b;
}
.btn-info {
  --bs-btn-color: #fff; --bs-btn-bg: #0e7490; --bs-btn-border-color: #0e7490;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #155e75; --bs-btn-hover-border-color: #155e75;
}
.btn-link { --bs-btn-color: var(--brand-text); --bs-btn-hover-color: var(--brand-press); --bs-btn-font-weight: 600; text-decoration: none; }
.btn-close { width: 1em; height: 1em; padding: .75em; }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.btn-group > .btn { min-height: 40px; }

/* ============ FORMS ============ */
.form-label { font-weight: 600; font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.form-text { color: var(--muted); font-size: 13px; }
.form-control, .form-select {
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background-color: var(--bg);
  color: var(--ink);
  font-size: 16px; /* 16px stops phones from zooming into the field */
  transition: border-color .15s, box-shadow .15s;
}
[dir="rtl"] .form-select { padding-left: 38px; padding-right: 14px; background-position: left 14px center; }
[dir="ltr"] .form-select { padding-right: 38px; background-position: right 14px center; }
.form-control-sm, .form-select-sm { min-height: 44px; padding-block: 8px; border-radius: 10px; font-size: 16px; }
.form-control-lg, .form-select-lg { min-height: 56px; font-size: 17px; border-radius: 14px; }
textarea.form-control { min-height: 96px; line-height: 1.7; }
.form-control::placeholder { color: var(--muted); opacity: .85; }
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  background-color: var(--bg);
  color: var(--ink);
  box-shadow: 0 0 0 3px var(--bs-focus-ring-color);
}
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background-color: var(--surface); }
.form-control[type="file"] { padding: 8px 10px; line-height: 2; }
.form-control[type="file"]::file-selector-button {
  background: var(--brand-soft); color: var(--brand-text); border: 0; border-radius: 8px;
  padding: 6px 14px; margin-block: 0; margin-inline: 0 12px; font-weight: 600; font-family: inherit;
}
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
.form-check { min-height: 28px; }
.form-check-input { width: 20px; height: 20px; margin-top: .2em; border-color: var(--muted); background-color: var(--bg); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--bs-focus-ring-color); border-color: var(--brand); }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; margin-top: .15em; }
.form-check-label { cursor: pointer; }
.input-group > .form-control, .input-group > .btn { min-height: 44px; }
.invalid-feedback { font-weight: 600; }
.is-invalid { border-color: var(--err) !important; }
/* bootstrap_form marks fields valid after a search; the green tick only adds noise */
.form-control.is-valid, .form-select.is-valid { border-color: var(--line); background-image: none; }
.form-select.is-valid { background-image: var(--bs-form-select-bg-img); }
.form-control.is-valid:focus, .form-select.is-valid:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
label.requiredField::after, .form-label.requiredField::after { content: " *"; color: var(--err); font-weight: 700; }
.asteriskField { display: none; }

/* ============ CARDS, ALERTS, BADGES ============ */
.card {
  --bs-card-bg: var(--bg);
  --bs-card-border-color: var(--line);
  --bs-card-border-radius: var(--r);
  --bs-card-inner-border-radius: calc(var(--r) - 1px);
  --bs-card-cap-bg: var(--surface);
  --bs-card-spacer-x: 20px;
  --bs-card-spacer-y: 20px;
  --bs-card-color: var(--ink);
  box-shadow: none;
}
.card-header { padding: 14px 20px; font-weight: 700; }
.card-footer { background: transparent; }
@media (max-width: 599px) { .card { --bs-card-spacer-x: 16px; --bs-card-spacer-y: 16px; } }
.candidate-card { transition: border-color .15s; }
@media (hover: hover) and (pointer: fine) { .candidate-card:hover { border-color: var(--muted); } }

.alert {
  --bs-alert-border-radius: 12px;
  --bs-alert-padding-x: 16px;
  --bs-alert-padding-y: 12px;
  border: 0;
  font-size: 15px;
}
.alert-success { --bs-alert-bg: var(--ok-bg); --bs-alert-color: var(--ok); --bs-alert-link-color: var(--ok); }
.alert-warning { --bs-alert-bg: var(--warn-bg); --bs-alert-color: var(--warn); --bs-alert-link-color: var(--warn); }
.alert-danger, .alert-error { --bs-alert-bg: var(--err-bg); --bs-alert-color: var(--err); --bs-alert-link-color: var(--err); }
.alert-info, .alert-primary { --bs-alert-bg: var(--brand-soft); --bs-alert-color: var(--ink); --bs-alert-link-color: var(--brand-text); }
.alert-secondary, .alert-light { --bs-alert-bg: var(--surface); --bs-alert-color: var(--ink); }
.alert-dismissible { padding-inline-end: 48px; }
.alert-dismissible .btn-close { padding: 16px; }

.badge { --bs-badge-font-weight: 600; --bs-badge-padding-x: 10px; --bs-badge-padding-y: 5px; --bs-badge-font-size: 13px; border-radius: 999px; line-height: 1.3; }
.badge.bg-light { background: var(--surface-2) !important; color: var(--ink) !important; border: 0 !important; }
.badge.bg-warning-subtle { background: var(--warn-bg) !important; color: var(--warn) !important; border: 0 !important; }
.badge.bg-success-subtle { background: var(--ok-bg) !important; color: var(--ok) !important; }
.badge.bg-success:not(.bg-opacity-10) { background-color: var(--wa) !important; color: #fff !important; }
.badge.bg-warning { color: #111827; }
[data-theme="dark"] .badge.bg-warning { background-color: var(--warn-bg) !important; color: var(--warn) !important; }
.badge.bg-info { background-color: var(--brand-soft) !important; color: var(--brand-text) !important; }

/* Status pills: pending, verified, rejected */
.badge-pending, .badge-processing, .badge-approved, .badge-verified, .badge-rejected, .badge-suspended {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.badge-pending, .badge-processing { background: var(--warn-bg); color: var(--warn); }
.badge-approved, .badge-verified { background: var(--ok-bg); color: var(--ok); }
.badge-rejected { background: var(--err-bg); color: var(--err); }
.badge-suspended { background: var(--surface-2); color: var(--muted); }

/* ============ OTHER BOOTSTRAP PARTS ============ */
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-border-color: var(--line); --bs-table-hover-bg: var(--surface); --bs-table-striped-bg: var(--surface); font-size: 15px; }
.table thead th { font-weight: 600; color: var(--muted); font-size: 13px; border-bottom-width: 1px; white-space: nowrap; }
html[lang="en"] .table thead th { text-transform: uppercase; letter-spacing: .04em; font-size: 12px; }
.table-responsive { -webkit-overflow-scrolling: touch; }

.accordion {
  --bs-accordion-bg: var(--bg);
  --bs-accordion-color: var(--ink);
  --bs-accordion-border-color: var(--line);
  --bs-accordion-border-radius: var(--r);
  --bs-accordion-inner-border-radius: calc(var(--r) - 1px);
  --bs-accordion-btn-color: var(--ink);
  --bs-accordion-btn-bg: var(--bg);
  --bs-accordion-btn-padding-x: 16px;
  --bs-accordion-btn-padding-y: 16px;
  --bs-accordion-active-color: var(--ink);
  --bs-accordion-active-bg: var(--surface);
  --bs-accordion-btn-focus-box-shadow: inset 0 0 0 3px var(--bs-focus-ring-color);
  --bs-accordion-body-padding-x: 16px;
}
.accordion-button { font-weight: 600; gap: 8px; min-height: 56px; }
[data-theme="dark"] .accordion-button::after { filter: invert(1) brightness(1.6); }
[data-theme="dark"] .accordion-button:not(.collapsed) { color: var(--brand-text) !important; }

.pagination { --bs-pagination-color: var(--ink); --bs-pagination-bg: var(--bg); --bs-pagination-border-color: var(--line); --bs-pagination-hover-bg: var(--surface); --bs-pagination-hover-color: var(--ink); --bs-pagination-hover-border-color: var(--muted); --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-focus-box-shadow: 0 0 0 3px var(--bs-focus-ring-color); flex-wrap: wrap; gap: 6px; }
[data-theme="dark"] .pagination { --bs-pagination-active-bg: #2563eb; --bs-pagination-active-border-color: #2563eb; } /* white text needs the darker blue */
.page-link { min-width: 44px; min-height: 44px; display: grid; place-items: center; border-radius: 12px !important; margin: 0 !important; font-weight: 600; font-variant-numeric: tabular-nums; }

.dropdown-menu { --bs-dropdown-bg: var(--bg); --bs-dropdown-color: var(--ink); --bs-dropdown-border-color: var(--line); --bs-dropdown-border-radius: 14px; --bs-dropdown-link-color: var(--ink); --bs-dropdown-link-hover-bg: var(--surface); --bs-dropdown-link-hover-color: var(--ink); --bs-dropdown-link-active-bg: var(--brand-soft); --bs-dropdown-link-active-color: var(--brand-text); --bs-dropdown-divider-bg: var(--line); --bs-dropdown-item-padding-y: 10px; box-shadow: var(--shadow); padding: 6px; }
.dropdown-item { border-radius: 8px; }

.modal-content { --bs-modal-bg: var(--bg); --bs-modal-color: var(--ink); --bs-modal-border-color: var(--line); --bs-modal-border-radius: 20px; }
.list-group { --bs-list-group-bg: var(--bg); --bs-list-group-color: var(--ink); --bs-list-group-border-color: var(--line); --bs-list-group-border-radius: var(--r); --bs-list-group-action-hover-bg: var(--surface); --bs-list-group-action-hover-color: var(--ink); }
.nav-tabs { --bs-nav-tabs-border-color: var(--line); --bs-nav-tabs-link-active-bg: var(--bg); --bs-nav-tabs-link-active-color: var(--ink); --bs-nav-tabs-link-active-border-color: var(--line) var(--line) var(--bg); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-tabs .nav-link { white-space: nowrap; font-weight: 600; color: var(--muted); min-height: 44px; }
.progress { --bs-progress-height: 8px; --bs-progress-bg: var(--surface-2); --bs-progress-border-radius: 999px; --bs-progress-bar-bg: var(--brand); }
.breadcrumb { --bs-breadcrumb-divider-color: var(--muted); --bs-breadcrumb-item-active-color: var(--muted); }

/* ============ HEADER ============ */
.site-head {
  position: sticky; top: 0; z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(8px)) {
  .site-head, .tabbar, .apply-bar { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
}
.head-in { display: flex; align-items: center; gap: 8px; min-height: var(--head-h); }
.logo { display: inline-flex; align-items: center; flex: none; min-height: 44px; }
.logo img { display: block; height: 34px; width: auto; }
.logo-dark { display: none !important; }
[data-theme="dark"] .logo-light { display: none !important; }
[data-theme="dark"] .logo-dark { display: block !important; }
.head-nav { display: none; }
.head-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.head-tools form { margin: 0; }
.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; padding: 0; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 18px; line-height: 1;
}
.icon-btn:active { background: var(--surface-2); }
.pill-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; line-height: 1;
}
.pill-btn:active { background: var(--surface-2); }
.pill-btn:hover { color: var(--ink); }
.pill-btn .bi { color: var(--brand-text); font-size: 17px; }
.pill-btn[aria-current="page"] { background: var(--surface-2); }
.pill-btn.is-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-theme="dark"] .pill-btn.is-primary { background: #2563eb; border-color: #2563eb; } /* white text needs the darker blue */
.pill-btn.is-primary .bi { color: inherit; }
.desk { display: none !important; }
.l-short { display: none; }
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover, .pill-btn:hover { background: var(--surface); }
  .pill-btn.is-primary:hover { background: var(--brand-press); border-color: var(--brand-press); }
}
/* Phones: short language label and a text-only login; narrow phones also get a smaller logo;
   under 360px the login button keeps only its icon */
@media (max-width: 479px) {
  .l-long { display: none; }
  .l-short { display: inline; }
  .login-pill .bi { display: none; }
}
@media (max-width: 399px) {
  .logo img { height: 28px; }
  .head-in { gap: 4px; }
  .head-tools { gap: 4px; }
  .pill-btn { padding: 0 11px; font-size: 14px; }
}
@media (max-width: 359px) {
  .login-pill { width: 44px; padding: 0; }
  .login-pill .bi { display: inline; }
  .login-pill span { display: none; }
}

.head-account .dropdown-toggle { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.head-account .dropdown-toggle::after { margin-inline-start: 2px; }

/* ============ TAB BAR (phones) ============ */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 90;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding: 0 max(8px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(8px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  border-top: 1px solid var(--line);
}
.tabbar a, .tabbar button {
  display: grid; justify-items: center; align-content: center; gap: 2px;
  min-height: 64px; padding: 0 2px; border: 0; border-radius: 12px; background: none;
  color: var(--muted); font-size: 12.5px; font-weight: 600; line-height: 1.25; text-decoration: none; text-align: center;
}
.tabbar .bi { font-size: 22px; line-height: 1; }
.tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar a:active, .tabbar button:active { background: var(--surface); }
.tabbar [aria-current="page"] { color: var(--brand-text); }
body.has-own-bar .tabbar { display: none; }

/* ============ MENU SHEET ============ */
/* Slides up from the bottom on the phone; a small panel under the header on wide screens */
.menu-sheet[hidden] { display: none; }
.menu-sheet { position: fixed; inset: 0; z-index: 1050; display: flex; align-items: flex-end; justify-content: center; }
.menu-scrim { position: absolute; inset: 0; background: var(--scrim); animation: fadeIn .2s ease-out; }
.menu-panel {
  position: relative; width: 100%; max-height: 90vh; max-height: 90dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 22px 22px 0 0; box-shadow: var(--shadow);
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  animation: sheetUp .32s cubic-bezier(.22, 1, .36, 1);
}
.menu-panel::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 4px; }
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.menu-head h2 { font-size: 19px; margin: 0; }
.menu-who { font-size: 14px; color: var(--muted); margin: -6px 0 8px; overflow-wrap: anywhere; }
.menu-links { display: grid; margin: 0 0 12px; padding: 0; list-style: none; }
.menu-links a, .menu-links button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 52px; padding: 0 8px; border: 0; border-bottom: 1px solid var(--line); background: none;
  color: var(--ink); font-size: 17px; font-weight: 600; text-decoration: none; text-align: start;
}
.menu-links .bi { font-size: 20px; color: var(--muted); width: 24px; text-align: center; }
.menu-links a:active, .menu-links button:active { background: var(--surface); }
.menu-links .is-danger, .menu-links .is-danger .bi { color: var(--err); }
.menu-actions { display: grid; gap: 10px; margin-bottom: 12px; }
.menu-actions form { margin: 0; }
.menu-prefs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.menu-prefs form { margin: 0; display: grid; }
.menu-prefs .pill-btn { width: 100%; min-height: 48px; border-radius: 12px; }
.menu-small { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: 12px; padding: 0; list-style: none; font-size: 14px; }
.menu-small a { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); text-decoration: none; }

/* ============ MESSAGES ============ */
.site-messages { padding-top: 12px; }
.site-messages .alert { margin-bottom: 8px; }

/* ============ FOOTER ============ */
.site-foot { border-top: 1px solid var(--line); padding: 28px 0 24px; margin-top: 24px; background: var(--bg); }
.foot-in { display: grid; gap: 16px; }
.foot-brand img { height: 30px; width: auto; display: block; }
.foot-brand p { color: var(--muted); font-size: 14px; margin: 6px 0 0; max-width: 36em; }
/* Links in groups: on phones each group folds open under its heading; on desktop three open columns next to the logo (app.js opens them) */
.foot-cols { display: grid; border-top: 1px solid var(--line); }
.foot-group { border-bottom: 1px solid var(--line); }
.foot-group summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; list-style: none; cursor: pointer; touch-action: manipulation; }
.foot-group summary::-webkit-details-marker { display: none; }
.foot-group summary .bi { display: inline-block; color: var(--muted); transition: transform .2s; }
.foot-group[open] summary .bi { transform: rotate(180deg); }
.foot-col h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.foot-col ul { margin: 0; padding: 0 0 10px; list-style: none; }
.foot-col a { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); font-size: 15px; text-decoration: none; }
.foot-col a:hover { color: var(--ink); }
.foot-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; }
.foot-rights { color: var(--muted); font-size: 13px; margin: 0; }
.foot-mail { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--muted); font-size: 13px; text-decoration: none; }
.foot-mail:hover { color: var(--ink); }

/* ============ SHARED PAGE PARTS ============ */
.page { padding-block: 20px 40px; }
.page-head { margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head p { color: var(--muted); margin: 6px 0 0; max-width: 62ch; }
.section { padding-block: 36px; }
.section-alt { background: var(--surface); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.section-head p { color: var(--muted); margin: 4px 0 0; flex-basis: 100%; }
.more-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.more-link:hover { text-decoration: underline; }
.read { max-width: 760px; }
.read h2 { font-size: 20px; margin: 28px 0 6px; }
.read p, .read li { max-width: 68ch; }

/* Older shared section heading (about, plans) */
.section-header { text-align: center; margin-bottom: 32px; }
.section-header h2 { margin-bottom: 6px; }
.section-header p { color: var(--muted); }

/* Chips: governorates, industries, templates */
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 42px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: transform .1s ease-out, background-color .15s, border-color .15s;
}
.chip b { font-weight: 600; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip:active { transform: scale(.96); }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"], .chip[aria-current="true"], .chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip[aria-pressed="true"] b, .chip[aria-current="true"] b, .chip.is-on b { color: inherit; opacity: .85; }
[data-theme="dark"] :is(.chip[aria-pressed="true"], .chip[aria-current="true"], .chip.is-on) { background: #2563eb; border-color: #2563eb; } /* white text needs the darker blue */
@media (hover: hover) and (pointer: fine) { .chip:hover { border-color: var(--muted); } }
.chip-row {
  display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  margin-inline: -16px; padding: 4px 16px;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

/* Search box with its button inside */
.search {
  display: flex; align-items: center; gap: 6px; min-height: 56px;
  padding: 5px; padding-inline-start: 14px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--bg);
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
.search > .bi { color: var(--muted); font-size: 18px; }
.search input[type="text"], .search input[type="search"], .search .form-control {
  flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; box-shadow: none; padding: 0 4px; font-size: 16px; color: var(--ink);
}
.search input:focus { outline: none; box-shadow: none; }
.search .btn { min-height: 44px; border-radius: 11px; }
.search .mb-3 { margin: 0 !important; flex: 1; min-width: 0; }

/* Job cards: home, jobs list */
.jobs-cards { display: grid; gap: 10px; }
.jcard {
  position: relative; display: grid; gap: 2px; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--ink);
  transition: border-color .15s, background-color .15s, transform .1s ease-out;
}
.jcard:active { background: var(--surface); transform: scale(.99); }
@media (hover: hover) and (pointer: fine) { .jcard:hover { border-color: var(--muted); } }
.jc-title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.45; }
.jc-title a { color: inherit; text-decoration: none; }
.jc-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* the whole card is the link */
.jc-title a:focus-visible { outline: none; }
.jcard:has(.jc-title a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.jc-sub { font-size: 14px; color: var(--muted); margin: 0; }
.jc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 14px; color: var(--muted); margin: 0; }
.jc-meta .sep { opacity: .6; }
.jc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.jc-date { margin-inline-start: auto; font-size: 13px; color: var(--muted); }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink);
  font-size: 13px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.tag-pay { background: var(--ok-bg); color: var(--ok); font-weight: 700; font-variant-numeric: tabular-nums; }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-brand { background: var(--brand-soft); color: var(--brand-text); }

/* A plain warning note */
.note { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: 15px; }
.note .bi { font-size: 18px; line-height: 1.5; }
.note b, .note strong { display: block; color: inherit; }
.note a { color: inherit; font-weight: 600; }

.empty { padding: 40px 16px; text-align: center; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.empty .bi { font-size: 40px; }

/* Questions and answers (FAQ, CV builder page) */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 60px; padding: 12px 0; font-weight: 600; font-size: 17px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "\F282"; font-family: "bootstrap-icons"; font-size: 16px; color: var(--muted); flex: none; transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(180deg); }
.faq summary h2, .faq summary h3 { font-size: inherit; font-weight: inherit; margin: 0; line-height: 1.5; }
.faq .faq-a { padding-bottom: 18px; color: var(--muted); max-width: 68ch; margin: 0; }

/* Steps (the step number is part of each heading) */
.steps { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 14px; }
.steps li > .bi {
  grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-text); font-size: 18px;
}
.steps h3 { font-size: 17px; margin: 0; }
.steps p { color: var(--muted); margin: 2px 0 0; }

/* CV template gallery: one row that scrolls sideways on the phone, a grid on wide screens */
.tpl-gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(74%, 280px); gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
  margin-inline: -16px; padding: 4px 16px 12px;
}
.tpl-gallery::-webkit-scrollbar { display: none; }
.tpl-card { scroll-snap-align: center; display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--bg); }
.tpl-card .tpl-img { display: block; background: var(--surface); padding: 16px 20px 0; }
.tpl-card img { display: block; width: 100%; height: auto; aspect-ratio: 420 / 594; object-fit: cover; object-position: top; border-radius: 4px 4px 0 0; box-shadow: var(--shadow); }
.tpl-card .tpl-body { display: grid; gap: 4px; align-content: start; padding: 14px 16px 16px; }
.tpl-card h3 { font-size: 17px; margin: 0; }
.tpl-card p { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.tpl-card .btn { margin-top: auto; }

/* Staff dashboard and company pages: older two-tone company badge */
.company-logo-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; text-align: center; min-width: 150px; }
.company-initial { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; font-weight: 700; margin: 0 auto 8px; background: var(--brand-soft); color: var(--brand-text); }
.gradient-text { color: var(--brand); }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }
[data-theme="dark"] .profile-cover { filter: brightness(.6) saturate(1.1); }

/* ============ HOME ============ */
.hero { padding-block: 24px 8px; }
.hero-in { display: grid; gap: 22px; }
.hero-in > * { min-width: 0; }
.hero h1 { font-size: clamp(30px, 5.4vw + 11px, 52px); line-height: 1.22; margin: 0; }
html[lang="en"] .hero h1 { line-height: 1.12; letter-spacing: -0.02em; }
.hero-lead { font-size: 17px; color: var(--muted); margin: 12px 0 0; max-width: 34em; }
.hero-acts { display: grid; gap: 10px; margin-top: 20px; max-width: 460px; }
.hero-acts .btn { width: 100%; }
.hero-note { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.hero-note li { display: inline-flex; align-items: center; gap: 6px; }
.hero-note .bi { color: var(--ok); }
/* The real template as a printed page; on the phone only its top half shows so the job search still reaches the first screen */
.hero-paper {
  position: relative; height: 210px; overflow: hidden; border-radius: 18px; background: var(--surface); padding: 22px 36px 0;
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent);
}
.hero-paper a { display: block; max-width: 320px; margin-inline: auto; }
.hero-paper img { display: block; width: 100%; height: auto; aspect-ratio: 420 / 594; border-radius: 4px; background: #fff; box-shadow: var(--shadow); }
.hero-paper img.swap { animation: swapIn .35s ease-out; }
.tpl-pick { padding-top: 12px; }

.find { padding-block: 28px 8px; }
.find h2 { margin: 0; }
.find-sub { color: var(--muted); margin: 4px 0 14px; }
.find form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.find .gov-select { min-height: 52px; border-radius: 14px; }

/* Jobs map: the 18 governorates as hexagons, laid out like the country (positions are geography, so left/top stay physical) */
.vac { display: grid; gap: 20px; margin-top: 20px; }
.map-box { display: grid; justify-items: center; gap: 12px; min-width: 0; }
.hexmap { position: relative; width: min(100%, 340px); aspect-ratio: 4 / 5.4847; direction: ltr; margin: 0; padding: 0; list-style: none; }
.hexmap li { display: contents; }
.hex { position: absolute; width: 25%; height: 21.053%; text-decoration: none; transition: transform .15s ease-out; }
.hex::before, .hex-in { position: absolute; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.hex::before { content: ""; inset: 0; background: var(--focus); opacity: 0; }
.hex-in {
  inset: 3.5%; display: grid; place-content: center; text-align: center; line-height: 1.2; padding: 0 9%;
  background: var(--brand-soft); color: var(--brand-text);
}
.hex-in b { font-size: 17px; font-weight: 700; }
.hex-in b:empty { display: none; }
.hex-in span { font-size: 11.5px; font-weight: 600; }
html[lang="en"] .hex-in span { font-size: 10.5px; }
.hex[data-bin="0"] .hex-in { background: var(--m0); color: var(--m0-ink); }
.hex[data-bin="0"] .hex-in b { font-weight: 400; }
.hex[data-bin="1"] .hex-in { background: var(--m1); color: var(--m1-ink); }
.hex[data-bin="2"] .hex-in { background: var(--m2); color: var(--m2-ink); }
.hex[data-bin="3"] .hex-in { background: var(--m3); color: var(--m3-ink); }
.hex[data-bin="4"] .hex-in { background: var(--m4); color: var(--m4-ink); }
.hex:active { transform: scale(.95); }
.hex:focus-visible { outline: none; }
.hex:focus-visible::before { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .hex:hover { transform: scale(1.06); z-index: 3; } }
.hex[data-gov="duhok"] { left: 25%; top: 0; }
.hex[data-gov="erbil"] { left: 50%; top: 0; }
.hex[data-gov="nineveh"] { left: 12.5%; top: 15.789%; }
.hex[data-gov="kirkuk"] { left: 37.5%; top: 15.789%; }
.hex[data-gov="sulaymaniyah"] { left: 62.5%; top: 15.789%; }
.hex[data-gov="anbar"] { left: 0; top: 31.579%; }
.hex[data-gov="saladin"] { left: 25%; top: 31.579%; }
.hex[data-gov="diyala"] { left: 50%; top: 31.579%; }
.hex[data-gov="karbala"] { left: 12.5%; top: 47.368%; }
.hex[data-gov="baghdad"] { left: 37.5%; top: 47.368%; }
.hex[data-gov="wasit"] { left: 62.5%; top: 47.368%; }
.hex[data-gov="najaf"] { left: 0; top: 63.158%; }
.hex[data-gov="babil"] { left: 25%; top: 63.158%; }
.hex[data-gov="qadisiyyah"] { left: 50%; top: 63.158%; }
.hex[data-gov="maysan"] { left: 75%; top: 63.158%; }
.hex[data-gov="muthanna"] { left: 12.5%; top: 78.947%; }
.hex[data-gov="dhi_qar"] { left: 37.5%; top: 78.947%; }
.hex[data-gov="basra"] { left: 62.5%; top: 78.947%; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.legend[hidden] { display: none; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 14px; height: 10px; border-radius: 3px; background: var(--m0); }
.legend i[data-bin="1"] { background: var(--m1); }
.legend i[data-bin="2"] { background: var(--m2); }
.legend i[data-bin="3"] { background: var(--m3); }
.legend i[data-bin="4"] { background: var(--m4); }
.map-side { display: grid; gap: 14px; align-content: start; min-width: 0; }
.map-side h3 { font-size: 17px; margin: 0; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.stat-row li { padding: 14px 12px; border-radius: 12px; background: var(--surface); }
.stat-row b { display: block; font-size: 24px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-row span { font-size: 13px; color: var(--muted); }

.emp-band { background: var(--brand-soft); border-radius: 20px; padding: 24px; display: grid; gap: 16px; }
.emp-band h2 { font-size: 22px; margin: 0; }
.emp-band p { color: var(--muted); margin: 4px 0 0; }
.emp-band ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; color: var(--ink); }
.emp-band li { display: flex; gap: 8px; align-items: baseline; }
.emp-band li .bi { color: var(--ok); }
.emp-band .emp-acts { display: grid; gap: 10px; align-content: center; }
.seeker-points { display: grid; gap: 8px; margin: 14px 0 18px; padding: 0; list-style: none; }
.seeker-points li { display: flex; gap: 10px; align-items: baseline; }
.seeker-points .bi { color: var(--ok); }

.people { display: grid; gap: 10px; }
.person { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); }
.person .avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); font-weight: 700; overflow: hidden; }
.person .avatar img { width: 100%; height: 100%; object-fit: cover; }
.person b { display: block; font-weight: 700; }
.person small { color: var(--muted); }
.person .tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ============ JOBS LIST ============ */
.find-bar {
  position: sticky; top: calc(var(--head-h) + env(safe-area-inset-top, 0px)); z-index: 20;
  margin-inline: -16px; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.find-bar:has(.filters[open]) { position: static; }
.filters { margin-top: 10px; }
.filters summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: 15px;
}
.filters summary::-webkit-details-marker { display: none; }
.filters summary .count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; }
.filters[open] summary { background: var(--surface-2); }
.filter-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; padding-top: 14px; }
.filter-grid .mb-3 { margin-bottom: 12px !important; }
.filter-acts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.list-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; padding: 12px 2px; }
.list-head p { margin: 0; color: var(--muted); }
.list-head b { color: var(--ink); }
.browse { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.browse h2 { font-size: 19px; margin: 12px 0 0; }

/* ============ ONE JOB ============ */
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--muted); text-decoration: none; font-size: 15px; }
.back:hover { color: var(--ink); }
.job-top h1 { font-size: clamp(24px, 1.4rem + 1vw, 32px); margin: 0; }
.job-top .co { font-size: 17px; color: var(--muted); margin: 6px 0 0; }
.job-top .alt-title { color: var(--muted); margin: 2px 0 0; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.facts li { display: inline-block; padding: 5px 12px; line-height: 1.6; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 600; }
.facts .pay-tag { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.facts .is-closed { background: var(--err-bg); color: var(--err); }
.facts .is-open { background: var(--ok-bg); color: var(--ok); }
.when { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.job-grid { display: grid; gap: 28px; margin-top: 20px; }
.job-main { display: grid; gap: 24px; min-width: 0; align-content: start; }
.job-main h2 { font-size: 19px; margin: 0 0 8px; }
.job-body { white-space: pre-line; max-width: 68ch; overflow-wrap: anywhere; }
.side { display: grid; gap: 14px; align-content: start; min-width: 0; }
.box { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 12px; background: var(--bg); }
.box h2 { font-size: 17px; margin: 0; display: flex; align-items: center; gap: 8px; }
.box p { margin: 0; }
.box .btn { width: 100%; }
.box-send { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.box-send h2 .bi { color: var(--ok); }
.done { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-radius: var(--r-sm); background: var(--ok-bg); color: var(--ok); font-weight: 600; font-size: 15px; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 15px; }
.kv dt { font-weight: 400; color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.co-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 2px 12px; align-items: center; }
.co-card .company-initial { grid-row: span 2; margin: 0; }
.co-card b { font-size: 16px; }
.co-card small { color: var(--muted); }
details.report { border: 0; }
details.report summary { cursor: pointer; list-style: none; color: var(--muted); font-size: 15px; display: inline-flex; gap: 8px; align-items: center; min-height: 44px; }
details.report summary::-webkit-details-marker { display: none; }
details.report form { display: grid; gap: 10px; margin-top: 4px; }
.share-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.share-row .btn { width: 100%; }
/* The main action stays under the thumb on phones */
.apply-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 90;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 95%, transparent); border-top: 1px solid var(--line);
}
.apply-bar .btn { width: 100%; min-height: 54px; font-size: 17px; }
.apply-bar-note { text-align: center; font-size: 13px; color: var(--muted); margin: 6px 0 0; }
/* A page with its own action bar hides the tab bar (older browsers without :has() show the action bar on top of it) */
body:has(.apply-bar) { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
body:has(.apply-bar) .tabbar { display: none; }
/* On phones the apply bar already shows this button, so the side box does not repeat it */
@media (max-width: 899.98px) { body:has(.apply-bar) .side .in-apply-bar { display: none; } }

/* ============ CV EXAMPLE (an A4 CV scaled to fit; app.js sets --fit) ============ */
.cv-sample { margin-inline: auto; max-width: 595px; }
.cv-sample-frame { position: relative; aspect-ratio: 794 / 640; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; box-shadow: var(--shadow, 0 8px 24px rgba(15, 23, 42, .08)); }
.cv-sample-frame iframe { position: absolute; top: 0; inset-inline-start: 0; width: 794px; height: 1123px; border: 0; transform: scale(var(--fit, .44)); transform-origin: top left; pointer-events: none; }
[dir="rtl"] .cv-sample-frame iframe { transform-origin: top right; }
/* Only the top of the page is shown; it fades out where the empty part of the A4 page starts */
.cv-sample-frame::after { content: ""; position: absolute; inset: auto 0 0; height: 18%; background: linear-gradient(rgba(255, 255, 255, 0), #fff); }
.cv-sample figcaption { margin-top: 8px; text-align: center; font-size: 13px; color: var(--muted); }

/* ============ CV BUILDER PAGE ============ */
.cv-hero { padding-block: 24px 8px; }
.cv-hero .hero-in { align-items: center; }
.points { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.points li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 2px 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); }
.points .bi { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); font-size: 19px; }
.points h3 { font-size: 16px; margin: 0; }
.points p { color: var(--muted); font-size: 15px; margin: 0; }
.cta-end { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 32px 16px; border-radius: 20px; background: var(--brand-soft); }
.cta-end h2 { margin: 0; }
.cta-end .btn { min-width: min(100%, 320px); }

/* ============ SIGN IN AND FORMS ============ */
.auth { max-width: 460px; margin-inline: auto; padding-block: 24px 40px; }
.auth h1 { font-size: clamp(24px, 1.3rem + 1vw, 30px); margin: 0 0 6px; }
.auth .auth-sub { color: var(--muted); margin: 0 0 20px; }
.auth .btn-primary, .auth button[type="submit"] { width: 100%; }
.auth-alt { margin: 18px 0 0; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); }
.auth-card { display: grid; }
.auth-card > form .btn[type="submit"] { margin-top: 4px; }
.choice.is-main { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.choice-list { display: grid; gap: 12px; }
.choice { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 2px 14px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; }
.choice:hover { color: var(--ink); border-color: var(--brand); }
.choice:active { background: var(--surface); }
.choice > .bi:first-child { grid-column: 1; grid-row: 1 / span 2; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); font-size: 22px; }
.choice b { grid-column: 2; grid-row: 1; font-size: 17px; }
.choice small { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 14px; }
.choice .go { grid-column: 3; grid-row: 1 / span 2; color: var(--muted); font-size: 18px; }

/* ============ WIDE SCREENS ============ */
@media (min-width: 600px) {
  .auth { padding-top: 40px; }
  .auth-card { padding: 28px; border: 1px solid var(--line); border-radius: 20px; }
  .filter-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tpl-gallery { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); overflow: visible; margin: 0; padding: 0; }
  .emp-band { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 32px 36px; }
  .menu-sheet { align-items: center; padding: 24px; }
  .menu-panel { width: min(100%, 440px); border-radius: 20px; animation: popIn .22s ease-out; padding-top: 12px; }
  .menu-panel::before { display: none; }
  .points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jobs-cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  :root { --head-h: 68px; --bar-h: 0px; }
  .head-nav { display: flex; gap: 2px; margin-inline-start: 20px; }
  .head-nav a { padding: 8px 12px; border-radius: var(--r-sm); text-decoration: none; font-weight: 600; font-size: 15px; color: var(--muted); white-space: nowrap; }
  .head-nav a:hover { color: var(--ink); background: var(--surface); }
  .head-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
  .desk { display: inline-flex !important; }
  .phone-only { display: none !important; }
  .icon-btn, .pill-btn:not(.is-primary) { border-color: transparent; }
  .tabbar, .apply-bar { display: none; }
  body:has(.apply-bar) { padding-bottom: 0; }
  .logo img { height: 38px; }

  .hero { padding-block: 56px 32px; }
  .hero-in { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
  .hero-lead { font-size: 19px; margin-top: 16px; }
  .hero-acts { display: flex; flex-wrap: wrap; max-width: none; }
  .hero-acts .btn { width: auto; white-space: nowrap; }
  .hero-paper { height: auto; padding: 36px; -webkit-mask-image: none; mask-image: none; border-radius: 22px; }
  .hero-paper a { max-width: 380px; }
  .tpl-pick { justify-content: center; flex-wrap: wrap; margin: 0; padding-inline: 0; overflow: visible; }
  .find { padding-top: 48px; }
  .find form { grid-template-columns: minmax(0, 1fr) 220px; align-items: center; }
  .vac { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
  .hexmap { width: min(100%, 420px); }
  .hex-in b { font-size: 20px; }
  .hex-in span { font-size: 13px; }
  .section { padding-block: 64px; }
  .page { padding-block: 36px 64px; }
  .jobs-page { max-width: 880px; }
  .find-bar { margin-inline: 0; padding-inline: 0; }
  .filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .job-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
  .side { position: sticky; top: calc(var(--head-h) + 24px); }
  .faq-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px 56px; align-items: start; }
  .foot-in { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px 48px; align-items: start; }
  .foot-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; border-top: 0; }
  .foot-group { border-bottom: 0; }
  .foot-group summary { min-height: 0; margin-bottom: 4px; cursor: default; pointer-events: none; }
  .foot-group summary .bi { display: none; }
  .foot-col ul { padding: 0; }
  .foot-bottom { grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid var(--line); }
  .chip-row { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; overflow: visible; }
  .points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .menu-sheet { align-items: flex-start; justify-content: flex-end; padding: calc(var(--head-h) + 8px) 24px 24px; }
}

/* Narrow desktops and tablets on their side: a tighter header (About moves to the footer, Register into the login page) */
@media (min-width: 900px) and (max-width: 1199px) {
  .head-nav { margin-inline-start: 8px; }
  .head-nav a { padding: 8px 9px; font-size: 14.5px; }
  .head-nav .nav-extra, .head-tools .is-primary.desk { display: none !important; }
  .head-account .dropdown-toggle > span { display: none; }
  .l-long { display: none; }
  .l-short { display: inline; }
  .logo img { height: 34px; }
}

/* ============ MOTION ============ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes swapIn { from { opacity: .15; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============ PRINT ============ */
@media print {
  .site-head, .tabbar, .apply-bar, .site-foot, .menu-sheet { display: none !important; }
  body { padding: 0; }
}
