/* auth.css — страницы входа/регистрации/восстановления. Тёмная/светлая/кремовая — через токены styles.css. */
.auth-wrap{
  min-height:calc(100vh - 0px);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:40px 16px 60px;
}
.auth-card{
  width:min(440px,100%);
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:16px;
  padding:28px 26px;
  box-shadow:0 10px 40px rgba(0,0,0,.12);
}
.auth-title{margin:0 0 4px;font-size:22px;font-weight:700;color:var(--text)}
.auth-sub{margin:0 0 22px;font-size:13.5px;color:var(--muted)}
.auth-form .field{margin-bottom:16px}
.auth-form .field label{display:block;font-weight:600;font-size:12.5px;margin-bottom:6px;color:var(--muted)}
.auth-form .field input{
  width:100%;font:inherit;font-size:14px;padding:11px 13px;border:1px solid var(--border);
  border-radius:9px;background:var(--bg);color:var(--text);box-sizing:border-box;
}
.auth-form .field input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(99,102,241,.15)}
.auth-form .field .hint{margin-top:5px;font-size:11.5px;color:var(--muted)}
.auth-form .field.invalid input{border-color:var(--danger)}
.auth-form .field .err{margin-top:5px;font-size:11.5px;color:var(--danger);font-weight:600}
.auth-submit{margin-top:6px;width:100%;padding:12px;font-size:15px;border-radius:10px}
.auth-switch{text-align:center;margin-top:20px;font-size:13px;color:var(--muted)}
.auth-switch a{color:var(--accent);font-weight:600;text-decoration:none}
.auth-switch a:hover{text-decoration:underline}
.auth-alert{
  margin:0 0 16px;padding:11px 14px;border-radius:9px;font-size:13px;line-height:1.45;
  border:1px solid var(--border);background:var(--bg);color:var(--text);
}
.auth-alert.ok{border-color:#16a34a;background:rgba(22,163,74,.08);color:#15803d}
.auth-alert.bad{border-color:var(--danger);background:rgba(220,38,38,.08);color:var(--danger)}
.auth-alert.warn{border-color:#d97706;background:rgba(217,119,6,.08);color:#b45309}
:root[data-theme="dark"] .auth-alert.ok{color:#4ade80}
:root[data-theme="dark"] .auth-alert.warn{color:#fbbf24}
.auth-topbar-back{display:inline-flex;align-items:center;gap:6px;color:var(--muted);text-decoration:none;font-size:13px;font-weight:600}
.auth-topbar-back:hover{color:var(--accent)}
.auth-loading{display:flex;align-items:center;justify-content:center;min-height:180px;color:var(--muted);font-size:14px}
@media (max-width:520px){
  .auth-card{padding:22px 18px;border-radius:14px}
  .auth-title{font-size:20px}
}

/* скрыть body защищённых страниц до проверки сессии (anti-flash) */
html[data-gate="pending"] body{visibility:hidden}
html[data-gate="pending"] .auth-loading{visibility:visible}

/* чип юзера + выход в шапке защищённых страниц */
.auth-user{display:inline-flex;align-items:center;gap:10px;margin-left:10px}
.auth-user-nick{
  font-size:13px;font-weight:600;color:var(--text);text-decoration:none;
  padding:5px 11px;border:1px solid var(--border);border-radius:20px;background:var(--bg);
  max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  display:inline-block;
}
.auth-user-nick:hover{border-color:var(--accent);color:var(--accent)}
.auth-logout{font-size:12.5px;font-weight:600;color:var(--muted);text-decoration:none}
.auth-logout:hover{color:var(--danger)}
.auth-user-link{font-size:12.5px;font-weight:600;color:var(--muted);text-decoration:none}
.auth-user-link:hover{color:var(--accent)}

/* состояние загрузки кнопки */
.auth-submit.loading{opacity:.7;cursor:wait}
.auth-submit.loading::after{content:'…'}