/* =========================================================================
   MsOTP — استایل فرم ورود/عضویت (فرانت)
   رنگ اکشن: #5caf21 | رنگ متن: #222 | RTL | بدون وابستگی خارجی
   ========================================================================= */

.msotp {
    --msotp-action: #5caf21;
    --msotp-action-dark: #4e9a1c;
    --msotp-action-light: #eaf6e1;
    --msotp-text: #222;
    --msotp-muted: #777;
    --msotp-border: #e2e2e2;
    --msotp-bg: #fff;
    --msotp-radius: 14px;
    --msotp-error: #e03131;

    box-sizing: border-box;
    direction: rtl;
    font-family: inherit;
    color: var(--msotp-text);
    width: 100%;
    max-width: 400px;
    margin-inline: auto;
}

.msotp *,
.msotp *::before,
.msotp *::after {
    box-sizing: border-box;
}

.msotp__card {
    background: var(--msotp-bg);
    border: 1px solid var(--msotp-border);
    border-radius: var(--msotp-radius);
    padding: 28px 24px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    position: relative;
}

.msotp__title {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--msotp-text);
    text-align: center;
}

.msotp__subtitle {
    font-size: 13px;
    color: var(--msotp-muted);
    margin: 0 0 22px;
    text-align: center;
    line-height: 1.7;
}

/* --- گام‌ها --- */
.msotp__step {
    display: none;
}

.msotp__step--active {
    display: block;
}

.msotp__step[hidden] {
    display: none;
}

.msotp__step.is-visible {
    display: block;
}

/* --- فیلدها --- */
.msotp__field {
    position: relative;
    margin-bottom: 14px;
}

.msotp__input {
    height: 50px !important;
    padding: 0 16px !important;
    font-size: 15px !important;
    color: var(--msotp-text);
    background: #fafafa;
    border: 1.5px solid var(--msotp-border) !important;
    border-radius: 10px !important;
    outline: none;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
    box-shadow: none !important;
    margin: 0;
    text-align: center;
}

.msotp__input::placeholder {
    color: #aaa;
}

.msotp__input:focus {
    border-color: var(--msotp-action);
    background: #fff;
    box-shadow: 0 0 0 3px var(--msotp-action-light);
}

.msotp__input.is-invalid {
    border-color: var(--msotp-error);
    box-shadow: 0 0 0 3px rgba(224, 49, 49, .12);
}

.msotp__toggle-pass {
    position: absolute;
    inset-inline-end: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--msotp-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 6px;
    margin: 0;
    font-weight: normal;
}
.msotp__field.msotp__field--password input.msotp__input {
    text-align: right;
}
.msotp__toggle-pass:hover {
    color: var(--msotp-action);
}

/* --- دکمه‌ها --- */
.msotp__btn {
    position: relative;
    width: 100%;
    height: 52px;
    border: none !important;
    font-size: 15px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    transition: auto;
    margin: 0;
}

button.msotp__btn.msotp__btn--primary {
    color: #fff;
}

.msotp__btn:active {
    transform: scale(.99);
}



.msotp__btn--primary:hover {
    background: var(--msotp-action-dark);
}

.msotp__btn--ghost {
    background: transparent;
    color: var(--msotp-text);
    border: 1.5px solid var(--msotp-border);
    text-decoration: none;
}

.msotp__btn--ghost:hover {
    border-color: var(--msotp-action);
    color: var(--msotp-action);
}

.msotp__btn[disabled],
.msotp__btn.is-loading {
    opacity: .7;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- spinner --- */
.msotp__spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: msotp-spin .6s linear infinite;
}

.msotp__btn.is-loading .msotp__spinner {
    display: inline-block;
}

.msotp__btn.is-loading .msotp__btn-text {
    opacity: .85;
}

@keyframes msotp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- باکس‌های کد OTP --- */
.msotp__otp {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.msotp__otp-box {
    width: 56px !important;
    height: 62px !important;
    text-align: center;
    font-size: 24px !important;
    font-weight: 700;
    color: var(--msotp-text) !important;
    background: #fafafa;
    border: 1.5px solid var(--msotp-border) !important;
    border-radius: 12px !important;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease !important;
    -moz-appearance: textfield;
    box-shadow: none !important;
    margin: 0;
}

.msotp__otp-box::-webkit-outer-spin-button,
.msotp__otp-box::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.msotp__otp-box:focus {
    border-color: var(--msotp-action);
    background: #fff;
    box-shadow: 0 0 0 3px var(--msotp-action-light);
}

.msotp__otp-box.is-filled {
    border-color: var(--msotp-action);
    background: var(--msotp-action-light);
}

/* --- بازگشت، لینک‌ها، تایمر --- */
.msotp__back {
    border: none;
    color: var(--msotp-muted) !important;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 10px;
    margin-bottom: 14px;
    font-family: inherit;
    font-weight: normal;
    margin: 0;
    position: absolute;
    top: 30px;
    right: 27px;
    background: #f4f5f7;
}

.msotp__back:hover {
    color: var(--msotp-action);
}

.msotp__link {
    border: none;
    background: transparent;
    color: var(--msotp-action);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    padding: 4px;
    margin: 0;
    font-weight: normal;
}

.msotp__link:hover {
    text-decoration: underline;
}

.msotp__link[disabled] {
    color: var(--msotp-muted);
    cursor: not-allowed;
    text-decoration: none;
}

.msotp__resend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 13px;
}

.msotp__timer {
    color: var(--msotp-muted);
    font-variant-numeric: tabular-nums;
}

.msotp__alt-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

/* --- پیام‌ها --- */
.msotp__message {
    margin-top: 16px;
    padding: 0;
    font-size: 13px;
    text-align: center;
    line-height: 1.7;
    min-height: 0;
}

.msotp__message.is-error {
    color: var(--msotp-error);
}

.msotp__message.is-success {
    color: var(--msotp-action-dark);
}

/* --- honeypot (مخفی از دید کاربر و screen reader) --- */
.msotp__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* =========================================================================
   ارتقای ظاهری مدرن (فاز ۷): انیمیشن، گرادیان، میکرواینترکشن
   ========================================================================= */

/* ظرف کارت: گرادیان لطیف و سایه عمقی */
.msotp__card {
    background:
        radial-gradient(120% 120% at 100% 0%, #f6fbf1 0%, #ffffff 42%);
    border: 1px solid #eef2ec;
    box-shadow:
        0 1px 2px rgba(17, 24, 39, .04),
        0 12px 32px -8px rgba(92, 175, 33, .12),
        0 24px 60px -20px rgba(17, 24, 39, .12);
}

/* آیکن/نشان بالای فرم */
.msotp__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, #5caf21, #4e9a1c);
    box-shadow: 0 8px 20px -6px rgba(92, 175, 33, .55);
    color: #fff;
}

.msotp__brand svg {
    width: 28px;
    height: 28px;
}

/* عنوان با وزن بیشتر و فاصله بهتر */
.msotp__title {
    font-size: 20px;
    letter-spacing: -.2px;
}

/* انیمیشن ورود نرم برای هر گام فعال */
.msotp__step--active {
    animation: msotp-step-in .32s cubic-bezier(.22, 1, .36, 1);
}

@keyframes msotp-step-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* input: حالت focus زنده‌تر و آیکن داخل فیلد */
.msotp__input {
    height: 54px;
    border-radius: 12px;
    border-width: 1.5px;
    transition: border-color .18s ease, box-shadow .22s ease, background .18s ease, transform .08s ease;
}

.msotp__input:focus {
    transform: translateY(-1px);
}

/* دکمه اصلی: گرادیان + درخشش هنگام hover */
.msotp__btn--primary {
    background: linear-gradient(135deg, #5caf21 0%, #4e9a1c 100%);
}




/* باکس‌های OTP: بزرگ‌تر، نرم‌تر، با حالت پرشده‌ی زنده */
.msotp__otp-box {
    width: 58px;
    height: 64px;
    border-radius: 14px;
    border-width: 1.5px;
    transition: border-color .16s ease, box-shadow .2s ease, background .16s ease, transform .1s ease;
}

.msotp__otp-box:focus {
    transform: translateY(-2px);
}

.msotp__otp-box.is-filled {
    background: linear-gradient(135deg, #eef9e4, #e3f4d4);
    border-color: #5caf21;
}

/* پیام‌ها: چیپ نرم به‌جای متن خشک */
.msotp__message:not(:empty) {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #f6f7f9;
}

.msotp__message.is-error:not(:empty) {
    background: #fdeced;
    color: #c92a2a;
}

.msotp__message.is-success:not(:empty) {
    background: #edf8e3;
    color: #3d7a14;
}

/* اسپینر داخل دکمه‌ی primary سفید‌تر */
.msotp__spinner {
    width: 19px;
    height: 19px;
}

/* =========================================================================
   دکمه ورود با گوگل + جداکننده
   ========================================================================= */
.msotp__divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0 16px;
    color: #aaa;
    font-size: 12px;
}

.msotp__divider::before,
.msotp__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ececec;
}

.msotp__divider span {
    padding: 0 12px;
}

.msotp__google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    border: 1.5px solid var(--msotp-border);
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease;
}

.msotp__google-btn:hover {
    border-color: #d0d0d0;
    background: #fafafa;
}

.msotp__google-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
}

.msotp__google-icon svg {
    width: 100%;
    height: 100%;
}

/* =========================================================================
   گام انتخاب روش ورود (تب کد/رمز)
   ========================================================================= */
.msotp__switch {
    display: flex;
    gap: 8px;
    background: #f4f5f7;
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 18px;
}

.msotp__switch-btn {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--msotp-muted);
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
    margin: 0;
    font-weight: normal;
}

.msotp__switch-btn.is-active {
    background: #E1F5FE;
    color: #03A9F4;
    border: 1px solid #81D4FA;
    font-weight: normal;
}

.msotp__switch-btn[hidden] {
    display: none;
}

/* وقتی فقط یک تب باقی می‌ماند (کاربر بدون رمز)، نوار سوییچ ساده‌تر شود */
.msotp__choice-note {
    font-size: 13px;
    color: var(--msotp-muted);
    text-align: center;
    margin: 0 0 16px;
    line-height: 1.8;
}

.msotp__choice-panel[hidden] {
    display: none;
}