.auth-root {
  --auth-accent: var(--accent, #bf5700);
  --auth-accent-dark: var(--accent-dark, #984400);
  --auth-ink: var(--ink, #231e21);
  --auth-slate: var(--slate, #36454f);
  --auth-paper: var(--paper, #f6f5f2);
  --auth-line: var(--line, #e2e2dd);
  --auth-muted: var(--muted, #676d71);
  --auth-red: var(--red, #993e3d);
  --auth-green: var(--green, #246548);
  color: var(--auth-ink);
  font-family: var(--font, Aeonik, "Avenir Next", Avenir, "Segoe UI", sans-serif);
}

.auth-root[hidden] {
  display: none;
}

.auth-root *,
.auth-root *::before,
.auth-root *::after {
  box-sizing: border-box;
}

.auth-view {
  width: 100%;
}

.auth-panel {
  width: 100%;
}

.auth-title {
  margin: 0;
  color: var(--auth-ink);
  font-family: Trap, var(--font, sans-serif);
  font-size: clamp(27px, 5vw, 33px);
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1.15;
}

.auth-root .auth-intro {
  margin: 11px 0 26px;
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-root .auth-message {
  margin: -10px 0 20px;
  padding: 11px 13px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
}

.auth-message[hidden] {
  display: none;
}

.auth-message--error {
  border: 1px solid #e6c6c3;
  background: #fff2f0;
  color: var(--auth-red);
}

.auth-message--success {
  border: 1px solid #c8ddcf;
  background: #eef7f1;
  color: var(--auth-green);
}

.auth-form {
  display: grid;
  gap: 17px;
}

.auth-form--mfa {
  margin-top: 22px;
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field__label,
.auth-manual-key__label {
  color: var(--auth-slate);
  font-size: 11px;
  font-weight: 650;
}

.auth-root .auth-password-guidance {
  margin: -6px 0 0;
  color: var(--auth-muted);
  font-size: 10px;
  line-height: 1.5;
}

.auth-input {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  border: 1px solid #c9cdca;
  border-radius: 6px;
  background: #fff;
  color: var(--auth-ink);
  font: inherit;
  font-size: 14px;
}

.auth-input:focus-visible,
.auth-button:focus-visible,
.auth-link:focus-visible {
  outline: 3px solid rgb(191 87 0 / 38%);
  outline-offset: 3px;
}

.auth-input:focus {
  border-color: var(--auth-accent);
}

.auth-button,
.auth-link {
  min-height: 43px;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
}

.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid transparent;
}

.auth-button--primary {
  border-color: var(--auth-accent);
  background: var(--auth-accent);
  color: #fff;
}

.auth-button--primary:hover {
  border-color: var(--auth-accent-dark);
  background: var(--auth-accent-dark);
}

.auth-button--secondary {
  border-color: #cfd3d1;
  background: #fff;
  color: var(--auth-slate);
}

.auth-button:disabled,
.auth-link:disabled {
  cursor: wait;
  opacity: 0.58;
}

.auth-link {
  display: block;
  width: fit-content;
  min-height: 32px;
  margin: 14px auto 0;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--auth-accent-dark);
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-root .auth-access-note {
  margin: 25px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--auth-line);
  color: var(--auth-muted);
  font-size: 10px;
  line-height: 1.55;
  text-align: center;
}

.auth-mfa-setup {
  display: grid;
  gap: 16px;
}

.auth-qr {
  display: grid;
  place-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  background: #fff;
}

.auth-qr__image {
  display: block;
  width: min(220px, 100%);
  height: auto;
  aspect-ratio: 1;
}

.auth-manual-key {
  display: grid;
  gap: 7px;
  padding: 12px 13px;
  border-radius: 6px;
  background: #f3f3ef;
}

.auth-manual-key__value {
  overflow-wrap: anywhere;
  color: var(--auth-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  user-select: all;
}

.auth-progress {
  height: 3px;
  margin-top: 27px;
  overflow: hidden;
  border-radius: 3px;
  background: #e9e9e4;
}

.auth-progress::after {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--auth-accent);
  content: "";
  animation: auth-progress 1.15s ease-in-out infinite alternate;
}

@keyframes auth-progress {
  from { transform: translateX(-15%); }
  to { transform: translateX(155%); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-progress::after {
    width: 100%;
    animation: none;
  }
}

@media (max-width: 520px) {
  .auth-actions {
    grid-template-columns: 1fr;
  }
}
