.auth-nav {
  display: inline-flex;
  min-width: 132px;
  min-height: 34px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-nav button,
.auth-close {
  border: 1px solid rgba(20, 90, 201, 0.24);
  border-radius: 999px;
  background: #fff;
  color: #145ac9;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.auth-nav button {
  min-height: 34px;
  padding: 0 12px;
}

.auth-account {
  color: #4d6078;
  font-size: 13px;
  font-weight: 700;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 35, 59, 0.4);
}

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

.auth-dialog {
  position: relative;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid rgba(119, 172, 223, 0.44);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(18, 35, 59, 0.24);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-grid;
  width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  box-shadow: none;
}

.auth-dialog h2 {
  margin-right: 40px;
  font-size: 26px;
}

.auth-description {
  margin: 8px 0 0;
  color: #4d6078;
  font-size: 14px;
  line-height: 1.45;
}

.auth-message {
  min-height: 20px;
  margin-top: 8px;
  color: #4d6078;
  font-size: 14px;
  line-height: 1.45;
}

.auth-message.error {
  color: #b3261e;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: #203650;
  font-size: 13px;
  font-weight: 800;
}

.auth-form label > span:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.auth-form label small {
  font-weight: 650;
}

.auth-form label > span:first-child small {
  color: #71839a;
}

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

.auth-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c4d8ee;
  border-radius: 10px;
  padding: 0 12px;
  color: #12233b;
  font: inherit;
}

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

.auth-password-control {
  position: relative;
  display: block;
}

.auth-password-control input {
  padding-right: 72px;
}

.auth-form .auth-password-control button {
  position: absolute;
  top: 50%;
  right: 6px;
  width: auto;
  min-height: 32px;
  padding: 0 8px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #145ac9;
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
}

.auth-field-help,
.auth-field-error {
  min-height: 0;
  color: #60748c;
  font-size: 12px;
  line-height: 1.35;
}

.auth-field-error:not(:empty) {
  color: #b3261e;
}

.auth-form button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: #145ac9;
  color: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

#auth-passkey-signin,
.passkey-row {
  width: 100%;
}

#auth-passkey-signin {
  margin-bottom: 1rem;
}

.passkey-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-color, #d9d9d9);
}

.passkey-row button {
  flex: 0 0 auto;
}

.auth-social {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

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

.auth-social > span {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #71839a;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.auth-social > span::before,
.auth-social > span::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #d6e3f1;
}

.auth-social button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  border: 1px solid #c4d8ee;
  border-radius: 999px;
  background: #fff;
  color: #203650;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-provider-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

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

.auth-switches {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.auth-switches > span {
  color: #4d6078;
  font-size: 13px;
}

.auth-switches #auth-forgot {
  flex-basis: 100%;
}

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

.auth-switches button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #145ac9;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 720px) {
  .auth-nav {
    width: 100%;
    min-width: 0;
    justify-content: flex-end;
  }
}

:root[data-theme="dark"] .auth-dialog h2 {
  color: #f3f8ff;
}

:root[data-theme="dark"] .auth-switches button {
  color: #8fc7ff;
}

:root[data-theme="dark"] .auth-switches button,
:root[data-theme="dark"] .auth-switches button:hover {
  border: 0;
  background: transparent;
  box-shadow: none;
}

:root[data-theme="dark"] .auth-form button {
  background: #2f8cff;
  color: #07111f;
  box-shadow: 0 14px 28px rgba(47, 140, 255, 0.24);
}

:root[data-theme="dark"] .auth-form button:hover {
  background: #67adff;
}

:root[data-theme="dark"] .auth-social > span {
  color: #a9b9cc;
}

:root[data-theme="dark"] .auth-social > span::before,
:root[data-theme="dark"] .auth-social > span::after {
  background: #35506b;
}

:root[data-theme="dark"] .auth-social button,
:root[data-theme="dark"] .auth-social button:hover {
  border: 1px solid #35506b;
  background: #0f1a27;
  color: #edf4ff;
  box-shadow: none;
}

:root[data-theme="dark"] .auth-description,
:root[data-theme="dark"] .auth-switches > span,
:root[data-theme="dark"] .auth-field-help,
:root[data-theme="dark"] .auth-form label > span:first-child small {
  color: #a9b9cc;
}

:root[data-theme="dark"] .auth-form .auth-password-control button,
:root[data-theme="dark"] .auth-form .auth-password-control button:hover {
  background: transparent;
  color: #8fc7ff;
  box-shadow: none;
}

:root[data-theme="dark"] .auth-form input[aria-invalid="true"] {
  border-color: #ff8a80;
}

:root[data-theme="dark"] .auth-field-error:not(:empty) {
  color: #ff8a80;
}

:root[data-theme="dark"] .auth-account,
:root[data-theme="dark"] .auth-message {
  color: #a9b9cc;
}

:root[data-theme="dark"] .auth-dialog {
  border-color: rgba(126, 179, 232, 0.24);
  background: #162334;
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .auth-form label {
  color: #d9e6f5;
}

:root[data-theme="dark"] .auth-form input {
  border-color: #35506b;
  background: #0f1a27;
  color: #edf4ff;
}

:root[data-theme="dark"] .auth-form input:focus {
  border-color: #8fc7ff;
  box-shadow: 0 0 0 4px rgba(143, 199, 255, 0.16);
}

:root[data-theme="dark"] .auth-nav button,
:root[data-theme="dark"] .auth-close {
  border-color: rgba(126, 179, 232, 0.36);
  background: #18283a;
  color: #8fc7ff;
  box-shadow: none;
}

:root[data-theme="dark"] .auth-nav button:hover,
:root[data-theme="dark"] .auth-close:hover {
  background: #22364d;
}

:root[data-theme="dark"] .auth-modal {
  background: rgba(4, 8, 13, 0.72);
}

:root[data-theme="dark"] .auth-message.error {
  color: #ff9b91;
}
