/*
 * HiringPlatform design tokens
 * ----------------------------------------------------------------------------
 * The single source of colour, type, spacing, radius and elevation values.
 * components.css and every candidate page use these custom properties only;
 * never write a raw colour, size or font name in a component.
 *
 * Identity (restyle, product owner 28 November 2026; Noor's design/mockups/restyle/): the Education Leaders
 * Institute's colours, measured from its public site: teal #016166 (primary), deep green #00372A (deep
 * surfaces), bright green #00D47D (fills and graphics only, never text on white), ink #192335 (text). Tints,
 * hover and neutrals are derived from those four; status colours keep their AA pairs.
 *   - Typefaces (product owner, 22 November 2026): Cairo for Arabic pages and Open Sans for
 *     English pages, both SIL OFL 1.1, from Google Fonts and stored in design/fonts.
 *   - Shape: softer radii (10 px controls, 14 px cards, 20 px dialogs), a border for the edge and a low
 *     shadow to lift; motion from the --motion-* tokens, all of it off under prefers-reduced-motion.
 *
 * Contrast ratios for every text/background pair are listed in design/README.md.
 */

/* ---------------------------------------------------------------------------
 * Fonts: stored in design/fonts, never loaded from a third-party server, so
 * the product works offline. Paths are relative to this file. Each family is
 * one variable font (Cairo 200-1000, Open Sans 300-800) split by Google Fonts
 * into script subsets; unicode-range makes the browser fetch only the subsets
 * a page uses. Ranges copied unchanged from Google Fonts' CSS (see design/README.md).
 *
 * Cairo's own vertical metrics (ascent 1.303 em, descent 0.571 em) are much
 * taller than its letters (about 0.94 em above the baseline, 0.44 em below).
 * At the back office's 1.35 line height that pushed descenders below the line
 * box, where an ellipsis or overflow hidden clipped them, and made text sit low
 * in buttons. The overrides below (HP-044) describe the letters instead, so
 * the line box holds them and they sit centred. Browsers without the
 * descriptors keep the font's own metrics.
 * ------------------------------------------------------------------------- */
@font-face {
  font-family: "Cairo";
  src: url("fonts/Cairo-Arabic.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
  ascent-override: 100%;
  descent-override: 55%;
  line-gap-override: 0%;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: "Cairo";
  src: url("fonts/Cairo-LatinExt.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
  ascent-override: 100%;
  descent-override: 55%;
  line-gap-override: 0%;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Cairo";
  src: url("fonts/Cairo-Latin.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
  ascent-override: 100%;
  descent-override: 55%;
  line-gap-override: 0%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Open Sans";
  src: url("fonts/OpenSans-LatinExt.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Open Sans";
  src: url("fonts/OpenSans-Latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* ---- Colour: brand (measured, restyle) -------------------------------- */
  --brand-teal: #016166;
  --brand-deep: #00372A;
  --brand-green: #00D47D;
  --brand-ink: #192335;

  /* ---- Colour: neutrals (cool, a touch of the teal) --------------------- */
  --color-canvas: #F3F6F6;          /* page background */
  --color-surface: #FFFFFF;         /* cards, header, footer, inputs */
  --color-surface-raised: #FFFFFF;  /* menus, dialogs */
  --color-surface-sunken: #EDF1F2;  /* disabled controls, skeletons, neutral badge */
  --color-border: #E2E8EA;          /* decorative dividers and card edges */
  --color-border-strong: #7C8A90;   /* input and select borders (3.6:1 on surface) */

  --color-ink: #192335;             /* body text, headings (the brand ink) */
  --color-ink-muted: #4B5568;       /* secondary text, metadata */
  --color-ink-subtle: #626C7E;      /* hints, placeholders */
  --color-ink-disabled: #5E6878;    /* text on --color-surface-sunken */
  --color-on-deep: #FFFFFF;         /* text on --color-primary-strong */
  --color-on-deep-muted: #B9D9D6;   /* secondary text on --color-primary-strong */

  /* ---- Colour: primary (derived from #016166) --------------------------- */
  --color-primary-50: #EAF4F4;
  --color-primary-100: #D3E8E8;
  --color-primary-200: #A6D0D1;
  --color-primary-300: #6FB1B3;
  --color-primary-500: #1A7C80;
  --color-primary: #016166;         /* primary buttons, links, brand mark (7.2:1 on white) */
  --color-primary-hover: #014D51;
  --color-primary-strong: #00372A;  /* deep surfaces: sign-in panel, hero band, back-office app bar */
  --color-primary-subtle: #EAF4F4;  /* selected and soft-highlight backgrounds */
  --color-on-primary: #FFFFFF;

  /* ---- Colour: accent (derived from #00D47D): fills and graphics only, never text on white (1.96:1) */
  --color-accent: #00D47D;
  --color-accent-soft: #C9F5E1;
  --color-accent-subtle: #EBFBF4;
  --color-on-accent: #00372A;       /* 6.8:1 on the accent */

  /* ---- Colour: status ---------------------------------------------------
   * Each status has a text colour and a subtle background that pass AA
   * together, plus a solid colour for dots and icons.
   * Danger is for errors and failures only, never for a candidate outcome.
   */
  --color-info: #1D4E8A;
  --color-info-subtle: #E6EEF9;
  --color-success: #11613F;
  --color-success-subtle: #E3F6EC;
  --color-success-solid: #00A862;
  --color-warning: #7A4A00;
  --color-warning-subtle: #FDF2DC;
  --color-warning-solid: #D08C12;
  --color-danger: #A3221B;
  --color-danger-subtle: #FCEBE9;
  --color-danger-solid: #C8372D;
  --color-neutral: #3E4A55;
  --color-neutral-subtle: #EDF1F2;

  /* ---- Focus ------------------------------------------------------------ */
  --color-focus: #1D5FA8;           /* 6.45:1 on surface, 5.91:1 on canvas */
  --color-focus-on-dark: #A9F0CF;   /* on the deep green and other dark fills */
  --focus-ring-width: 3px;
  --focus-ring-offset: 2px;

  /* ---- Typography ------------------------------------------------------- */
  /* One family per page language (product owner, 22 November 2026). Arabic
     pages use Cairo for both scripts (it has a matching Latin); English pages
     use Open Sans, which has no Arabic, so Arabic text inside them (a name)
     falls back to Cairo. --font-family-base follows the nearest lang attribute:
     see the :lang rules below and "[lang]" in components.css. Keep the first
     names equal to FontFamilyArabic/FontFamilyEnglish in AdminTheme.cs. */
  --font-family-ar: "Cairo", "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif;
  --font-family-en: "Open Sans", "Cairo", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-family-base: var(--font-family-ar);
  --font-family-mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  /* Size scale (rem, 1rem = 16px). Body text is never smaller than --font-size-md. */
  --font-size-xs: 0.8125rem;   /* 13px  badges, captions */
  --font-size-sm: 0.875rem;    /* 14px  metadata, hints, errors */
  --font-size-md: 1rem;        /* 16px  body, inputs, buttons */
  --font-size-lg: 1.125rem;    /* 18px  card titles */
  --font-size-xl: 1.375rem;    /* 22px  section headings */
  --font-size-2xl: 1.75rem;    /* 28px  page titles */
  --font-size-3xl: 2.25rem;    /* 36px  hero title, desktop only */

  /* Arabic needs more vertical room for its ascenders, descenders and marks. */
  --line-height-tight: 1.35;
  --line-height-base: 1.6;
  --line-height-base-ar: 1.75;

  /* Letter spacing for one-time codes only. Digits never join, so this is safe
     for Western and Arabic-Indic digits; never apply letter spacing to Arabic words. */
  --tracking-code: 0.3em;

  /* ---- Spacing (4px grid) ---------------------------------------------- */
  --space-0: 0;
  --space-1: 0.25rem;  /*  4px */
  --space-2: 0.5rem;   /*  8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.5rem;   /* 24px */
  --space-6: 2rem;     /* 32px */
  --space-7: 2.5rem;   /* 40px */
  --space-8: 3rem;     /* 48px */
  --space-9: 4rem;     /* 64px */

  /* ---- Size ------------------------------------------------------------- */
  --size-control-height: 2.75rem;  /* 44px: buttons, inputs, selects (touch target) */
  --size-content-max: 72rem;       /* 1152px page container */
  --size-reading-max: 40rem;       /* 640px forms and long text */
  --size-page-gutter: var(--space-4);
  --size-header: 4rem;             /* 64px site header and back-office app bar */
  --size-sidebar: 16.5rem;         /* 264px back-office sidebar */
  --size-sidebar-collapsed: 4.75rem; /* 76px: icons only */
  --size-topbar: 4.25rem;          /* 68px back-office top bar */
  --size-card-pad: var(--space-5); /* 24px; 16px at 360 */
  --size-card-min: 18rem;          /* narrowest card in an auto-fill grid */
  --size-text-max: 32rem;          /* short centred text, e.g. empty states */
  --size-icon-sm: 1rem;            /* inline with small text */
  --size-icon-md: 1.25rem;         /* default, inside buttons */
  --size-icon-lg: 1.5rem;          /* alerts, navigation */
  --size-icon-xl: 3rem;            /* empty-state illustration */
  --size-brand-mark: 2rem;
  --size-dot: 0.5rem;              /* status dot in badges */
  --size-form-max: 28rem;          /* 448px single-task forms: sign in, enter a code */
  --size-code-input: 15rem;        /* one-time-code field: six digits at 2xl with code tracking */
  --size-step-marker: 1.5rem;      /* numbered circle in the steps component */
  --size-choice: 1.375rem;         /* 22px radio and checkbox (M3) */
  --size-date-day: 3.5rem;         /* date field: day, two digits */
  --size-date-month: 12rem;        /* date field: widest the month list grows */
  --size-date-year: 4.75rem;       /* date field: year, four digits */
  --size-dial-code: 7.5rem;        /* phone field: country code list */
  --size-progress: 0.5rem;         /* progress bar height */
  --size-aside: 20rem;             /* side column on wide pages (job details) */
  --size-doc-view: 40rem;          /* the CV shown beside the form: least height of its frame (M4) */
  --size-doc-page: 34rem;          /* the CV page drawn in mock-ups: a page's width at most */
  /* Breakpoints (custom properties cannot be used in media queries; keep in sync):
     48rem = 768px, tablet and up; 64rem = 1024px, desktop and up (M3: the
     application form lists its steps from here). */

  /* ---- Radius (restyle) ------------------------------------------------- */
  --radius-xs: 6px;    /* badges, chips */
  --radius-sm: 10px;   /* buttons, inputs, menu items */
  --radius-md: 14px;   /* cards, panels, table wrappers */
  --radius-lg: 20px;   /* dialogs, sign-in card, hero blocks */
  --radius-pill: 999px;

  /* ---- Border ----------------------------------------------------------- */
  --border-width: 1px;
  --border-width-strong: 2px;
  --border-width-accent: 4px;      /* the inline-start edge of an alert */

  /* ---- Elevation: soft and low; the border carries the edge, the shadow only lifts */
  --shadow-0: none;
  --shadow-1: 0 1px 2px rgb(25 35 53 / 0.05), 0 1px 3px rgb(25 35 53 / 0.06);           /* cards at rest */
  --shadow-2: 0 4px 10px -2px rgb(25 35 53 / 0.08), 0 2px 4px -2px rgb(25 35 53 / 0.05); /* menus, top bar on scroll */
  --shadow-hover: 0 12px 24px -10px rgb(1 97 102 / 0.22), 0 2px 6px -2px rgb(25 35 53 / 0.06); /* a card lifted */
  --shadow-3: 0 24px 48px -16px rgb(25 35 53 / 0.28);                                    /* dialogs */
  --shadow-focus: 0 0 0 3px rgb(1 97 102 / 0.18);                                         /* input focus halo, with the ring */

  /* ---- Motion -----------------------------------------------------------
   * Every transition and animation takes its timing from these. Under
   * prefers-reduced-motion they collapse to nothing (end of this file), and
   * nothing waits on an animation to be readable or usable. */
  --motion-duration-instant: 100ms;  /* button press, checkbox */
  --motion-duration-fast: 150ms;     /* hover colour, hover lift, focus halo */
  --motion-duration-base: 200ms;     /* tab underline, nav indicator, menus, tooltips */
  --motion-duration-slow: 300ms;     /* page and card enter, dialog, sidebar width, success tick */
  --motion-duration-count: 700ms;    /* stat count-up (runs once) */
  --motion-duration-shimmer: 1400ms; /* skeleton loop */
  --motion-duration-float: 6000ms;   /* sign-in illustration loop */

  --motion-ease-out: cubic-bezier(0.22, 0.8, 0.3, 1);     /* things arriving */
  --motion-ease-in-out: cubic-bezier(0.45, 0, 0.25, 1);   /* things moving across */
  --motion-ease-in: cubic-bezier(0.5, 0, 0.75, 0);        /* things leaving */
  --motion-ease-pop: cubic-bezier(0.3, 1.4, 0.6, 1);      /* the success tick's circle, a small overshoot */

  --motion-distance-sm: 4px;    /* hover lift, small items rising */
  --motion-distance-md: 10px;   /* cards and page sections rising in */
  --motion-distance-lg: 16px;   /* dialog and sheet travel */
  --motion-distance-float: 8px; /* illustration float amplitude */
  --motion-scale-press: 0.97;   /* button pressed */
  --motion-scale-dialog: 0.96;  /* dialog starts at */
  --motion-stagger: 45ms;       /* delay between list items (at most 8 staggered) */

  /* The earlier names, kept for what still uses them. */
  --duration-fast: var(--motion-duration-fast);
  --duration-base: var(--motion-duration-base);
  --easing-standard: var(--motion-ease-out);
}

:lang(en) {
  --font-family-base: var(--font-family-en);
}

:lang(ar) {
  --font-family-base: var(--font-family-ar);
  /* Cairo's 500 and 600 are barely heavier than its 400 (HP-044, checked in
     Chromium); its 700 is the first weight that reads as emphasis. So Arabic
     text uses one step heavier for the same role. English keeps 500 and 600. */
  --font-weight-medium: 600;
  --font-weight-semibold: 700;
}

@media (min-width: 48rem) {
  :root {
    --size-page-gutter: var(--space-6);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-duration-instant: 0ms;
    --motion-duration-fast: 0ms;
    --motion-duration-base: 0ms;
    --motion-duration-slow: 0ms;
    --motion-duration-count: 0ms;
    --motion-duration-shimmer: 0ms;
    --motion-duration-float: 0ms;
    --motion-stagger: 0ms;
    --motion-distance-sm: 0px;
    --motion-distance-md: 0px;
    --motion-distance-lg: 0px;
    --motion-distance-float: 0px;
    --motion-scale-press: 1;
    --motion-scale-dialog: 1;
  }

  /* Whatever a rule writes, nothing moves: animations end at their final frame, loops stop. */
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}
