.auth-error {
  color: #b33a2d;
  font-size: 12px;
  min-height: 18px;
  margin: 0;
}
.auth-error.success {
  color: #27683f;
}
.required-note,
.password-requirements {
  margin: -6px 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.required-mark,
.required-note span {
  color: #a63b25;
  font-weight: 800;
}
#authModal .modal {
  max-height: calc(100vh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
}
#registerForm,
#registerForm :is(label, input, button, p),
#passwordRecoveryForm,
#passwordRecoveryForm :is(label, input, button, p),
#passwordResetForm,
#passwordResetForm :is(label, input, button, p) {
  font-family: "DM Sans", sans-serif;
}
#registerForm .primary-btn,
#passwordRecoveryForm .primary-btn,
#passwordResetForm .primary-btn {
  min-height: 58px;
  padding-inline: 22px;
  border-radius: 999px;
}
.auth-tabs {
  display: flex;
  gap: 6px;
  margin: 14px 0 4px;
  padding: 4px;
  background: var(--cream);
  border-radius: 999px;
}
.auth-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-tab.is-active {
  background: var(--ink);
  color: #fff;
}
.auth-tab:not(.is-active):hover {
  color: var(--ink);
}
.auth-tab:focus-visible {
  outline: 3px solid rgba(215, 243, 107, 0.75);
  outline-offset: 2px;
}
.switch-auth {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  margin: 18px auto 0;
  display: block;
  text-decoration: underline;
}
.switch-auth:hover {
  color: var(--orange);
}
#registerView[hidden],
#loginView[hidden],
#passwordRecoveryView[hidden],
#passwordResetView[hidden] {
  display: none;
}
/* The generic `form { display: grid }` rule otherwise beats the [hidden]
   default, since author styles win over user-agent styles regardless of
   specificity. */
#registerForm[hidden],
#registerOtpStep[hidden] {
  display: none;
}
.auth-secondary-link {
  margin-top: 10px;
}
.form-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.primary-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.72;
}
.primary-btn.is-loading::after {
  content: "";
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -2px;
  animation: reservebai-spin 0.7s linear infinite;
}
.turnstile-field {
  min-height: 65px;
  margin-top: 4px;
  overflow: hidden;
}
#loginForm .auth-error {
  margin-top: -4px;
}
.auth-secure-submit {
  min-height: 58px;
  margin-top: 0 !important;
  padding: 10px 12px 10px 20px;
  border: 1px solid #12231e;
  border-radius: 8px;
  background: linear-gradient(135deg, #12231e, #1d3930);
  box-shadow: 0 10px 22px rgba(18, 35, 30, 0.16);
  letter-spacing: 0.01em;
}

#loginForm .auth-secure-submit,
#passwordRecoveryForm .auth-secure-submit,
#passwordResetForm .auth-secure-submit {
  border-radius: 999px;
  padding-left: 24px;
}

/* Keep account recovery actions consistent with the site's pill buttons. */
#authModal #passwordRecoveryForm button.auth-secure-submit,
#authModal #passwordResetForm button.auth-secure-submit {
  border-radius: 999px;
}

#confirmLogout {
  min-height: 52px;
  padding-inline: 20px;
  border-radius: 999px;
}

#confirmLogout:focus-visible {
  outline: 3px solid rgba(215, 243, 107, 0.75);
  outline-offset: 3px;
}

.auth-secure-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #1a332b, #254b3f);
  box-shadow: 0 13px 26px rgba(18, 35, 30, 0.22);
  transform: translateY(-1px);
}
.auth-secure-submit:focus-visible {
  outline: 3px solid rgba(215, 243, 107, 0.75);
  outline-offset: 3px;
}
.auth-secure-submit .auth-button-label {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.auth-secure-submit .auth-button-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  font-size: 20px;
  transition: transform 0.2s ease;
}
.auth-secure-submit:hover:not(:disabled) .auth-button-icon {
  transform: translateX(2px);
}
.auth-secure-submit[disabled] {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}
.auth-secure-submit[disabled]::after {
  display: none;
}
.auth-secure-submit.is-loading {
  cursor: wait;
  opacity: 0.78;
}
.auth-secure-submit.is-loading .auth-button-icon {
  border: 2px solid rgba(18, 35, 30, 0.3);
  border-right-color: var(--ink);
  background: var(--lime);
  font-size: 0;
  animation: reservebai-spin 0.7s linear infinite;
}
@keyframes reservebai-spin {
  to {
    transform: rotate(360deg);
  }
}
.profile-link {
  color: #596760;
  font-size: 14px;
}
.profile-modal {
  max-height: 90vh;
  overflow: auto;
}
.profile-help {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.field-help {
  display: block;
  margin-top: -8px;
  color: var(--muted);
  font-size: 11px;
}
.profile-divider {
  height: 1px;
  background: var(--line);
  margin: 24px 0;
}
.profile-section-title {
  margin: 0 0 14px;
  font: 600 22px "Space Grotesk";
}
#profileForm input[readonly] {
  background: #eef1ec;
  color: #71807a;
  cursor: not-allowed;
}
.profile-account-modal {
  width: min(100%, 560px);
  max-width: 560px;
  max-height: calc(100vh - 32px);
  padding: 0 0 30px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(12, 29, 24, 0.26);
}
.profile-account-modal .close-btn {
  top: 20px;
  right: 20px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  font-size: 22px;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}
.profile-account-modal .close-btn:hover {
  background: #fff;
  transform: rotate(4deg);
}
.profile-account-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 36px 68px 28px 36px;
  background:
    radial-gradient(circle at 92% 12%, rgba(215, 243, 107, 0.9), transparent 32%),
    linear-gradient(135deg, #edf5f1, #f8f8f3);
  border-bottom: 1px solid var(--line);
}
.profile-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, #123b58, #0aa783);
  box-shadow: 0 10px 24px rgba(18, 59, 88, 0.2);
  color: #fff;
  font: 700 18px "Space Grotesk";
  letter-spacing: 0.04em;
}
.profile-account-header .eyebrow {
  margin: 1px 0 8px;
}
.profile-account-header h2 {
  margin: 0 0 8px;
  font-size: 36px;
  line-height: 1.05;
}
.profile-account-intro {
  max-width: 340px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.profile-account-form {
  gap: 20px;
  padding: 28px 36px 0;
}

.profile-account-form .auth-secure-submit {
  border-radius: 999px;
}

.profile-fields {
  display: grid;
  gap: 16px;
}
.profile-field {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}
.profile-field > span {
  display: grid;
  gap: 3px;
}
.profile-field strong {
  color: var(--ink);
  font-size: 13px;
}
.profile-field small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.35;
}
.profile-field input,
.profile-field select {
  min-width: 0;
  width: 100%;
  margin-top: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.profile-field input:focus,
.profile-field select:focus {
  border-color: var(--ink);
  outline: none;
  box-shadow: 0 0 0 3px rgba(215, 243, 107, 0.52);
}
.profile-security-check {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--cream);
}
.profile-security-copy {
  display: grid;
  gap: 3px;
}
.profile-security-copy strong {
  color: var(--ink);
  font-size: 13px;
}
.profile-security-copy span {
  color: var(--muted);
  font-size: 11px;
}
.profile-security-check .turnstile-field {
  margin-top: 12px;
}
.profile-account-form .auth-error {
  margin: 0;
}
.profile-account-modal > .switch-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 72px);
  margin: 14px 36px 0;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.profile-account-modal > .switch-auth::after {
  content: "→";
  color: var(--orange);
  font-size: 16px;
}
.profile-account-modal > .switch-auth:hover {
  border-color: var(--ink);
  background: var(--cream);
  color: var(--ink);
}

.profile-account-modal > .switch-auth:focus-visible {
  outline: 3px solid rgba(215, 243, 107, 0.75);
  outline-offset: 3px;
}

.profile-modal .primary-btn {
  border-radius: 999px;
}

@media (max-width: 560px) {
  .profile-account-modal {
    max-height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
  }
  .profile-account-header {
    padding: 28px 54px 22px 22px;
  }
  .profile-avatar {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 13px;
    font-size: 15px;
  }
  .profile-account-header h2 {
    font-size: 30px;
  }
  .profile-account-form {
    padding: 22px 20px 0;
  }
  .profile-field {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .profile-account-modal > .switch-auth {
    width: calc(100% - 40px);
    margin-inline: 20px;
  }
}
