/* ───── Hidden fields rendered inline in the form ───── */
.wm-otp-fields { display: none; }

/* ───── Modal Backdrop ───── */
.wm-otp-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(10, 15, 30, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.wm-otp-modal.wm-otp-modal--open {
    display: flex;
    animation: wmOtpFadeIn 0.22s ease;
}
@keyframes wmOtpFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ───── Modal Box ───── */
.wm-otp-modal__box {
    position: relative;
    width: min(100%, 440px);
    background: #fff;
    border-radius: 24px;
    padding: 40px 36px 36px;
    text-align: center;
    box-shadow: 0 32px 80px rgba(10, 15, 30, 0.25);
    animation: wmOtpSlideUp 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes wmOtpSlideUp {
    from { transform: translateY(28px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1);       opacity: 1; }
}

/* ───── Close Button ───── */
.wm-otp-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f2f7;
    border-radius: 50%;
    font-size: 18px;
    line-height: 36px;
    cursor: pointer;
    color: #64748b;
    transition: background 0.18s, color 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wm-otp-modal__close:hover {
    background: #e2e6f0;
    color: #1e293b;
}

/* ───── Icon ───── */
.wm-otp-modal__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
}

/* ───── Heading & Sub ───── */
.wm-otp-modal__title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}
.wm-otp-modal__subtitle {
    margin: 0 0 28px;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
}
.wm-otp-modal__email-hint {
    font-weight: 600;
    color: #3b4fce;
    word-break: break-all;
}

/* ───── OTP Digit Inputs ───── */
.wm-otp-modal__inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 0 0 28px;
}
.wm-otp-modal__inputs input {
    width: 48px;
    height: 58px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    caret-color: #3b4fce;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    outline: none;
    -moz-appearance: textfield;
}
.wm-otp-modal__inputs input::-webkit-outer-spin-button,
.wm-otp-modal__inputs input::-webkit-inner-spin-button { -webkit-appearance: none; }
.wm-otp-modal__inputs input:focus {
    border-color: #3b4fce;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 79, 206, 0.12);
}
.wm-otp-modal__inputs input.wm-otp-modal__input--filled {
    border-color: #3b4fce;
    background: #eef2ff;
}
.wm-otp-modal--error .wm-otp-modal__inputs input {
    border-color: #ef4444;
    background: #fef2f2;
    animation: wmShake 0.4s ease;
}
@keyframes wmShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    60%       { transform: translateX(5px); }
    80%       { transform: translateX(-3px); }
}

/* ───── Verify Button ───── */
.wm-otp-modal__verify {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b4fce 0%, #5b6fed 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: opacity 0.18s, transform 0.14s, box-shadow 0.18s;
    box-shadow: 0 4px 18px rgba(59, 79, 206, 0.3);
}
.wm-otp-modal__verify:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(59, 79, 206, 0.38);
}
.wm-otp-modal__verify:active:not(:disabled) { transform: translateY(0); }
.wm-otp-modal__verify:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ───── Status / Error Text ───── */
.wm-otp-modal__status {
    margin: 16px 0 0;
    min-height: 20px;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.wm-otp-modal--error .wm-otp-modal__status { color: #dc2626; }
.wm-otp-modal--success .wm-otp-modal__status { color: #16a34a; }

/* ───── Resend Row ───── */
.wm-otp-modal__resend-row {
    margin: 14px 0 0;
    font-size: 0.85rem;
    color: #94a3b8;
}
.wm-otp-modal__resend {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #3b4fce;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.18s;
}
.wm-otp-modal__resend:disabled {
    color: #94a3b8;
    text-decoration: none;
    cursor: default;
}
.wm-otp-modal__resend:hover:not(:disabled) { opacity: 0.75; }

/* ───── Spinner ───── */
.wm-otp-modal__spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 6px;
    animation: wmSpin 0.7s linear infinite;
}
@keyframes wmSpin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
    .wm-otp-modal__box { padding: 32px 20px 28px; }
    .wm-otp-modal__inputs input { width: 40px; height: 50px; font-size: 1.3rem; gap: 6px; }
    .wm-otp-modal__inputs { gap: 7px; }
}
