/* Sign in, sign up, password reset and sign out, all in the shared modal. */
.modal__body:has(.auth-form) {
  gap: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form--tight {
  gap: 10px;
}

.auth-form__greeting {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  /* On a phone it breaks between words, or where the text marks it, never mid-word in Japanese. */
  word-break: keep-all;
}

.auth-form__intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.auth-form__intro p:not(.auth-form__greeting) {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.auth-form__link,
.auth-switch a,
.check a {
  color: var(--focus);
  font-weight: 600;
  text-decoration: none;
}

.auth-form__link:hover,
.auth-switch a:hover,
.check a:hover {
  text-decoration: underline;
}

.auth-form__link {
  align-self: flex-start;
  font-size: 14px;
}

.auth-form__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-social {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-more {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.auth-more__toggle .icon {
  transition: transform 0.15s;
}

.auth-more__toggle[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}

/* "Show more" turns into "Show fewer" once the other ways are out. */
.auth-more__toggle[aria-expanded="true"] .auth-more__more,
.auth-more__toggle[aria-expanded="false"] .auth-more__fewer {
  display: none;
}

/* One way a row. */
.auth-more__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

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

.auth-social__google img {
  flex: none;
}

.field__required {
  margin-left: 4px;
  color: var(--danger);
}

.auth-switch {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  text-align: center;
}

.auth-switch a {
  font-weight: 700;
}

.auth-referral {
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.auth-referral[open] {
  padding-bottom: 14px;
}

.auth-referral summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--control-md);
  padding: 0 14px;
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.auth-referral summary::-webkit-details-marker {
  display: none;
}

.auth-referral[open] summary .icon {
  transform: rotate(180deg);
}

.auth-referral .field__input {
  width: calc(100% - 28px);
  margin: 0 14px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.auth-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  text-align: center;
}

.auth-done > .icon {
  color: var(--focus);
}

.auth-done p {
  margin: 0;
}

.auth-done p:not(.auth-form__greeting) {
  color: var(--ink-muted);
}

.auth-done .button {
  align-self: stretch;
}

/* Cloudflare Turnstile before the submit button. */
/* The check takes no room in the form until it shows. */
.bot-check {
  display: contents;
}

.bot-check__widget:not(.is-shown) {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.bot-check__widget.is-shown {
  min-height: 65px;
}
