.auth-page {
  min-height: 100vh;
  background:
    linear-gradient(rgba(255, 255, 255, .86), rgba(255, 255, 255, .86)),
    repeating-linear-gradient(135deg, #dce6f2 0, #dce6f2 1px, transparent 1px, transparent 18px),
    #eef2f6;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 16px;
}

.auth-panel {
  width: min(100%, 440px);
  padding: 30px 28px 28px;
  border: 1px solid #dfe5eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(28, 39, 52, .11);
}

.auth-header { display: flex; align-items: flex-start; gap: 13px; }
.auth-brand {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--primary);
}
.auth-brand svg { width: 21px; height: 21px; }
.auth-header h1 { margin: 0; font-size: 1.42rem; }
.auth-header p { margin: 5px 0 0; color: var(--muted); }

.auth-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 25px 0 22px;
  padding: 4px;
  border-radius: 7px;
  background: #f3f5f7;
}

.auth-mode {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 5px;
  color: var(--primary);
  text-decoration: none;
}
.auth-mode:hover { color: var(--primary-hover); }
.auth-mode.is-active { color: #fff; background: var(--primary); box-shadow: 0 2px 6px rgba(8, 107, 250, .2); }
.auth-mode svg { width: 18px; height: 18px; }

.auth-form { display: grid; gap: 8px; }
.auth-help { margin: 0 0 13px; color: var(--muted); line-height: 1.55; }
.auth-form label { margin-top: 5px; color: #252c34; font-size: .88rem; font-weight: 700; }
.auth-form > input,
.password-field {
  width: 100%;
  height: 43px;
  border: 1px solid #ccd5df;
  border-radius: 5px;
  background: #fff;
}
.auth-form > input { padding: 0 12px; color: var(--ink); font: inherit; }
.auth-form > input:focus,
.password-field:focus-within { border-color: var(--primary); outline: 2px solid rgba(8, 107, 250, .12); }
.password-field { display: flex; align-items: center; }
.password-field input { min-width: 0; height: 100%; flex: 1; padding: 0 12px; border: 0; outline: 0; background: transparent; }
.password-field button { display: grid; width: 42px; height: 100%; place-items: center; border: 0; color: #687583; background: transparent; }
.password-field svg { width: 18px; height: 18px; }

.auth-submit {
  display: inline-flex;
  width: 100%;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  border: 1px solid var(--primary);
  border-radius: 5px;
  color: #fff;
  background: var(--primary);
  font: inherit;
  font-weight: 700;
}
.auth-submit:hover { background: var(--primary-hover); }
.auth-submit svg { width: 18px; height: 18px; }
.field-error { min-height: 18px; color: var(--danger); font-size: .78rem; }
.field-error:empty { display: none; }
.auth-error { display: flex; align-items: flex-start; gap: 8px; margin: 18px 0 0; padding: 10px 12px; border-left: 3px solid var(--danger); color: var(--danger); background: var(--danger-soft); font-size: .84rem; }
.auth-error svg { width: 17px; height: 17px; flex: 0 0 auto; }
.auth-error ul { margin: 0; padding-left: 18px; }
.auth-status { margin: 20px 0 0; padding: 10px 12px; color: var(--success); background: var(--success-soft); }
.code-input { font-family: Consolas, monospace !important; font-size: 1.35rem !important; letter-spacing: .35rem !important; text-align: center; }
.auth-secondary-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; font-size: .84rem; }
.auth-secondary-actions form { margin: 0; }
.auth-secondary-actions a,
.auth-text-button { border: 0; color: var(--primary); background: transparent; font: inherit; text-decoration: none; }
.auth-secondary-actions a:hover,
.auth-text-button:hover { color: var(--primary-hover); text-decoration: underline; }

@media (max-width: 520px) {
  .auth-shell { align-items: start; padding: 0; }
  .auth-panel { min-height: 100vh; padding: 26px 20px; border: 0; border-radius: 0; box-shadow: none; }
}