/*
 * Hindi / Gujarati text, the language switch and page tours (15/10/2026). Loaded after
 * erp-theme.css, in its tokens. The Enamel Portal's public/css/i18n.css is the same idea.
 *
 * The Noto faces carry a unicode-range, so a browser downloads one only when the page actually
 * holds Devanagari or Gujarati letters: an English page costs nothing extra, and a Hindi page
 * fetches about 50 KB once. Self-hosted (OFL, public/fonts/noto/OFL.txt): the ERP is locked to
 * the office IP, and one less outside host is one less thing to fail there.
 */
@font-face {
  font-family: 'Noto Sans Devanagari';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/noto/noto-devanagari-400.woff2') format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF;
}
@font-face {
  font-family: 'Noto Sans Devanagari';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../fonts/noto/noto-devanagari-600.woff2') format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF;
}
@font-face {
  font-family: 'Noto Sans Gujarati';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/noto/noto-gujarati-400.woff2') format('woff2');
  unicode-range: U+0951-0952, U+0964-0965, U+0A80-0AFF, U+200C-200D, U+25CC, U+A830-A839;
}
@font-face {
  font-family: 'Noto Sans Gujarati';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../fonts/noto/noto-gujarati-600.woff2') format('woff2');
  unicode-range: U+0951-0952, U+0964-0965, U+0A80-0AFF, U+200C-200D, U+25CC, U+A830-A839;
}

/* IBM Plex has no Indian scripts, so the browser takes those letters from Noto, glyph by glyph. */
:root {
  --display: 'IBM Plex Sans Condensed', 'Noto Sans Devanagari', 'Noto Sans Gujarati', ui-sans-serif, system-ui, sans-serif;
  --body: 'IBM Plex Sans', 'Noto Sans Devanagari', 'Noto Sans Gujarati', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Devanagari and Gujarati sit taller (matras above, conjuncts below). Uppercase and wide
   letter-spacing mean nothing in either script and pull the letters out of their joined words
   (the Enamel Portal's section headings read "ए न ा लि टि क्स" until this went in). */
html[lang="hi"] body, html[lang="gu"] body { line-height: 1.6; }
html[lang="hi"] body *, html[lang="gu"] body * { letter-spacing: normal !important; }

/* ---- ENG | हिंदी | ગુજરાતી ---- */
.lang-switch {
  display: inline-flex;
  align-items: stretch;
  flex: none;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.lang-switch button {
  background: transparent;
  border: 0;
  color: var(--on-navy-dim, var(--ink-2));
  cursor: pointer;
  font: 600 var(--t-xs)/1 var(--body);
  padding: 0 var(--s2);
  min-height: 30px;
  white-space: nowrap;
}
.lang-switch button + button { border-left: 1px solid var(--line); }
.lang-switch button:hover { color: var(--accent); }
.lang-switch button[aria-pressed="true"] { background: var(--accent-deep); color: var(--on-accent); cursor: default; }
.lang-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* A phone header has no room for three full names: two letters each, the full name on hover. */
.lang-switch .lang-short { display: none; }
@media (max-width: 900px) {
  .lang-switch .lang-full { display: none; }
  .lang-switch .lang-short { display: inline; }
}

/* On the sign-in page the switch sits on the form panel, not the dark header. */
.signin-lang { display: flex; justify-content: flex-end; margin-bottom: var(--s4); }
.signin-lang .lang-switch button { color: var(--ink-2); }

/* ---- "?" - this page's tour ---- */
.tour-help { position: relative; display: inline-flex; flex: none; }
.tour-help-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--navy-2);
  color: var(--accent);
  font: 700 var(--t-md)/1 var(--body);
  cursor: pointer;
}
.tour-help-btn:hover { border-color: var(--accent); }
.tour-help-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tour-menu {
  display: block;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: var(--z-palette, 1200);
  min-width: 220px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  box-shadow: var(--e3, 0 8px 24px rgba(0, 0, 0, .25));
  padding: var(--s1);
  font: 400 var(--t-sm)/1.5 var(--body);
}
.tour-menu[hidden] { display: none; }
.tour-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink);
  font: 500 var(--t-sm)/1.4 var(--body);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.tour-menu button:hover, .tour-menu button:focus-visible { background: var(--surface-alt); outline: none; }

/* Driver.js popover in the ERP's colours, both themes. Above the fixed header and the menu. */
.driver-overlay { z-index: 10000 !important; }
.driver-active-element { z-index: 10001 !important; }
.driver-popover.erp-tour {
  z-index: 10002 !important;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  max-width: 340px;
  font-family: var(--body);
}
.driver-popover.erp-tour .driver-popover-title { font: 600 var(--t-md)/1.4 var(--body); color: var(--ink); }
.driver-popover.erp-tour .driver-popover-description { font: 400 var(--t-sm)/1.6 var(--body); color: var(--ink-2); }
.driver-popover.erp-tour .driver-popover-progress-text { color: var(--ink-3, var(--ink-2)); }
.driver-popover.erp-tour .driver-popover-arrow-side-left.driver-popover-arrow,
.driver-popover.erp-tour .driver-popover-arrow-side-right.driver-popover-arrow,
.driver-popover.erp-tour .driver-popover-arrow-side-top.driver-popover-arrow,
.driver-popover.erp-tour .driver-popover-arrow-side-bottom.driver-popover-arrow { border-color: transparent; }
.driver-popover.erp-tour .driver-popover-arrow-side-left { border-left-color: var(--surface); }
.driver-popover.erp-tour .driver-popover-arrow-side-right { border-right-color: var(--surface); }
.driver-popover.erp-tour .driver-popover-arrow-side-top { border-top-color: var(--surface); }
.driver-popover.erp-tour .driver-popover-arrow-side-bottom { border-bottom-color: var(--surface); }
.driver-popover.erp-tour .driver-popover-footer { flex-wrap: wrap; gap: 6px; }
.driver-popover.erp-tour .driver-popover-footer button {
  background: var(--surface-alt);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  text-shadow: none;
  font: 600 var(--t-sm)/1.2 var(--body);
  padding: 7px 11px;
  border-radius: var(--r-sm);
}
.driver-popover.erp-tour .driver-popover-next-btn { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--on-accent); }
.driver-popover.erp-tour .tour-never { background: transparent; border-style: dashed; color: var(--ink-2); margin-right: auto; }
.driver-popover.erp-tour .driver-popover-close-btn { color: var(--ink-2); }
