/* DeepGI look for the Authelia login portal. Authelia 4.39 takes its colours from these variables, so the brand is
   applied by overriding them: same palette as frontend/src/index.css (neutral dark by default, purple on white). */

@font-face {
  font-family: "IBM Plex Sans Thai";
  font-weight: 400;
  font-display: swap;
  src: url("/auth-theme/fonts/ibm-plex-sans-thai-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "IBM Plex Sans Thai";
  font-weight: 600;
  font-display: swap;
  src: url("/auth-theme/fonts/ibm-plex-sans-thai-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "IBM Plex Sans Thai";
  font-weight: 400;
  font-display: swap;
  src: url("/auth-theme/fonts/ibm-plex-sans-thai-thai-400-normal.woff2") format("woff2");
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "IBM Plex Sans Thai";
  font-weight: 600;
  font-display: swap;
  src: url("/auth-theme/fonts/ibm-plex-sans-thai-thai-600-normal.woff2") format("woff2");
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
}

/* Authelia puts data-theme on the page and again on an inner wrapper, so both are covered. */
:root[data-theme],
:root [data-theme] {
  color-scheme: dark;
  --font-sans: "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, sans-serif;
  --radius: 0.5rem;
  --background: #0b0f14;
  --foreground: #e8eef4;
  --card: #121922;
  --card-foreground: #e8eef4;
  --popover: #121922;
  --popover-foreground: #e8eef4;
  --primary: #a78bf0;
  --primary-foreground: #100c24;
  --muted: #121922;
  --muted-foreground: #8d9aab;
  --accent: #1c2530;
  --accent-foreground: #e8eef4;
  --border: #243140;
  --input: #243140;
  --ring: #a78bf0;
  --custom-icon: #a78bf0;
}
:root[data-deepgi="light"][data-theme],
:root[data-deepgi="light"] [data-theme] {
  color-scheme: light;
  --background: #fcfbff;
  --foreground: #181238;
  --card: #ffffff;
  --card-foreground: #181238;
  --popover: #ffffff;
  --popover-foreground: #181238;
  --primary: #6d4fd0;
  --primary-foreground: #ffffff;
  --muted: #ffffff;
  --muted-foreground: #6a638c;
  --accent: #f1eefc;
  --accent-foreground: #181238;
  --border: #e5e0fa;
  --input: #e5e0fa;
  --ring: #6d4fd0;
  --custom-icon: #6d4fd0;
}

html[data-theme],
html[data-theme] body,
:root [data-theme] {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
}

/* The form sits in a panel, like the cards in the app. */
[id$="-stage"] > div {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2rem;
}

/* DeepGI mark and name instead of the generic person icon. */
#UserSvg {
  display: none;
}
div:has(> #UserSvg)::before {
  content: "";
  display: block;
  height: 3rem;
  background: url("/auth-theme/deepgi.svg") center / contain no-repeat;
}
div:has(> #UserSvg)::after {
  content: "DeepGI";
  display: block;
  margin-top: 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
[id$="-stage"] h5 {
  font-size: 0.95rem;
  color: var(--muted-foreground);
}

/* Inputs and the button: the app's shapes. */
[id$="-stage"] input[data-slot="floating-input"] {
  border-radius: 0.5rem;
  background: var(--background);
}
[id$="-stage"] button[data-slot="button"][data-variant="default"] {
  height: 2.75rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: none;
}
[id$="-stage"] button[data-slot="button"][data-variant="default"]:hover {
  background: color-mix(in srgb, var(--primary) 88%, transparent);
}
[id$="-stage"] a[href*="authelia.com"] {
  color: var(--muted-foreground);
  opacity: 0.6;
}
