/* IMB Careers — shared styles. Brand palette from the IMB colour guide; orange only on primary actions and accents. */
:root {
  --orange: #FE6F00; --orange-mid: #FEB47C; --orange-tint: #FFF1E6;
  --charcoal: #292929; --charcoal-dark: #4A4948; --charcoal-light: #838383;
  --bg: #F4F4F4; --surface: #FFFFFF; --surface-2: #F8F8F8; --line: #DADADA;
  --fg: var(--charcoal); --muted: #5E5E5E; --danger: #B42318; --ok: #1E7A46;
  --font: "Noto Sans", "Noto Sans Arabic", Arial, Helvetica, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15.5px; line-height: 1.55; padding-inline: 16px; padding-block: 0; min-height: 100vh; display: flex; flex-direction: column; }
html[lang="ar"] body { font-family: "Noto Sans Arabic", var(--font); font-size: 16.5px; }
[hidden] { display: none !important; }
.wrap { max-width: 980px; margin-inline: auto; width: 100%; }
.wrap.narrow { max-width: 820px; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; font-weight: 600; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0; }
.muted { color: var(--muted); } .small { font-size: 0.875rem; } .tiny { font-size: 0.8rem; }
a { color: var(--charcoal-dark); }
main { flex: 1; }

/* Header */
.site-header { background: var(--surface); margin-inline: -16px; padding-inline: 16px; border-bottom: 3px solid var(--orange); }
.site-header .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; flex-wrap: wrap; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.wordmark img { height: 38px; width: auto; display: block; }
.wordmark .tag { font-size: 0.8rem; color: var(--charcoal-light); }
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 600; font-size: 0.9rem; color: var(--charcoal-dark); }
.nav a:hover { color: var(--orange); }
.langs { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 3px; padding: 2px; }
.langs button { border: 0; background: transparent; color: var(--charcoal-dark); font: inherit; font-size: 0.85rem; font-weight: 600; padding: 5px 12px; cursor: pointer; border-radius: 2px; }
.langs button[aria-pressed="true"] { background: var(--charcoal); color: #fff; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .opt:focus-within, a:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* Page title + steps */
.page-title { padding-block: 22px 18px; display: grid; gap: 4px; }
.page-title .sub { color: var(--muted); max-width: 70ch; }
.steps { list-style: none; margin: 0; padding: 22px 0 6px; display: flex; font-size: 0.85rem; color: var(--charcoal-light); }
.steps li { display: flex; align-items: center; gap: 8px; padding-inline-end: 22px; }
.steps li + li::before { content: ""; width: 28px; height: 1px; background: var(--line); margin-inline-end: 14px; }
.steps .n { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 0.75rem; font-weight: 600; }
.steps li.current { color: var(--charcoal); font-weight: 600; }
.steps li.current .n { background: var(--orange); border-color: var(--orange); color: #fff; }
.steps li.done .n { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
@media (max-width: 560px) { .steps li span.lbl { display: none; } .steps li.current span.lbl { display: inline; } }

/* Panels, forms, buttons */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 3px; }
.panel-head { padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 1rem; }
.panel-body { padding: 20px; display: grid; gap: 16px; }
.stack { display: grid; gap: 18px; }
.list { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
label.field { display: grid; gap: 5px; font-size: 0.9rem; font-weight: 600; min-width: 0; }
label.field .req { color: var(--orange); }
label.field .hint { font-weight: 400; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--fg); background: #fff; border: 1px solid #BDBDBD; border-radius: 3px; padding: 9px 11px; width: 100%; min-width: 0; }
textarea { min-height: 84px; resize: vertical; }
input[type="file"] { padding: 7px; }
.btn { font: inherit; font-weight: 600; font-size: 0.95rem; border: 1px solid var(--orange); border-radius: 3px; padding: 10px 20px; cursor: pointer; background: var(--orange); color: #fff; text-decoration: none; display: inline-block; text-align: center; }
.btn:hover { background: #E86400; }
.btn.secondary { background: #fff; color: var(--charcoal); border-color: #BDBDBD; }
.btn.secondary:hover { background: var(--surface-2); }
.btn.small { padding: 6px 12px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.error { color: var(--danger); font-weight: 500; font-size: 0.9rem; }
.notice { background: var(--orange-tint); border: 1px solid var(--orange-mid); padding: 10px 14px; border-radius: 3px; font-size: 0.9rem; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { font: inherit; font-weight: 600; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 16px; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--charcoal); border-bottom-color: var(--orange); }

/* Positions */
.positions { display: grid; gap: 14px; }
.position-card { background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 20px 22px; display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: center; }
@media (max-width: 640px) { .position-card { grid-template-columns: 1fr; } }
.position-card h2 { font-size: 1.1rem; }
.position-card .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; color: var(--muted); }
.position-card .summary { grid-column: 1 / -1; color: var(--charcoal-dark); max-width: 75ch; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; border: 1px solid var(--line); background: var(--surface-2); color: var(--charcoal-dark); white-space: nowrap; }
.badge.received { background: #EEF2F7; } .badge.under_review { background: #FFF6E5; border-color: #F5D28A; }
.badge.shortlisted { background: var(--orange-tint); border-color: var(--orange-mid); color: #8A3B00; }
.badge.interview { background: #E8F1FF; border-color: #A9C8F5; color: #1B4F9C; }
.badge.offer { background: #E6F6EC; border-color: #9FD8B4; color: var(--ok); }
.badge.rejected, .badge.closed, .badge.withdrawn { background: #F2F2F2; color: var(--charcoal-light); }
.badge.open { background: #E6F6EC; border-color: #9FD8B4; color: var(--ok); }
.badge.draft { background: #FFF6E5; border-color: #F5D28A; }
/* tags on applications */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.tag-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; border: 1px solid var(--line); background: var(--surface-2); color: var(--charcoal-light); cursor: pointer; font-family: inherit; }
.tag-chip.on { background: var(--orange-tint); border-color: var(--orange); color: #8A3B00; }
td .tag-chip { cursor: default; margin: 1px 0; }
/* answer sheet marking */
.answer-row.ans-ok .chosen { color: var(--ok); } .answer-row.ans-part .chosen { color: #8A3B00; } .answer-row.ans-bad .chosen { color: #B3261E; }
.answer-row .pts { font-weight: 700; margin-left: 6px; white-space: nowrap; } .answer-row .ans-ok .pts, .answer-row.ans-ok .pts { color: var(--ok); } .answer-row.ans-part .pts { color: #8A3B00; } .answer-row.ans-bad .pts { color: #B3261E; }
.answer-row .best { color: var(--ok); } .answer-row .why { color: var(--charcoal-light); font-size: 0.86rem; }
.answer-row .ans-ok { color: var(--ok); } .answer-row .ans-part { color: #8A3B00; }
.key-sec { margin: 18px 0 6px; font-size: 1rem; }
.prose { max-width: 75ch; white-space: pre-line; }

/* Assessment */
.testbar { position: sticky; top: 0; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; margin-block: 8px 20px; }
.clock { font-weight: 700; font-size: 1.5rem; font-variant-numeric: tabular-nums; direction: ltr; line-height: 1.1; }
.clock-label { font-size: 0.72rem; color: var(--charcoal-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
html[lang="ar"] .clock-label, html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; }
.testbar.low .clock { color: var(--danger); }
.progress { text-align: end; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 4px; background: var(--line); border-radius: 2px; margin-top: 6px; width: 150px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--orange); width: 0; transition: width 0.2s; }
section.part { margin-block: 28px; display: grid; gap: 14px; }
.part-head { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 2px solid var(--charcoal); }
.eyebrow { font-size: 0.78rem; font-weight: 600; color: var(--charcoal-light); text-transform: uppercase; letter-spacing: 0.05em; }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 18px 20px; display: grid; gap: 12px; user-select: none; -webkit-user-select: none; }
.q.missing { border-color: var(--orange); }
.q-text { display: grid; grid-template-columns: 2.4em 1fr; gap: 4px; font-weight: 500; }
.q-text .num { color: var(--charcoal-light); font-variant-numeric: tabular-nums; }
.opts { display: grid; gap: 6px; }
.opt { display: grid; grid-template-columns: 18px 22px 1fr; gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; cursor: pointer; background: #fff; }
.opt:hover { border-color: var(--charcoal-light); }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt .radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #9A9A9A; margin-top: 3px; display: grid; place-items: center; }
.opt .radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.opt .letter { font-weight: 600; color: var(--charcoal-dark); font-size: 0.9rem; margin-top: 1px; }
.opt.on { border-color: var(--orange); background: var(--orange-tint); }
.opt.on .radio { border-color: var(--orange); } .opt.on .radio::after { background: var(--orange); }
.q textarea { user-select: text; -webkit-user-select: text; }
.count { font-size: 0.8rem; color: var(--charcoal-light); text-align: end; }

/* Tables (dashboard) */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--surface); }
table.data th, table.data td { text-align: start; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: var(--surface-2); font-weight: 600; font-size: 0.8rem; color: var(--charcoal-dark); white-space: nowrap; }
table.data tr.row:hover { background: var(--orange-tint); cursor: pointer; }
table.data td.num { font-variant-numeric: tabular-nums; text-align: end; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 0.9rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.drawer { position: fixed; inset: 0; background: rgba(41,41,41,0.45); z-index: 20; display: flex; justify-content: flex-end; }
.drawer .sheet { background: var(--surface); width: min(760px, 100%); height: 100%; overflow-y: auto; padding: 22px; display: grid; gap: 18px; align-content: start; }
.drawer .close { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; background: var(--surface); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.score { border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; background: var(--surface-2); }
.score b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.score span { font-size: 0.78rem; color: var(--muted); }
.answer-row { display: grid; grid-template-columns: 2.2em 1fr; gap: 6px; font-size: 0.88rem; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.answer-row .chosen { color: var(--charcoal-dark); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.toolbar label.field { font-size: 0.8rem; }
.toolbar select, .toolbar input { width: auto; min-width: 180px; }

footer { padding-block: 32px 24px; font-size: 0.8rem; color: var(--charcoal-light); display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }

.score.total { border-color: var(--orange); } .score.total b { color: #8A3B00; }
