/* Shared design tokens + primitives (public site & HR portal). Brand from care.org.eg. */
[data-mode="production"] .demo-only { display: none !important; }

:root {
  --brand: #E36F1E;          /* CARE orange: decorative / large text */
  --brand-strong: #B4520D;   /* orange for white-text buttons & small text (5:1) */
  --brand-soft: #FCE9DA;
  --gold: #F4B223;
  --gold-soft: #FDF1D3;
  --teal: #0E6B63;           /* volunteer accent */
  --teal-soft: #DDF0EC;
  --c-staff: #E36F1E;          /* type colours: jobs / internships / volunteering */
  --c-intern: #F4B223;
  --c-vol: #19A08F;
  --cream: #F7F2E7;
  --ink: #1F2328;
  --ink-2: #4A5058;
  --ink-3: #6B7280;
  --line: #E6DFD0;
  --line-2: #EEE9DE;
  --card: #FFFFFF;
  --bg: #FFFDF9;
  --success: #15803D;
  --success-soft: #DCFCE7;
  --danger: #B91C1C;
  --danger-soft: #FEE2E2;
  --info: #1D4ED8;
  --info-soft: #DBEAFE;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(31, 35, 40, .06), 0 1px 1px rgba(31, 35, 40, .04);
  --shadow-2: 0 10px 30px -12px rgba(31, 35, 40, .18), 0 2px 6px rgba(31, 35, 40, .05);
  --shadow-3: 0 24px 60px -20px rgba(31, 35, 40, .35);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Fira Sans Condensed', 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0 0 1em; }
a { color: var(--brand-strong); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { flex: none; vertical-align: middle; }
.muted { color: var(--ink-2); }

/* Buttons */
.btn { --h: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: var(--h); padding: 0 1.1rem; border-radius: 999px; border: 1.5px solid transparent; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; transition: transform .15s var(--ease), background-color .2s, border-color .2s, box-shadow .2s, color .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-sm { --h: 38px; padding: 0 .9rem; font-size: .88rem; }
.btn-primary { background: var(--brand-strong); color: #fff; box-shadow: 0 6px 16px -6px rgba(180, 82, 13, .55); }
.btn-primary:hover { background: #9C450A; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: #0A5650; }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: 0 6px 16px -6px rgba(244, 178, 35, .7); }
.btn-gold:hover { background: #E5A00F; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); background: #fff; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #FECACA; }
.btn-icon { --h: 40px; width: 40px; padding: 0; background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-icon:hover { color: var(--ink); border-color: var(--ink-3); }
.btn-icon.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.loading { pointer-events: none; position: relative; color: transparent !important; }
.btn.loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-ghost.loading::after { border-color: var(--line); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: 0 .85rem; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-size: .87rem; font-weight: 500; color: var(--ink-2); cursor: pointer; transition: all .18s var(--ease); }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.is-on, .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Pills/badges */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill-orange { background: var(--brand-soft); color: #8A3E09; }
.pill-teal { background: var(--teal-soft); color: var(--teal); }
.pill-gold { background: var(--gold-soft); color: #7A5200; }
.pill-green { background: var(--success-soft); color: var(--success); }
.pill-red { background: var(--danger-soft); color: var(--danger); }
.pill-blue { background: var(--info-soft); color: var(--info); }
.pill-dark { background: var(--ink); color: #fff; }

/* Forms */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; position: relative; }
.field label, .field .label { font-weight: 600; font-size: .88rem; color: var(--ink); }
.field label em, .field .label em { color: var(--brand-strong); font-style: normal; }
.field small { font-weight: 400; color: var(--ink-3); }
.field input:not([type=checkbox]):not([type=radio]):not([type=range]), .field select, .field textarea, .sub-row input {
  min-height: 46px; padding: .6rem .85rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; transition: border-color .2s, box-shadow .2s; width: 100%;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .sub-row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(227, 111, 30, .15); }
.field.has-error input, .field.has-error select, .field.has-error textarea, .field.has-error .tag-input, .field.has-error .dropzone { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .82rem; font-weight: 500; margin: 0; min-height: 0; }
.field-error:empty { display: none; }
.hint { align-self: flex-end; font-size: .78rem; }
input[type=range] { accent-color: var(--brand-strong); width: 100%; min-height: 32px; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem; color: var(--ink-2); cursor: pointer; margin: .25rem 0 1rem; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand-strong); flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.radio-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.radio-pills label { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 .9rem; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 500; font-size: .87rem; color: var(--ink-2); transition: all .18s; }
.radio-pills input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pills label:has(input:checked) { background: var(--ink); color: #fff; border-color: var(--ink); }
.radio-pills label:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }

/* Avatars */
.av { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: #8A3E09; font-weight: 700; font-size: .78rem; flex: none; }
.av.lg { width: 52px; height: 52px; font-size: 1rem; }
.av.teal { background: var(--teal-soft); color: var(--teal); }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }

/* Toasts */
#toasts { position: fixed; z-index: 1000; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast { display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow-3); font-size: .92rem; opacity: 0; transform: translateY(12px) scale(.98); transition: all .25s var(--ease); pointer-events: auto; }
.toast.in { opacity: 1; transform: none; }
.toast-success .ico { color: #86EFAC; }
.toast-error { background: #7F1D1D; }

.wordmark { font-family: var(--display); font-weight: 700; color: var(--brand); letter-spacing: .02em; font-size: 1.1rem; }
.wordmark b { font-size: 1.4rem; margin-right: .2rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.av.gold { background: var(--gold-soft); color: #7A5200; }

/* Direction arrows mirror in right-to-left pages. `scale` (not transform) so hover nudges don't undo it. */
[dir=rtl] .ico.dir-flip { scale: -1 1; }
