/* auth.css - login / invite / re-auth screens for the SB cabinet (UULC).
   Components only; the palette comes entirely from tokens.css (T01). Dark theme
   by default, light via :root[data-theme="light"]. No color literals here except
   the neutral white brand-plate (the client logo asset assumes a light ground)
   and low-opacity black/white for soft depth. No massive shadows (spec s.23). */

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 50% -12%, var(--accent-wash), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.auth-shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---- card ---- */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  padding: 28px 28px 30px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .02) inset,
              0 12px 34px -20px rgba(0, 0, 0, .55);
}

/* ---- client brand (dominant, spec s.5.1) ---- */
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.auth-plate {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  line-height: 0;
  box-shadow: 0 8px 22px -16px rgba(0, 0, 0, .5);
}
.auth-plate-img {
  height: 54px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  display: block;
}
.auth-word {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.auth-word span {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.15;
}
.auth-clientsub {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  max-width: 34ch;
  line-height: 1.4;
}

/* ---- heading ---- */
.auth-head { margin-bottom: 18px; text-align: center; }
.auth-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
}
.auth-sub { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }

/* ---- messages ---- */
.msg {
  padding: 10px 13px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.msg-err {
  color: var(--crit);
  background: color-mix(in srgb, var(--crit) 14%, transparent);
  border-color: color-mix(in srgb, var(--crit) 34%, transparent);
}
.msg-ok {
  color: var(--good);
  background: color-mix(in srgb, var(--good) 14%, transparent);
  border-color: color-mix(in srgb, var(--good) 34%, transparent);
}

/* ---- form ---- */
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.field input {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field input::placeholder { color: var(--faint); }
.field input:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.btn-primary {
  margin-top: 4px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s ease, transform .04s ease;
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- misc text ---- */
.auth-hint { margin: 2px 0 0; font-size: 12px; color: var(--faint); line-height: 1.45; }
.auth-login-badge {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.auth-login-badge b { color: var(--text); font-weight: 600; }
.auth-alt { margin: 8px 0 0; text-align: center; font-size: 13px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---- footer: developer brand (secondary, XVISION) ---- */
.auth-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.auth-dev {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.auth-dev-label {
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
}
/* XVISION — тот же белый PNG, что в кабинете; CSS-кроп прозрачных полей,
   пропорционально масштабирован до ~14px (как было у SVG). */
.auth-dev-logo {
  display: block;
  width: 110px; height: 14px;
  background: url("/static/brand/xvision_logo_white.png") no-repeat -14px -61px;
  background-size: 136px 136px;
  opacity: .85;
}
:root[data-theme="light"] .auth-dev-logo { filter: invert(1); opacity: .55; }
.auth-copy { margin: 0; font-size: 11px; color: var(--faint); text-align: center; }

/* ---- theme switch ---- */
.theme-switch {
  position: fixed;
  top: 16px;
  right: 16px;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.theme-switch button {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--muted);
  padding: 6px 8px;
  border-radius: 999px;
}
.theme-switch button svg { width: 15px; height: 15px; }
.theme-switch button.active { background: var(--accent); color: var(--on-accent); }
.theme-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 480px) {
  .auth-card { padding: 22px 18px 24px; }
  .auth-plate-img { height: 46px; }
}
