/* مُعقّب — shared tokens and components.
   Thmanyah is used when it is installed. To self-host it, add @font-face
   rules for "Thmanyah Sans" pointing at files in /static/fonts/.
   IBM Plex Sans Arabic (OFL, fonts/OFL.txt) ships as the fallback. */

@font-face {
  font-family: "Plex Arabic";
  src: local("IBM Plex Sans Arabic"), url("/static/fonts/plex-arabic-arabic-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Plex Arabic";
  src: local("IBM Plex Sans Arabic Medium"), url("/static/fonts/plex-arabic-arabic-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Plex Arabic";
  src: local("IBM Plex Sans Arabic Bold"), url("/static/fonts/plex-arabic-arabic-700.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Plex Arabic";
  src: url("/static/fonts/plex-arabic-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plex Arabic";
  src: url("/static/fonts/plex-arabic-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plex Arabic";
  src: url("/static/fonts/plex-arabic-latin-700.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --cream: #f5f1e8;
  --sand: #ebe2d0;
  --sand-2: #e0d3ba;
  --paper: #fffdf8;
  --ink: #22252a;
  --ink-2: #4b4740;
  --ink-3: #6e665c;
  --stone: #b8afa3;
  --line: #e2d9c8;
  --line-2: #d3c8b4;
  --crimson: #b4182d;
  --crimson-deep: #8f1124;
  --crimson-tint: #f7e0df;
  --green: #2d6a4f;
  --green-tint: #dcebe1;
  --amber: #8a5a00;
  --amber-tint: #f6e7c3;
  --blue: #2a5885;
  --blue-tint: #dfe8f1;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --shadow-sm: 0 1px 2px rgba(34, 37, 42, 0.06);
  --shadow: 0 1px 2px rgba(34, 37, 42, 0.05), 0 10px 28px rgba(34, 37, 42, 0.08);
  --shadow-lg: 0 2px 6px rgba(34, 37, 42, 0.06), 0 28px 60px rgba(34, 37, 42, 0.16);
  --font: "Thmanyah Sans", "Thmanyah", "Plex Arabic", "IBM Plex Sans Arabic", "Noto Sans Arabic", Tajawal, system-ui, sans-serif;
  --display: "Thmanyah Serif Display", "Thmanyah Sans", "Plex Arabic", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: var(--font);
  font-size: 100%;
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  font-weight: 400;
  overflow-wrap: break-word;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--crimson);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--crimson); color: #fff; }

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  top: -5rem;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
}
.skip:focus { top: 0.75rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* —— icons —— */

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon.flip { transform: scaleX(-1); }

/* —— buttons —— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.15rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--crimson); color: #fff; box-shadow: 0 6px 16px rgba(180, 24, 45, 0.22); }
.btn-primary:hover { background: var(--crimson-deep); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-2); padding-inline: 0.7rem; }
.btn-ghost:hover { background: rgba(34, 37, 42, 0.06); color: var(--ink); }
.btn-quiet { background: var(--paper); border-color: var(--line-2); color: var(--ink); }
.btn-quiet:hover { border-color: var(--ink); }
.btn-danger { background: transparent; border-color: var(--crimson); color: var(--crimson); }
.btn-danger:hover { background: var(--crimson); color: #fff; }

.btn-sm { min-height: 2.25rem; padding: 0.35rem 0.85rem; font-size: 0.9rem; }
.btn-lg { min-height: 3.35rem; padding: 0.75rem 1.6rem; font-size: 1.08rem; }
.btn-block { width: 100%; }

/* —— form fields —— */

.field { display: grid; gap: 0.35rem; }
.field + .field { margin-top: 0.9rem; }
.field label, .label {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
}
.hint { color: var(--ink-3); font-size: 0.86rem; }

.input,
input[type="text"], input[type="password"], input[type="number"], input[type="search"], input[type="url"],
input[type="email"], input[type="tel"], input:not([type]),
textarea, select {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
textarea { resize: vertical; min-height: 5.5rem; line-height: 1.6; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(34, 37, 42, 0.08);
}
input::placeholder, textarea::placeholder { color: #9b9286; }

.error {
  color: var(--crimson-deep);
  font-weight: 700;
  font-size: 0.9rem;
  min-height: 1.4em;
}
.error:empty { min-height: 0; }

/* —— pills and status —— */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.5;
  background: var(--sand);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill .icon { width: 1em; height: 1em; stroke-width: 2.4; }
.pill.is-applied { background: var(--green-tint); color: var(--green); }
.pill.is-held { background: var(--amber-tint); color: var(--amber); }
.pill.is-blocked { background: var(--crimson-tint); color: var(--crimson-deep); }
.pill.is-waiting { background: var(--ink); color: #fff; }
.pill.is-interview { background: var(--blue-tint); color: var(--blue); }
.pill.is-working, .pill.is-searched, .pill.is-check { background: var(--sand); color: var(--ink-2); }
.pill.is-active { background: var(--green-tint); color: var(--green); }
.pill.is-pending { background: var(--amber-tint); color: var(--amber); }
.pill.is-suspended, .pill.is-paused { background: var(--crimson-tint); color: var(--crimson-deep); }

.dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.dot.live { background: #2f9e64; box-shadow: 0 0 0 0 rgba(47, 158, 100, 0.5); animation: live 2s infinite; }
.dot.off { background: var(--crimson); }

@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(47, 158, 100, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(47, 158, 100, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 158, 100, 0); }
}

/* —— the rubber stamp —— */

.stamp {
  --stamp: var(--crimson);
  display: inline-grid;
  place-items: center;
  width: 5.6rem;
  height: 5.6rem;
  padding: 0.4rem;
  border: 3px double var(--stamp);
  border-radius: 50%;
  color: var(--stamp);
  font-weight: 800;
  font-size: 0.82rem;
  line-height: 1.15;
  text-align: center;
  transform: rotate(-12deg);
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5.5px var(--stamp);
  opacity: 0.92;
  mix-blend-mode: multiply;
  user-select: none;
}
.stamp small { display: block; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; opacity: 0.85; }
.stamp.green { --stamp: var(--green); }
.stamp.sm { width: 4.1rem; height: 4.1rem; font-size: 0.68rem; border-width: 2.5px; box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4.5px var(--stamp); }

/* —— the eqal: two black bands —— */

.eqal {
  display: grid;
  gap: 5px;
  width: 100%;
}
.eqal::before, .eqal::after {
  content: "";
  height: 7px;
  border-radius: 999px;
  background: var(--ink);
}

/* —— paper slip with a folded corner —— */

.slip {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  clip-path: polygon(0 0, calc(100% - 0px) 0, 100% 0, 100% 100%, 0 100%, 0 18px, 18px 0);
}
.slip::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, transparent 50%, var(--sand-2) 50%);
  border-bottom-right-radius: 4px;
}

/* —— avatar —— */

.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--sand);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--line-2);
}

/* —— brand mark —— */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand img {
  /* the peek: the mascot looking over his desk line; wide, so size it by height */
  width: auto;
  height: 2.5rem;
  display: block;
}

/* —— small "simple" pages from the server —— */

body.simple {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.simple-card {
  width: min(28rem, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  display: grid;
  justify-items: center;
  gap: 1rem;
}
.simple-card img { width: 11rem; height: auto; margin-top: -0.5rem; transform: rotate(-3deg); }
.simple-card h1 { font-family: var(--display); font-size: 2rem; font-weight: 800; line-height: 1.2; }
.simple-card .sub { color: var(--ink-2); margin-top: -0.5rem; }
.simple-card .sub:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
