.auth-pin-overlay {
  --auth-key-size: 80px;
  --auth-key-gap: 24px;
  --auth-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: fixed;
  inset: var(--auth-viewport-top, 0px) 0 auto;
  height: var(--auth-viewport-height, 100dvh);
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  color: #fff;
  font-family: Sora, sans-serif;
  letter-spacing: 0;
  isolation: isolate;
}

.auth-pin-overlay *,
.auth-pin-overlay *::before,
.auth-pin-overlay *::after {
  box-sizing: border-box;
  letter-spacing: 0;
}

.auth-pin-overlay.dis-none { display: none !important; }
body.auth-pin-open { overflow: hidden !important; }

.auth-pin-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(8 48 41 / 84%), rgb(23 30 34 / 80%) 60%, rgb(38 39 37 / 82%));
  -webkit-backdrop-filter: blur(32px) saturate(0.8);
  backdrop-filter: blur(12px) saturate(0.8);
  animation: auth-pin-fade-in 360ms ease-out both;
}

.auth-pin-dialog {
  position: relative;
  width: min(100%, 352px);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 25%) transparent;
  outline: none;
  animation: auth-pin-enter 460ms var(--auth-ease) both;
}

.auth-pin-content {
  display: grid;
  justify-items: center;
  padding: 8px 12px;
}

.auth-pin-header {
  width: 100%;
  text-align: center;
  margin-bottom: 12px;
}

.auth-pin-heading-icon {
  height: 24px;
  margin-bottom: 18px;
  font-size: 21px;
  line-height: 24px;
}

.auth-pin-title {
  margin: 0 0 8px;
  color: #fff;
  font-size: 19px;
  font-weight: 500;
  line-height: 27px;
  overflow-wrap: anywhere;
}

.auth-pin-subtitle {
  margin: 0;
  color: rgb(255 255 255 / 78%);
  font-size: 12px;
  font-weight: 400;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.auth-pin-display {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 288px);
  height: 52px;
  margin: 0;
}

.auth-pin-pips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  transition: opacity 180ms ease, transform 340ms var(--auth-ease), visibility 180ms;
}

.auth-pin-pip {
  flex: 0 0 11px;
  width: 11px;
  height: 11px;
  border: 1px solid rgb(255 255 255 / 90%);
  border-radius: 50%;
  background: transparent;
  transition: background-color 120ms ease, transform 260ms var(--auth-ease);
}

.auth-pin-pip--filled {
  background: #fff;
  transform: scale(1.08);
}

.auth-pin-overlay .auth-pin-text-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 52px;
  padding: 12px 16px;
  border: 1px solid rgb(255 255 255 / 32%);
  border-radius: 8px;
  background: rgb(255 255 255 / 10%);
  color: #fff;
  caret-color: #fff;
  font: 400 16px/24px Sora, sans-serif;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 200ms ease, transform 340ms var(--auth-ease), border-color 180ms;
}

.auth-pin-text-input::placeholder { color: rgb(255 255 255 / 70%); }
.auth-pin-overlay .auth-pin-text-input:focus { border-color: rgb(255 255 255 / 85%); outline: none; box-shadow: 0 0 0 3px rgb(255 255 255 / 8%); }

.auth-pin-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 30px;
  width: 100%;
  padding: 0 0 8px;
  color: rgb(255 255 255 / 82%);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.auth-pin-status.is-error { color: #ffcfcb; }
.auth-pin-overlay[aria-busy="true"] .auth-pin-status::before {
  content: "";
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border: 1.5px solid rgb(255 255 255 / 25%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-pin-spin 700ms linear infinite;
}

.auth-pin-keypad-region {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
  transition: grid-template-rows 380ms var(--auth-ease), opacity 200ms ease, transform 380ms var(--auth-ease), visibility 380ms;
}

.auth-pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, var(--auth-key-size));
  grid-template-rows: repeat(4, var(--auth-key-size));
  gap: var(--auth-key-gap);
  min-height: 0;
  overflow: hidden;
}

.auth-pin-overlay button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}

.auth-pin-overlay .auth-pin-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: var(--auth-key-size);
  height: var(--auth-key-size);
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 16%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 5%);
  transition: background-color 280ms ease-out, transform 320ms var(--auth-ease), opacity 200ms;
}

.auth-pin-key > span { font-size: 31px; font-weight: 400; line-height: 36px; }
.auth-pin-key > small {font-size: 9px;font-weight: 500;line-height: 12px;display: none;}
.auth-pin-key--zero { grid-column: 2; }

.auth-pin-overlay .auth-pin-key--delete {
  background: transparent;
  box-shadow: none;
  font-size: 21px;
  opacity: 0;
  visibility: hidden;
}

.auth-pin-overlay[data-has-input="true"] .auth-pin-key--delete { opacity: 1; visibility: visible; }

@media (hover: hover) {
  .auth-pin-overlay .auth-pin-key:hover { background: rgb(255 255 255 / 24%); }
  .auth-pin-overlay .auth-pin-cancel:hover,
  .auth-pin-overlay .auth-pin-mode-tab:hover { color: #fff; background: rgb(255 255 255 / 8%); }
}

.auth-pin-overlay .auth-pin-key:active {
  background: rgb(255 255 255 / 44%);
  transform: scale(0.94);
  transition-duration: 60ms;
}

.auth-pin-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  width: calc(3 * var(--auth-key-size) + 2 * var(--auth-key-gap));
  max-width: 100%;
  min-height: 48px;
  max-height: none;
  margin-top: 18px;
  padding: 0;
  gap: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.auth-pin-mode-tabs { position: relative; display: flex; }
.auth-pin-mode-tabs::before {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 15px;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 300ms var(--auth-ease);
}
.auth-pin-overlay .auth-pin-mode-tab,
.auth-pin-overlay .auth-pin-cancel {
  display: grid;
  place-items: center;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  line-height: 20px;
  font-weight: 400;
  transition: color 160ms, background-color 160ms;
}
.auth-pin-overlay .auth-pin-mode-tab { width: 48px; color: rgb(255 255 255 / 64%); }
.auth-pin-overlay .auth-pin-mode-tab.is-active { color: #fff; }
.auth-pin-overlay .auth-pin-cancel { min-width: var(--auth-key-size); }
.auth-pin-overlay button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.auth-pin-overlay button:disabled { cursor: wait; }
.auth-pin-overlay[aria-busy="true"] .auth-pin-keypad { opacity: 0.65; transition: opacity 200ms; }

.auth-pin-overlay[data-mode="text"] .auth-pin-pips { opacity: 0; visibility: hidden; transform: translateY(-6px); }
.auth-pin-overlay[data-mode="text"] .auth-pin-text-input { opacity: 1; visibility: visible; transform: translateY(0); }
.auth-pin-overlay[data-mode="text"] .auth-pin-keypad-region { grid-template-rows: 0fr; opacity: 0; visibility: hidden; transform: translateY(12px); }
.auth-pin-overlay[data-mode="text"] .auth-pin-mode-tabs::before { transform: translateX(48px); }

.auth-pin-overlay.is-closing .auth-pin-dialog { animation: auth-pin-exit 240ms cubic-bezier(0.4, 0, 1, 1) both; }
.auth-pin-overlay.is-closing .auth-pin-scrim { animation: auth-pin-fade-out 240ms ease-in both; }
.auth-pin-overlay.is-closing .auth-pin-content { pointer-events: none; }

@keyframes auth-pin-enter {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes auth-pin-exit {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(1.015); }
}
@keyframes auth-pin-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes auth-pin-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes auth-pin-spin { to { transform: rotate(360deg); } }

@media (max-height: 740px) {
  .auth-pin-overlay { --auth-key-size: 72px; --auth-key-gap: 18px; }
  .auth-pin-heading-icon { margin-bottom: 12px; }
  .auth-pin-header { margin-bottom: 6px; }
  .auth-pin-footer { margin-top: 12px; }
}

@media (max-width: 380px), (max-height: 600px) {
  .auth-pin-overlay { --auth-key-size: 64px; --auth-key-gap: 16px; }
  .auth-pin-title { font-size: 18px; line-height: 25px; }
  .auth-pin-heading-icon { margin-bottom: 8px; }
  .auth-pin-key > span { font-size: 28px; line-height: 32px; }
}

@media (max-height: 500px) and (min-width: 560px) {
  .auth-pin-overlay { --auth-key-size: 58px; --auth-key-gap: 12px; }
  .auth-pin-dialog { width: min(100%, 620px); }
  .auth-pin-content { grid-template-columns: minmax(0, 1fr) 198px; column-gap: 36px; align-items: center; transition: grid-template-columns 380ms var(--auth-ease), column-gap 380ms var(--auth-ease); }
  .auth-pin-header { grid-column: 1; align-self: end; }
  .auth-pin-display { grid-column: 1; }
  .auth-pin-status { grid-column: 1; }
  .auth-pin-keypad-region { grid-column: 2; grid-row: 1 / 5; }
  .auth-pin-footer { grid-column: 1; width: 100%; margin-top: 0; }
  .auth-pin-overlay[data-mode="text"] .auth-pin-content { grid-template-columns: minmax(0, 1fr) 0px; column-gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-pin-overlay, .auth-pin-overlay *, .auth-pin-overlay *::before, .auth-pin-overlay *::after {
    animation: none !important;
    transition: none !important;
  }
}
