/* Six distinct OTP cells shared by onboarding and account recovery. */
.phone .otp-input-wrap[data-otp-input] {
  width: 100%;
  min-height: 56px !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 44px));
  justify-content: center;
  align-items: center;
  gap: 8px !important;
  direction: ltr;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Shared field rules draw a focus-within ring around the whole OTP group.
 * OTP cells own focus individually, so the transparent group must stay inert. */
html body .phone.next-ui-theme .otp-input-wrap[data-otp-input]:focus-within,
html body .phone .otp-input-wrap[data-otp-input]:focus-within {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
}

.phone .otp-input-wrap[data-otp-input] > .otp-digit {
  box-sizing: border-box;
  width: 44px !important;
  min-width: 0;
  height: 56px !important;
  min-height: 56px !important;
  padding: 0 !important;
  border: var(--ui-field-stroke, 1px) solid var(--ui-field-line, #89938c) !important;
  border-radius: 16px !important;
  outline: 0;
  color: var(--ui-ink, #202422);
  background: var(--ui-field-fill, #f3f5f3) !important;
  box-shadow: none !important;
  font-family: "Vazirmatn Medium", var(--biz-font-medium, Tahoma, sans-serif) !important;
  font-size: 24px !important;
  font-weight: 500;
  line-height: normal !important;
  letter-spacing: 0 !important;
  text-indent: 0 !important;
  text-align: center;
  font-variant-numeric: proportional-nums !important;
  caret-color: var(--ui-focus, #0056f5);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.phone .otp-input-wrap[data-otp-input] > .otp-digit:focus {
  border-color: var(--ui-focus, #0056f5) !important;
  box-shadow: 0 0 0 2px var(--ui-focus, #0056f5), 0 0 0 5px var(--ui-focus-halo, rgb(0 86 245 / 10%)) !important;
}

.phone .otp-input-wrap[data-otp-input].is-invalid > .otp-digit {
  border-color: var(--biz-danger, #9b4650) !important;
}

.phone .otp-input-wrap[data-otp-input].is-invalid > .otp-digit:focus {
  box-shadow: 0 0 0 2px var(--biz-danger, #9b4650), 0 0 0 5px color-mix(in srgb, var(--biz-danger, #9b4650) 12%, transparent) !important;
}

@media (max-width: 360px) {
  .phone .otp-input-wrap[data-otp-input] {
    grid-template-columns: repeat(6, minmax(0, 40px));
    gap: 6px !important;
  }
  .phone .otp-input-wrap[data-otp-input] > .otp-digit {
    width: 40px !important;
    height: 56px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone .otp-input-wrap[data-otp-input] > .otp-digit { transition: none; }
}

@media (forced-colors: active) {
  .phone .otp-input-wrap[data-otp-input] > .otp-digit { border: 1px solid CanvasText !important; }
  .phone .otp-input-wrap[data-otp-input] > .otp-digit:focus { outline: 2px solid Highlight; outline-offset: 2px; }
}
