/* One box per digit for the login code (see bowt-otp.js). */
.otp-wrap { margin: 6px 0 14px; }

.otp-boxes {
    position: relative;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
}
.otp-cells {
    display: flex;
    justify-content: center;
    gap: 10px;
    pointer-events: none;
}
.otp-box {
    flex: 1 1 0;
    max-width: 68px;
    min-width: 0;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    border: 1.5px solid #dbe4ee;
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.otp-box.filled { border-color: #94a3b8; background: #f8fafc; }
.otp-boxes.focused .otp-box.active {
    border-color: var(--bowtt-blue, #0284c7);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, .12);
}
/* blinking caret in the box that is waiting for a digit */
.otp-boxes.focused .otp-box.active:not(.filled)::after {
    content: '';
    width: 2px;
    height: 26px;
    border-radius: 2px;
    background: var(--bowtt-blue, #0284c7);
    animation: otpCaret 1s steps(1) infinite;
}
@keyframes otpCaret { 50% { opacity: 0; } }
.otp-boxes.is-invalid .otp-box { border-color: #dc2626; background: #fef2f2; }

/* The real input sits invisibly on top: it gets the taps, keypad, paste and SMS autofill. */
.otp-boxes .otp-input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: transparent;
    -webkit-text-fill-color: transparent;
    caret-color: transparent;
    font-size: 16px; /* 16px stops iOS zooming in on focus */
    letter-spacing: 1em;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}
.otp-boxes .otp-input::selection { background: transparent; }
.otp-boxes .otp-input:-webkit-autofill { -webkit-text-fill-color: transparent; transition: background-color 99999s; }

.otp-wrap .invalid-feedback {
    display: none;
    text-align: center;
    margin-top: 10px;
    color: #dc2626;
    font-size: 12.5px;
}
.otp-boxes.is-invalid ~ .invalid-feedback { display: block; }

@media (max-width: 380px) {
    .otp-cells { gap: 8px; }
    .otp-box { height: 56px; font-size: 24px; border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .otp-boxes.focused .otp-box.active:not(.filled)::after { animation: none; }
}
