/* ========== OTP Input Component ========== */

.otp-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  /* Always LTR — OTP digits are universal left-to-right */
  direction: ltr;
  /* Match the width of sibling full-width buttons so the row never overflows
     on narrow mobile viewports (6 × 48px + 5 × 8px = 328px, wider than a
     360px iPhone after padding). */
  width: 100%;
  box-sizing: border-box;
}

.otp-input {
  /* Grow to fill the row equally; cap on wider screens so boxes don't become
     huge on desktop. min-width: 0 lets them shrink below the natural 48px
     on narrow mobile. */
  flex: 1 1 0;
  min-width: 0;
  max-width: 56px;
  width: auto;
  height: 56px;
  border: 2px solid #d0d5dd;
  border-radius: 8px;
  text-align: center !important;
  font-size: 1.5rem;
  font-weight: 600;
  font-family: 'SF Mono', 'Consolas', monospace;
  color: #1a1a2e;
  background: #fafafa;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  caret-color: #006efd;
  padding: 0;
  box-sizing: border-box;
  /* Force LTR on each input for RTL page support */
  direction: ltr !important;
  unicode-bidi: bidi-override;
}

/* Tight screens: tighten gap and reduce font so 6 boxes comfortably fit. */
@media (max-width: 420px) {
  .otp-group {
    gap: 6px;
  }
  .otp-input {
    height: 52px;
    font-size: 1.25rem;
  }
}

.otp-input:focus {
  border-color: #006efd;
  box-shadow: 0 0 0 3px rgba(0, 110, 253, 0.15);
  background: #fff;
}

.otp-input.filled {
  border-color: #006efd;
  background: #f0f6ff;
}

.otp-input::placeholder {
  color: #ccc;
  font-weight: 300;
  text-align: center !important;
  direction: ltr !important;
}

.otp-input:-moz-placeholder {
  text-align: center !important;
  direction: ltr !important;
}

.otp-input::-moz-placeholder {
  text-align: center !important;
  direction: ltr !important;
}

/* Remove spinner arrows */
.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.otp-input[type=number] {
  -moz-appearance: textfield;
}
