/* ===========================================================================
   auth.css — авторизация: страница входа (/login) + виджет в шапке.

   В той же теме/стиле, что и основной сайт: переменные из theme.css,
   переключаются по [data-theme].
   =========================================================================== */

/* --- Страница входа -------------------------------------------------------- */
.auth-page {
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-card__logo {
  font-size: 28px;
  line-height: 1;
  color: var(--accent);
  text-align: center;
  margin-bottom: 2px;
}

.auth-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

.auth-card__error {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12.5px;
  text-align: center;
}

.auth-card__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-card__label {
  font-size: 12px;
  color: var(--text-muted);
}

.auth-card__input {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  outline: none;
  /* UA-виджеты инпутов — в теме сайта (не системной), см. map.css */
  color-scheme: light;
}

.auth-card__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

[data-theme="dark"] .auth-card__input { color-scheme: dark; }

.auth-card__submit {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  cursor: pointer;
  margin-top: 4px;
}

.auth-card__submit:hover { filter: brightness(1.07); }
.auth-card__submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.auth-card__back {
  font-size: 12px;
  color: var(--text-faint);
  text-decoration: none;
  text-align: center;
}

.auth-card__back:hover { color: var(--text-muted); }

/* --- Виджет в шапке (правее значка темы) ---------------------------------- */
.auth-widget { position: relative; }

.auth-widget__login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.auth-widget__btn { display: inline-flex; align-items: center; justify-content: center; }

/* Меню — position: fixed (координаты выставляет JS по кнопке):
   у body overflow:hidden под layout карты, absolute-меню внутри topbar
   обрезалось бы шапкой. */
.auth-widget__menu {
  position: fixed;
  min-width: 180px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  z-index: 2100; /* выше topbar (1000) и панелей карты */
}

.auth-widget__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.auth-widget__role {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.auth-widget__logout {
  display: block;
  font-size: 12.5px;
  color: var(--danger);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  text-decoration: none;
  text-align: center;
}

.auth-widget__logout:hover {
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}
