/* Shared registration and recovery controls; scoped to avoid changing sign in. */
:root {
  --auth-ink: #10131a;
  --auth-muted: #565b65;
  --auth-paper: #faf7f0;
  --auth-rule: #d8d3cc;
  --auth-accent: #bd3652;
  --auth-error: #b42318;
}
#registerDiv {
  width: min(100%, 44rem);
  min-width: 0;
}
.auth-panel {
  width: 100%;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--auth-rule);
  border-radius: 16px;
  background: var(--auth-paper);
  color: var(--auth-ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}
.auth-panel *,
.auth-panel *::before,
.auth-panel *::after {
  box-sizing: border-box;
}
.auth-panel [hidden] {
  display: none !important;
}
.auth-panel h1,
.auth-panel h2 {
  margin: 0;
  color: var(--auth-ink);
  font: 700 clamp(24px, 3vw, 30px)/1.2 var(--font-sans);
  letter-spacing: -0.02em;
}
.auth-panel p {
  margin: 8px 0 24px;
  color: var(--auth-muted);
}
.auth-panel .auth-heading {
  margin-bottom: 24px;
}
.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.auth-field {
  min-width: 0;
}
.auth-field--wide {
  grid-column: 1 / -1;
}
.auth-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--auth-ink);
  font-size: 14px;
  font-weight: 600;
}
.auth-panel input:not([type="hidden"]),
.auth-panel select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--auth-rule);
  border-radius: 6px;
  background: #fff;
  color: var(--auth-ink);
  font: inherit;
}
.auth-panel input::placeholder {
  color: #65676d;
}
.auth-panel input[aria-invalid="true"] {
  border-color: var(--auth-error);
}
.auth-panel .auth-hint {
  display: block;
  margin: 8px 0 0;
  color: var(--auth-muted);
  font-size: 13px;
}
.auth-panel .auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.auth-panel button,
.auth-panel .auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid var(--auth-rule);
  border-radius: 6px;
  background: #fff;
  color: var(--auth-ink);
  font: 600 15px/1.4 var(--font-sans);
  cursor: pointer;
  text-decoration: none;
}
.auth-panel .auth-primary {
  background: var(--auth-accent);
  border-color: var(--auth-accent);
  color: #fff;
}
.auth-panel button:hover {
  border-color: var(--auth-accent);
}
.auth-panel .auth-primary:hover {
  background: #9f2942;
}
.auth-panel button:disabled {
  cursor: wait;
  opacity: 0.65;
}
.auth-panel :is(button, a, input, select):focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 3px;
  box-shadow: none;
}
.auth-panel .auth-status {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-left: 3px solid var(--auth-rule);
  background: #fff;
}
.auth-panel .auth-status:empty {
  display: none;
}
.auth-panel .auth-status[data-state="error"] {
  color: var(--auth-error);
  border-color: var(--auth-error);
}
.auth-panel .auth-status[data-state="success"] {
  color: #287a55;
  border-color: #287a55;
}
.auth-password {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.auth-panel .auth-password button {
  padding-inline: 12px;
}
.auth-panel .auth-back {
  background: transparent;
}
.auth-panel .auth-heading-row {
  display: flex;
  align-items: start;
  gap: 16px;
  justify-content: space-between;
}
.auth-panel .auth-close {
  flex: 0 0 44px;
  padding: 10px;
}
.auth-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
dialog.auth-panel {
  position: fixed;
  inset: 0;
  width: min(32rem, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 16px 48px rgb(0 0 0 / 24%);
}
dialog.auth-panel::backdrop {
  background: rgb(16 19 26 / 72%);
}
body:has(dialog.auth-panel[open]) {
  overflow: hidden;
}
.auth-standalone {
  display: grid;
  min-height: 100svh;
  place-items: center;
  margin: 0;
  padding: 24px 16px;
  background: #17212b;
}
.auth-standalone > .auth-panel {
  max-width: 44rem;
}
@media (max-width: 540px) {
  .auth-panel {
    padding: 24px 16px;
  }
  .auth-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-panel .auth-actions {
    flex-direction: column;
  }
  .auth-panel .auth-actions > * {
    width: 100%;
  }
  .auth-panel .auth-heading-row {
    gap: 8px;
  }
}
@media (max-height: 520px) {
  dialog.auth-panel {
    margin-block: 16px;
  }
}

.auth-actions .auth-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #c9c4d5;
  border-radius: 10px;
  background: #fff;
  color: #493762;
  font-weight: 600;
  text-decoration: none;
}
.auth-actions .auth-secondary:hover {
  background: #f2edf8;
}
.auth-actions .auth-secondary:focus-visible {
  outline: 3px solid #8158b5;
  outline-offset: 3px;
}
