body.auth-modal-open {
  padding-right: var(--scrollbar-compensation, 0);
}

.auth-modal {
  width: min(620px, calc(100% - 32px));
  max-width: none;
  max-height: min(720px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 28px;
  background: transparent;
  color: var(--ink, #1d1b19);
  font-family: Manrope, system-ui, sans-serif;
}

.auth-modal::backdrop {
  background: rgba(24, 20, 17, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.auth-modal.is-open {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  width: 100%;
  height: 100%;
  max-height: none;
  place-items: center;
  border-radius: 0;
  background: rgba(24, 20, 17, 0.72);
}

.auth-modal.is-open .auth-modal__surface {
  width: min(620px, calc(100% - 32px));
  border-radius: 28px;
}

.auth-modal__surface {
  position: relative;
  max-height: min(720px, calc(100dvh - 32px));
  overflow-y: auto;
  padding: clamp(32px, 6vw, 58px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: inherit;
  background: #f8f4ed;
  box-shadow: 0 28px 72px rgba(24, 20, 17, 0.27);
}

.auth-modal__close {
  position: absolute;
  top: 17px;
  right: 17px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(35, 31, 27, 0.15);
  border-radius: 50%;
  background: transparent;
  color: var(--ink, #1d1b19);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.auth-modal__close:hover {
  border-color: var(--brown, #6b4122);
  background: var(--brown, #6b4122);
  color: #fff;
}

.auth-modal__eyebrow {
  margin: 0 0 17px;
  color: var(--brown, #6b4122);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-modal__title {
  max-width: 480px;
  margin: 0;
  padding-right: 48px;
  color: var(--ink, #1d1b19);
  font-size: clamp(36px, 7vw, 56px);
  font-weight: 750;
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.auth-modal__lead {
  max-width: 500px;
  margin: 20px 0 0;
  color: var(--muted, #625d57);
  font-size: clamp(16px, 2.4vw, 19px);
  line-height: 1.62;
}

.auth-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 32px;
}

.auth-modal__button {
  display: inline-flex;
  min-height: 52px;
  padding: 13px 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brown, #6b4122);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.auth-modal__button--primary {
  background: var(--brown, #6b4122);
  color: #fff;
}

.auth-modal__button--primary:hover {
  border-color: var(--brown-dark, #513018);
  background: var(--brown-dark, #513018);
  color: #fff;
  transform: translateY(-1px);
}

.auth-modal__button--secondary {
  background: transparent;
  color: var(--brown, #6b4122);
}

.auth-modal__button--secondary:hover {
  background: var(--brown, #6b4122);
  color: #fff;
  transform: translateY(-1px);
}

.auth-modal__notice {
  margin-top: 22px;
  padding: 19px 21px;
  border-left: 3px solid var(--brown, #6b4122);
  border-radius: 0 15px 15px 0;
  background: #ede2d4;
}

.auth-modal__notice[hidden] {
  display: none;
}

.auth-modal__notice h3 {
  margin: 0;
  color: var(--ink, #1d1b19);
  font-size: 17px;
  line-height: 1.35;
}

.auth-modal__notice p {
  margin: 7px 0 0;
  color: var(--muted, #625d57);
  font-size: 13px;
  line-height: 1.58;
}

.auth-modal :focus-visible {
  outline: 3px solid #a86a3c;
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .auth-modal {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 21px;
  }

  .auth-modal__surface {
    max-height: calc(100dvh - 20px);
    padding: 34px 22px 24px;
  }

  .auth-modal__close {
    top: 11px;
    right: 11px;
  }

  .auth-modal__title {
    padding-right: 38px;
  }

  .auth-modal__actions {
    grid-template-columns: 1fr;
    margin-top: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-modal *,
  .auth-modal *::before,
  .auth-modal *::after {
    transition: none;
  }
}
