/* auth modal */
.modal-open {
  overflow: hidden;
  touch-action: none;
}

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

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.auth-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  max-width: 460px;
  margin: auto;
  padding: 22px 18px 18px;
  max-height: min(100dvh - 32px, 720px);
  overflow-y: auto;
  box-sizing: border-box;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.12);
  background:
    linear-gradient(180deg, rgba(23, 8, 32, 0.98) 0%, rgba(10, 10, 14, 0.98) 100%);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

.auth-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.auth-modal__eyebrow {
  margin-bottom: 10px;
  color: #c487ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-modal__title {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.05;
}

.auth-modal__text {
  margin: 0 0 16px;
  color: #b7afc9;
  font-size: 14px;
}

.auth-modal__form {
  display: grid;
  gap: 10px;
}

.auth-modal__label {
  font-size: 13px;
  color: #d7d0e8;
}

.auth-modal__input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  box-sizing: border-box;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 16px;
}

.auth-modal__input--code {
  text-align: center;
  letter-spacing: 0.22em;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.auth-modal__submit,
.auth-modal__ghost {
  width: 100%;
}

.auth-modal__row {
  margin-top: 10px;
}

.auth-modal__message {
  margin-top: 14px;
  min-height: 20px;
  font-size: 14px;
  color: #b7afc9;
}

.auth-modal__message[data-type="success"] {
  color: #7ee787;
}

.auth-modal__message[data-type="error"] {
  color: #ff8e8e;
}

@media (max-width: 480px) {
  .auth-modal {
    align-items: end;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .auth-modal__dialog {
    width: 100%;
    border-radius: 20px;
    max-height: min(100dvh - 12px, 100dvh - env(safe-area-inset-top) - 12px);
    padding: 20px 14px 16px;
  }

  .auth-modal__title {
    font-size: 24px;
  }

  .auth-modal__input--code {
    font-size: 22px;
    letter-spacing: 0.16em;
  }
}
