/* Auth page logo is hidden. The element stays in the DOM: rules below use it
   (body:has(img[src="assets/logo.svg"])) to scope styles to the auth pages. */
div:has(> img[src="assets/logo.svg"]) {
  display: none;
}

/* Agent icon: YaKlass book instead of the lucide Feather fallback (agents without avatar) */
svg.lucide-feather {
  background: url('yaklass-book.svg') center / contain no-repeat;
  stroke: none;
}
svg.lucide-feather > * {
  display: none;
}

/* Dark theme (class "dark" on <html>, set by the theme switcher): logo with white letters */
.dark img[src="assets/logo.svg"] {
  content: url('yaklass-logo-dark.svg');
}

/* "Log in with YaKlass" button: centered like the "Continue" button above it, same height and font */
a[data-testid="openid"] {
  justify-content: center;
  height: 48px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 14px;
  font-weight: 500;
}
a[data-testid="openid"] img {
  width: 24px;
  height: 18px;
}

/* Auth page font as on go.yaklass.ru: Montserrat (variable, weights 100-900, SIL OFL 1.1,
   see fonts/Montserrat-OFL.txt), self-hosted cyrillic and latin subsets */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/montserrat-cyrillic.woff2') format('woff2');
  unicode-range: U+301, U+400-45F, U+490-491, U+4B0-4B1, U+2116;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/montserrat-latin.woff2') format('woff2');
  unicode-range: U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Only the auth pages: they are the ones with the logo */
body:has(img[src="assets/logo.svg"]),
body:has(img[src="assets/logo.svg"]) :is(h1, h2, p, a, button, input, label, span, div) {
  font-family: 'Montserrat', sans-serif;
}

/* Auth pages as on go.yaklass.ru. Scope: pages with the logo (login, register, reset) */

/* Title: size, weight and color of "Вход или регистрация" (color in light theme only) */
body:has(img[src="assets/logo.svg"]) main h1 {
  font-size: 36px;
  line-height: 40px;
  font-weight: 600;
}
/* One line on wide screens: the title may extend past the card, which clips its content */
@media (min-width: 480px) {
  main > div:has(a[data-testid="openid"]) {
    overflow: visible;
  }
  body:has(img[src="assets/logo.svg"]) main h1 {
    white-space: nowrap;
    margin-inline: -60px;
  }
}
html:not(.dark) body:has(img[src="assets/logo.svg"]) main h1 {
  color: rgba(30, 37, 40, 0.8);
}

/* Primary button: green of the "Войти" button */
[data-testid="login-button"],
[data-testid="login-button"]:hover {
  background-color: #25b567;
  color: #fff;
}

/* Separator "Or" -> "ИЛИ" (the text is hardcoded in SocialLoginRender) */
main div.relative.uppercase > div.absolute {
  font-size: 0;
}
main div.relative.uppercase > div.absolute::after {
  content: 'ИЛИ';
  font-size: 12px;
}

/* Order: "Войти через ЯКласс" first, then the separator, then email and password */
main > div:has(a[data-testid="openid"]) {
  display: flex;
  flex-direction: column;
}
main > div:has(a[data-testid="openid"]) > * {
  order: 4;
}
main > div:has(a[data-testid="openid"]) > h1 {
  order: 0;
}
main > div:has(a[data-testid="openid"]) > :has(a[data-testid="openid"]) {
  order: 1;
}
main > div:has(a[data-testid="openid"]) > div.relative.uppercase {
  order: 2;
}
/* Spacer under the separator is not needed: 24px above and below "или" */
main > div:has(a[data-testid="openid"]) > div.mt-8:empty {
  display: none;
}

/* Account menu: hide "Help" (LibreChat links and shortcuts) and "My files" - always rendered
   by AccountSettings, no config switch. Matched by the item icon. */
.account-settings-popover [role="menuitem"]:has(> svg.lucide-circle-help),
.account-settings-popover [role="menuitem"]:has(> svg.lucide-file-text) {
  display: none;
}

/* Model selector: MVP has one agent (modelSpecs), nothing to choose. With modelSelect: false
   the selector still renders the spec button, so hide the button itself. */
[data-testid="model-selector-button"] {
  display: none;
}
