.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + var(--sab));
  background:
    radial-gradient(60% 50% at 80% 0%, rgba(139, 92, 246, 0.18), transparent 70%),
    radial-gradient(50% 40% at 10% 100%, rgba(217, 70, 239, 0.12), transparent 70%),
    var(--bg);
  font-family: 'Arad', system-ui, sans-serif;
  color: var(--text);
}
.au-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: auIn 0.35s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
@keyframes auIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.au-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; text-decoration: none; color: var(--text); }
.au-brand img { width: 34px; height: 34px; border-radius: 9px; }
.au-brand b { font-size: 19px; font-weight: 800; }
.au-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 22px;
}
.au-tab {
  height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.au-tab[aria-selected='true'] { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.au-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.au-title { font-size: 20px; font-weight: 800; text-align: center; margin: 0 0 4px; }
.au-sub { font-size: 13px; color: var(--text-dim); text-align: center; margin: 0 0 22px; }
.au-alert {
  display: none;
  margin-bottom: 16px;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.1);
  color: #ffb4c0;
  font-size: 13px;
  line-height: 1.8;
}
.au-alert.show { display: block; animation: auShake 0.35s ease; }
@keyframes auShake { 20% { transform: translateX(6px); } 40% { transform: translateX(-6px); } 60% { transform: translateX(4px); } 80% { transform: translateX(-3px); } }
.au-field { margin-bottom: 16px; }
.au-field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }
.au-input-wrap { position: relative; }
.au-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.au-input[dir='ltr'] { text-align: left; }
.au-input.has-eye { padding-right: 48px; }
.au-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.au-field.invalid .au-input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15); }
.au-field.valid .au-input { border-color: rgba(52, 211, 153, 0.7); }
.au-eye {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 4px;
  width: 42px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.au-eye:hover { color: var(--text); }
.au-eye svg { width: 20px; height: 20px; }
.au-msg { min-height: 0; font-size: 12px; line-height: 1.7; margin-top: 6px; color: var(--text-faint); }
.au-msg:empty { display: none; }
.au-field.invalid .au-msg { color: #ff8fa1; }
.au-field.valid .au-msg { color: var(--ok); }
.au-caps { display: none; font-size: 12px; margin-top: 6px; color: #fbbf24; }
.au-caps.show { display: block; }
.au-meter { display: none; gap: 4px; margin-top: 8px; }
.au-meter.show { display: flex; }
.au-meter i { flex: 1; height: 4px; border-radius: 4px; background: var(--border-strong); transition: background 0.25s; }
.au-meter[data-level='1'] i:nth-child(1) { background: var(--danger); }
.au-meter[data-level='2'] i:nth-child(-n+2) { background: #f59e0b; }
.au-meter[data-level='3'] i:nth-child(-n+3) { background: #84cc16; }
.au-meter[data-level='4'] i { background: var(--ok); }
.au-meter-label { display: none; font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }
.au-meter-label.show { display: block; }
.au-hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
.ab-box {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  margin: 4px 0 18px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.2s;
}
.ab-box[data-state='done'] { border-color: rgba(52, 211, 153, 0.6); }
.ab-box[data-state='error'], .ab-box[data-state='network'], .ab-box.flag { border-color: var(--danger); }
.ab-main {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
  text-align: start;
}
.ab-main:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.ab-check {
  position: relative;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 8px;
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.ab-spin {
  display: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  animation: abSpin 0.7s linear infinite;
}
.ab-tick { display: none; width: 16px; height: 16px; color: #06281c; }
.ab-tick svg { width: 100%; height: 100%; display: block; }
.ab-box[data-state='solving'] .ab-spin { display: block; }
.ab-box[data-state='done'] .ab-check { background: var(--ok); border-color: var(--ok); }
.ab-box[data-state='done'] .ab-tick { display: block; }
.ab-box[data-state='error'] .ab-check, .ab-box[data-state='network'] .ab-check { border-color: var(--danger); }
@keyframes abSpin { to { transform: rotate(360deg); } }
.ab-brand { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-faint); white-space: nowrap; }
.ab-brand svg { width: 14px; height: 14px; }
.ab-bar { position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: transparent; }
.ab-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.15s linear; }
.au-submit {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font: inherit;
  font-size: 15.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.35);
}
.au-submit:hover:not(:disabled) { transform: translateY(-1px); }
.au-submit:active:not(:disabled) { transform: translateY(0); }
.au-submit:disabled { opacity: 0.65; cursor: wait; }
.au-submit:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.au-spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: abSpin 0.7s linear infinite; }
.au-submit.loading .au-spinner { display: block; }
.au-foot { text-align: center; font-size: 13px; color: var(--text-dim); margin: 18px 0 0; }
.au-foot a, .au-link { color: #c4b5fd; font-weight: 700; text-decoration: none; background: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
.au-foot a:hover, .au-link:hover { text-decoration: underline; }
@media (max-width: 440px) {
  .au-card { padding: 22px 16px 20px; border-radius: 18px; }
  .ab-brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .au-card, .au-alert.show { animation: none; }
}
