﻿/* =============================================
   login.css  –  استایل اختصاصی صفحه ورود
   ============================================= */

.login-wrapper {
    background-color: var(--color-bg-primary, #f8f9fb);
    /*min-height: 100vh;*/
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
}

.login-card {
    background-color: var(--color-bg-secondary, #ffffff);
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-card, 0 8px 20px rgba(0,0,0,0.06));
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
    direction: rtl;
}

.login-wrapper .logo {
    width: 238px;
    height: auto;
    /*width: 80px;*/
    margin-bottom: 1.5rem;
}

.login-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 0.5rem 0;
}

.login-card p {
    font-size: 0.9rem;
    color: var(--color-text-quaternary);
    margin: 0 0 1.5rem 0;
}

/* گروه فیلد (باکس + خطا) */
.login-field-group {
    position: relative;
    margin-bottom: 0.5rem;
}

.login-card input {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--color-bg-quaternary, #f0f3f7);
    border: 1px solid var(--color-border-primary, #d7dde4);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 2px;
    outline: none;
    transition: border-color 0.2s;
}

.login-card input:focus {
    border-color: var(--color-bg-quaternary, #f0f3f7);
    box-shadow: none;
}

.login-card button {
   /* width: 100%;*/
    margin-top: 0.5rem;
}

.login-card a {
    color: var(--color-active);
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-block;
    margin-top: 0.5rem;
}

.login-card a:hover {
    text-decoration: underline;
}

/* پیغام خطا (چسبیده و بدون جابجایی) */
.field-validation-error {
    position: absolute;
    bottom: -1.3rem;
    left: 0;
    right: 0;
    font-size: 0.75rem;
    color: var(--form-text-error-color, #f02e00);
    white-space: nowrap;
    text-align: right;
    pointer-events: none;
}

/* تایمر و ارسال مجدد */
.login-card .timer {
    font-size: 0.85rem;
    color: var(--color-text-quaternary);
    margin: 0.8rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* دکمه ارسال مجدد – پیش‌فرض مخفی */
#resendBtn {
    display: none;
}
#resendBtn.visible {
    display: inline-block;
    width: auto;
    background: none;
    border: none;
    color: var(--color-active);
    cursor: pointer;
    padding: 0;
}

#step-otp h2 {
    margin-bottom: 1.5rem;
}
#step-otp p {
    margin-bottom: 1rem;
}
.step-mobile-desc{
    font-size: 0.80rem !important;
}

/* کانتینر اصلی */
.otp-container {
    position: relative;
    width: 280px;
    margin: 0 auto;
    direction: ltr; /* حتما LTR باشه برای اعداد */
}

/* اینپوت اصلی رو مخفی می‌کنیم ولی روی همه چیز هست */
.otp-real-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 45px;
    opacity: 0.01; /* کاملاً شفاف */
    z-index: 100;
    cursor: pointer;
    letter-spacing: 35px; /* فاصله بین اعداد هنگام تایپ */
    padding-left: 20px;
}

/* لایه‌ای که باکس‌ها و خط‌ها رو نشون می‌ده */
.otp-display-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    z-index: 1;
}

.otp-slot {
    width: 40px;
    height: 50px;
    border-bottom: 3px solid #ccc; /* همون خط تیره‌ای که می‌خواستی */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    transition: all 0.2s;
}

/* وقتی کاربر روی اینپوت کلیک می‌کنه، خط زیرین رنگی بشه */
.otp-real-input:focus + .otp-display-wrapper .otp-slot {
    border-bottom-color: #28a745; /* سبز برند شما */
}

/* کلاس کمکی برای وقتی که عدد وارد شده */
.otp-slot.filled {
    border-bottom-color: #28a745;
}

/* پوشاننده فیلد کد */
/*.otp-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}*/

/* فیلد مخفی واقعی (شفاف روی خطوط) */
/*.otp-masked {
    width: 100%;
    padding: 12px 14px;
    font-size: 1.5rem;
    letter-spacing: 0.8em;*/         /* فاصله بین کاراکترها */
    /*text-align: center;
    background: transparent;*/       /* پس‌زمینه شفاف تا خطوط دیده شوند */
    /*border: 1px solid var(--color-border-primary, #d7dde4);
    border-radius: 12px;
    color: var(--color-text-primary);*/            /* متن واقعی را مخفی کن */
    /*caret-color: var(--color-active);*/ /* رنگ نشانگر */
    /*position: relative;
    z-index: 2;
}*/

/* خطوط راهنما (۶ خط تیره با فاصله) */
/*.otp-mask-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #aaa;
    font-size: 1.5rem;
    letter-spacing: 0.8em;
    pointer-events: none;
    z-index: 1;
    white-space: nowrap;
}*/

/* وقتی فیلد فوکوس دارد، خطوط را کمی محوتر نشان بده */
/*.otp-input-wrapper:focus-within .otp-mask-placeholder {
    color: #ccc;
}*/

/* دکمهٔ وسط‌چین بدون عرض کامل */
.frm-btn-center {
    width: auto !important;
    display: inline-block !important;
    margin-left: auto;
    margin-right: auto;
}


/* ===== انیمیشن لرزاندن در خطا ===== */
@@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.otp-container.shake {
    animation: shake 0.5s ease-in-out;
}

/* ===== استایل دکمه ارسال مجدد ===== */
#resendBtn {
    display: none;
    background: none;
    border: none;
    color: var(--color-active, #1976d2);
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    font-family: inherit;
}

#resendBtn.visible {
    display: inline-block;
}

#resendBtn:disabled {
    color: #adb5bd;
    cursor: not-allowed;
}

/* ===== تایمر ===== */
.timer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding: 8px 0;
}

#timerText {
    font-size: 0.85rem;
    color: var(--color-text-quaternary, #6c757d);
    direction: ltr;
}