.auth-code-control { position: relative; }
.auth-form .auth-code-control input, .avs-security-dialog .auth-code-control input { padding-inline-end: 76px; }
.auth-code-paste { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); padding: 6px 9px; border: 1px solid rgba(127,127,127,.3); border-radius: 6px; background: transparent; color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
.auth-code-paste:focus-visible { outline: 2px solid #f3922c; outline-offset: 2px; }
.auth-code-paste:disabled { opacity: .6; cursor: wait; }
.auth-button-spinner { width: 16px; height: 16px; display: inline-block; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: avs-auth-spin .7s linear infinite; }
@keyframes avs-auth-spin { to { transform: rotate(360deg); } }
.auth-button:disabled, .auth-secondary:disabled { cursor: wait; opacity: .7; }
#main-content:has(.auth-view) {
  display: flex;
  flex-direction: column;
}

.auth-view {
  flex: 1;
  --auth-accent: #ff9c2e;
  --auth-warm: #ffc479;
  --auth-panel: color-mix(in srgb, var(--page) 90%, #17130e);
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(36px, 7vh, 76px) 20px;
  position: relative;
  overflow: hidden;
}

.auth-view::before,
.auth-view::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--auth-accent) 13%, transparent);
  border-radius: 50%;
  width: min(68vw, 680px);
  aspect-ratio: 1;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
}

.auth-view::after {
  width: min(50vw, 490px);
  border-color: color-mix(in srgb, var(--auth-accent) 8%, transparent);
}

.auth-layout {
  width: min(100%, 468px);
  position: relative;
  z-index: 1;
  animation: auth-arrive 420ms cubic-bezier(.2,.75,.25,1) both;
}

.auth-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.auth-kicker::before,
.auth-kicker::after {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--auth-accent);
  opacity: .7;
}

.auth-card {
  position: relative;
  padding: clamp(26px, 6vw, 42px);
  border: 1px solid color-mix(in srgb, var(--rule) 78%, var(--auth-accent));
  border-radius: 14px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--auth-accent) 5%, transparent), transparent 35%),
    var(--auth-panel);
  box-shadow: 0 28px 90px #0000002b, inset 0 1px 0 #ffffff08;
}

:root[data-theme="light"] .auth-card {
  background: #FFFFFF;
  box-shadow: 0 26px 70px #35475a14, inset 0 1px 0 #ffffffaa;
}

:root[data-theme="light"] .auth-link,
:root[data-theme="light"] .auth-note-mark,
:root[data-theme="light"] .auth-success-mark {
  color: #955000;
}

:root[data-theme="light"] .auth-link:hover {
  color: #713c00;
}

:root[data-theme="light"] .auth-status {
  color: #b13325;
}

:root[data-theme="light"] .auth-field input::placeholder {
  color: #66717e;
}

.auth-card::before {
  content: "";
  position: absolute;
  left: 42px;
  right: 42px;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--auth-accent), transparent);
  opacity: .75;
}

.auth-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(27px, 7vw, 35px);
  font-weight: 560;
  letter-spacing: -.045em;
  line-height: 1.1;
  text-align: center;
}

.auth-description {
  max-width: 340px;
  margin: 12px auto 26px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  text-align: center;
}

.auth-preview-note {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin: 0 0 24px;
  padding: 12px 13px;
  border: 1px solid color-mix(in srgb, var(--auth-accent) 24%, var(--rule));
  border-radius: 8px;
  background: color-mix(in srgb, var(--auth-accent) 6%, transparent);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.auth-preview-note strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
}

.auth-note-mark {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--auth-accent) 65%, transparent);
  border-radius: 50%;
  color: var(--auth-accent);
  font: 700 10px/1 Georgia, serif;
}

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

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

.auth-field label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .025em;
}

.auth-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  outline: none;
  background: var(--control);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.auth-field input::placeholder {
  color: color-mix(in srgb, var(--muted) 74%, transparent);
}

.auth-field input:hover {
  border-color: color-mix(in srgb, var(--muted) 65%, var(--rule));
}

.auth-field input:focus-visible {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-accent) 17%, transparent);
}

.auth-field input[aria-invalid="true"] {
  border-color: #d36e5c;
}

.auth-password {
  position: relative;
}

.auth-password input {
  padding-inline-end: 52px;
}

.auth-password-toggle {
  position: absolute;
  inset-inline-end: 3px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.auth-password-toggle:hover {
  color: var(--ink);
}

.auth-password-toggle:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: -3px;
}

.auth-eye-slash {
  display: none;
}

.auth-password-toggle[aria-pressed="true"] .auth-eye-slash {
  display: block;
}

.auth-inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -3px;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.auth-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--auth-accent);
}

.auth-link {
  color: var(--auth-accent);
  font-size: 12px;
  text-decoration: none;
  text-underline-offset: 4px;
}

.auth-link:hover {
  color: var(--auth-warm);
  text-decoration: underline;
}

.auth-link:focus-visible,
.auth-button:focus-visible,
.auth-back:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 3px;
}

.auth-button {
  min-height: 49px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  border: 1px solid var(--auth-accent);
  border-radius: 7px;
  background: var(--auth-accent);
  color: #17110a;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .025em;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.auth-button:hover {
  transform: translateY(-1px);
  border-color: var(--auth-warm);
  background: var(--auth-warm);
}

.auth-button:active {
  transform: translateY(0);
}

.auth-button .arrow {
  font-size: 17px;
  font-weight: 400;
}

.auth-choice {
  display: grid;
  gap: 10px;
  margin-top: 21px;
  padding-top: 19px;
  border-top: 1px solid var(--rule);
  text-align: center;
}

.auth-choice p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.auth-choice a {
  font-weight: 650;
}

.auth-secondary {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  border-radius: 7px;
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.auth-secondary:hover {
  border-color: color-mix(in srgb, var(--auth-accent) 50%, var(--rule));
  background: var(--control-hover);
}

.auth-progress {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 0 auto 23px;
}

.auth-progress span {
  width: 23px;
  height: 3px;
  border-radius: 2px;
  background: var(--rule);
}

.auth-progress span.is-current,
.auth-progress span.is-done {
  background: var(--auth-accent);
}

.auth-code {
  letter-spacing: .36em !important;
  font-variant-numeric: tabular-nums;
}

.auth-status {
  min-height: 18px;
  margin: -5px 0 0;
  color: #d77b67;
  font-size: 12px;
  line-height: 1.5;
}

.auth-status:empty {
  display: none;
}

.auth-email-context {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 19px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.auth-back:hover {
  color: var(--ink);
}

.auth-success-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 19px;
  border: 1px solid color-mix(in srgb, var(--auth-accent) 55%, var(--rule));
  border-radius: 50%;
  color: var(--auth-accent);
  font-size: 23px;
}

.auth-success-actions {
  display: grid;
  gap: 11px;
  margin-top: 25px;
}

.auth-footnote {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

@keyframes auth-arrive {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  .auth-view {
    padding: 34px 16px;
    align-items: start;
  }

  .auth-layout {
    margin-block: auto;
  }

  .auth-card {
    padding: 29px 22px;
  }

  .auth-card::before {
    left: 24px;
    right: 24px;
  }

  .auth-inline-row {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-layout {
    animation: none;
  }
}

.auth-field-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.auth-terms {
  align-items: flex-start;
  line-height: 1.5;
}

.auth-terms input {
  margin-top: 1px;
  flex-shrink: 0;
}

.auth-inline-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--auth-accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.auth-terms-dialog {
  --auth-accent: #ff9c2e;
  --auth-warm: #ffc479;
  --auth-panel: color-mix(in srgb, var(--page) 80%, #221a10);
  width: min(92vw, 640px);
  max-height: min(86vh, 760px);
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--auth-accent) 35%, transparent);
  border-radius: 16px;
  background: var(--auth-panel);
  box-shadow: 0 28px 90px #00000080;
  color: var(--ink);
  overflow: hidden;
}

.auth-terms-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.auth-terms-dialog::backdrop {
  background: #000000a6;
  backdrop-filter: blur(4px);
}

.auth-terms-tabs {
  display: flex;
  gap: 6px;
  padding: 14px 22px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--auth-accent) 18%, transparent);
}

.auth-terms-tabs button {
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.auth-terms-tabs button[aria-selected="true"] {
  color: var(--auth-accent);
  border-bottom-color: var(--auth-accent);
}

.auth-terms-tabs button:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: -2px;
}

.auth-terms-body {
  padding: 18px 22px 8px;
  overflow-y: auto;
  min-height: 0;
}

.auth-terms-body:focus {
  outline: none;
}

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

.auth-terms-body h2 {
  margin: 0;
  font-size: 20px;
}

.auth-terms-body h3 {
  margin: 4px 0 14px;
  font-size: 15px;
}

.auth-terms-body h4 {
  margin: 20px 0 8px;
  font-size: 14px;
  color: var(--auth-accent);
}

.auth-terms-body p,
.auth-terms-body li {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.auth-terms-body ol,
.auth-terms-body ul {
  margin: 0 0 12px;
  padding-inline-start: 22px;
}

.auth-terms-body li {
  margin-bottom: 6px;
}

.auth-terms-body strong {
  color: var(--ink);
}

.auth-terms-body hr {
  margin: 16px 0;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--auth-accent) 18%, transparent);
}

.auth-terms-actions {
  padding: 14px 22px 20px;
  border-top: 1px solid color-mix(in srgb, var(--auth-accent) 18%, transparent);
}

.auth-terms-required[open] {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.auth-terms-intro {
  padding: 22px 22px 6px;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--auth-accent) 16%, transparent), transparent 60%);
}

.auth-terms-intro h2 {
  margin: 10px 0 6px;
  font-size: 20px;
  line-height: 1.25;
}

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

.auth-terms-badge {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid color-mix(in srgb, var(--auth-accent) 45%, transparent);
  border-radius: 999px;
  color: var(--auth-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.auth-terms-required .auth-terms-actions {
  display: grid;
  gap: 10px;
}

.auth-terms-required .auth-terms {
  display: flex;
  gap: 10px;
  font-size: 13px;
}

.auth-terms-required .auth-status:empty {
  display: none;
}

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

.auth-terms-buttons .auth-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-terms-secondary {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  color: var(--ink);
  box-shadow: none;
}

@media (max-width: 480px) {
  .auth-terms-buttons {
    grid-template-columns: 1fr;
  }

  .auth-terms-buttons [data-accept-terms] {
    order: -1;
  }
}

:root[data-theme="light"] .auth-terms-badge {
  color: #955000;
}

:root[data-theme="light"] .auth-inline-link {
  color: #955000;
}

:root[data-theme="light"] .auth-terms-dialog {
  background: #FFFFFF;
  color: #1b2027;
}

:root[data-theme="light"] .auth-terms-tabs button[aria-selected="true"],
:root[data-theme="light"] .auth-terms-body h4 {
  color: #955000;
}
