.auth {
  --au-bg: #fff; --au-soft: #f5f6f8; --au-line: #dfe2e7; --au-text: #25272b; --au-muted: #7a8089; --au-accent: #1c95f3;
  position: fixed; inset: 0; z-index: 99990; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(12, 14, 18, .72); opacity: 0; overflow-y: auto; transition: opacity .18s ease;
}
html.dark-mode .auth { --au-bg: var(--dm-surface); --au-soft: var(--dm-surface-2); --au-line: var(--dm-border-strong); --au-text: var(--dm-text); --au-muted: var(--dm-muted); --au-accent: var(--dm-accent); }
.auth[hidden] { display: none; }
.auth.is-visible { opacity: 1; }
html.auth-open { overflow: hidden; }

.auth-dialog { position: relative; display: grid; grid-template-columns: 340px minmax(0, 1fr); width: 100%; max-width: 820px; margin: auto; border-radius: 18px; background: var(--au-bg); color: var(--au-text); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); overflow: hidden; transform: translateY(14px) scale(.98); transition: transform .18s ease; }
.auth.is-visible .auth-dialog { transform: none; }

.auth-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--au-soft); color: var(--au-muted); font-size: 22px; line-height: 34px; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.auth-close:hover { background: var(--au-line); color: var(--au-text); }

.auth-visual { position: relative; display: flex; align-items: center; justify-content: center; min-height: 520px; background-color: #5b4640; background-position: center; background-size: cover; }
.auth-visual::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at center, rgba(20, 16, 14, .62), rgba(20, 16, 14, .3) 75%); }
.auth-visual-text { position: relative; padding: 28px; color: #fff; text-align: center; }
.auth-visual-logo { display: block; width: 190px; height: auto; margin: 0 auto; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45)); user-select: none; }

.auth-panels { padding: 36px 36px 30px; }
.auth-panel[hidden] { display: none; }
.auth-header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding-right: 30px; }
.auth-title { margin: 0; color: var(--au-text); font: 800 22px/1.2 "Exo", sans-serif; text-transform: none; }
.auth-subtitle { margin: 4px 0 0 !important; color: var(--au-muted) !important; font-size: 13.5px !important; line-height: 1.4 !important; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; margin: 0; font-weight: 400; }
.auth-field > span:first-child { color: var(--au-text); font: 700 12px "Exo", sans-serif; }
.auth-field small { color: var(--au-muted); font-size: 11.5px; line-height: 1.4; }
.auth input[type="text"], .auth input[type="email"], .auth input[type="password"] { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--au-line); border-radius: 10px; background: var(--au-bg); color: var(--au-text); font: 400 14px "Roboto", sans-serif; transition: border-color .15s ease, box-shadow .15s ease; }
.auth input[type="text"]:focus, .auth input[type="email"]:focus, .auth input[type="password"]:focus { border-color: var(--au-accent); box-shadow: 0 0 0 3px rgba(28, 149, 243, .18); outline: 0; }
.auth-captcha { display: flex; align-items: center; gap: 10px; }
.auth-captcha img { flex: 0 0 auto; height: 44px; width: auto; border-radius: 10px; }

.auth-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; color: var(--au-muted); font-size: 12.5px; font-weight: 400; line-height: 1.5; cursor: pointer; }
.auth-check input { flex: 0 0 auto; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--au-accent); }
.auth-check a, .auth-switch a, .auth-link { color: var(--au-accent); font-weight: 700; }

.auth-submit { height: 46px; margin-top: 4px; border: 0; border-radius: 10px; background: var(--au-accent); color: #fff; font: 700 14px "Exo", sans-serif; cursor: pointer; transition: filter .15s ease, transform .15s ease; }
.auth-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.auth-link { align-self: center; font-size: 12.5px; }
.auth-switch { margin: 20px 0 0 !important; padding-top: 18px; border-top: 1px solid var(--au-line); color: var(--au-muted) !important; font-size: 13px !important; text-align: center; }
.auth .login-notice { margin-bottom: 14px !important; }

@media screen and (max-width: 760px) {
  .auth { padding: 12px; }
  .auth-dialog { grid-template-columns: minmax(0, 1fr); max-width: 440px; }
  .auth-visual { min-height: 120px; }
  .auth-visual-logo { width: 120px; }
  .auth-visual-text { padding: 16px 20px; }
  .auth-panels { padding: 24px 20px 22px; }
  .auth-row { grid-template-columns: minmax(0, 1fr); }
}
.auth label, .auth label span, .auth small { letter-spacing: 0; text-transform: none; }
.auth .auth-check input[type="checkbox"] { position: static; display: inline-block; opacity: 1; visibility: visible; appearance: auto; -webkit-appearance: checkbox; pointer-events: auto; }
.auth-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-options .auth-check { align-items: center; color: var(--au-text); font-size: 13px; }
.auth-options .auth-check input { margin: 0; }
