/* فونت */
@font-face {
    font-family: 'IRANYekanXFaNum';
    src: url('../fonts/IRANYekanXFaNum-Regular.woff2') format('woff2'),
         url('../fonts/IRANYekanXFaNum-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* کانتینر اصلی فرم – همیشه سفید */
.avs-form-container{
    max-width: 420px;
    margin: 40px auto;
    padding: 35px;
    background: #ffffff;         /* اینجا فرم سفید می‌ماند */
    border-radius: 14px;
    position: relative;
    font-family: 'IRANYekanXFaNum', Tahoma, sans-serif;
    direction: rtl;
}

/* اگر جایی قبلاً نوشتی background: #183661؛ اون رو از روی .avs-form-container بردار */
 
.avs-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}

.avs-logo img {
    max-width: 150px;
    height: auto;
}

/* دکمه بازگشت گوشه فرم */
.avs-back-btn{
    position:absolute;
    top: 0;
    right: 0;
    background:none;
    border:none;
    cursor:pointer;
    padding: 4px;
    display: none; /* در مرحله اول مخفی */
}
.avs-back-btn svg path {
    stroke: #6c757d; /* خاکستری */
}

/* عنوان و زیرعنوان */
.avs-title {
    font-size: 1.25rem; /* 20px */
    font-weight: 700;
    color: #343a40;
    margin-bottom: 12px;
}

.avs-subtitle {
    font-size: 0.875rem; /* 14px */
    color: #6c757d;
    margin-bottom:  24px;
}

/* فیلدها */
.avs-input-group {
    position: relative;
    margin-bottom: 20px;
}

.avs-input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem; /* 16px */
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

/* لیبل شناور */
.avs-input-group label {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    padding: 0 4px;
    color: #adb5bd;
    pointer-events: none;
    transition: all 0.2s;
    font-size: 1rem;
}

.avs-input-group input:focus,
.avs-input-group input:not(:placeholder-shown) {
    border-color: #333333; /* فقط جایگزینی آبی */
}

.avs-input-group input:focus + label,
.avs-input-group input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 0.75rem; /* 12px */
    color: #333333; /* فقط جایگزینی آبی */
    background: #fff;
    transform: translateY(-50%);
}

/* حالت خطا */
.avs-input-group.has-error input {
    border-color: #dc3545 !important;
}
.avs-input-group.has-error label {
    color: #dc3545 !important;
}

.avs-error-text {
    color: #dc3545;
    font-size: 0.8rem; /* 13px */
    margin-top: 5px;
    display: none; /* اول مخفی */
    align-items: center;
    gap: 5px;
}
.avs-error-text svg {
    width: 16px;
    height: 16px;
}

/* وقتی کلاس has-error روی گروه می‌آید، خطا نمایش داده شود */
.avs-input-group.has-error .avs-error-text {
    display: flex;
}

/* دکمه اصلی */
/* --- دکمه‌ها --- */
.avs-main-btn {
    width: 100%;
    background: #ffffff;             /* پس‌زمینه سفید */
    color: #183661;                  /* رنگ متن */
    border: 1px solid #183661;       /* کادر آبی */
    padding: 14px;
    border-radius: 12px;             /* گردی ۱۲ پیکسل */
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: none;                /* غیرفعال کردن افکت‌های هاور */
}

/* غیرفعال کردن هرگونه افکت هاور */
.avs-main-btn:hover {
    background: #ffffff;
    color: #183661;
    border: 1px solid #183661;
}

/* --- آیکون بازگشت --- */
.avs-back-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: none;                /* حذف پس‌زمینه اضافی */
    border: none;
    cursor: pointer;
    padding: 4px;
    display: none;
}
.avs-back-btn svg {
    display: block;                  /* جلوگیری از حاشیه اضافه */
}

/* --- فیلد شماره موبایل (تایپ از راست) --- */
#avs_phone, #avs_otp {
    text-align: right;               /* اجبار به راست‌چین بودن */
    direction: ltr;                  /* برای اینکه اعداد موبایل درست نمایش داده شوند */
}
/* لیبل فیلدها باید فارسی بماند، پس جهت لیبل را در صورت نیاز اصلاح می‌کنیم */
.avs-input-group label {
    direction: rtl;
}


/* ریسپانسیو */
@media (max-width: 480px) {
    .avs-form-container {
        margin: 0;
        width: 100%;
        min-height: 70vh;
        border-radius: 0;
        border: none;
        padding: 25px;
    }
    .avs-logo img {
        max-width: 120px;
    }
}
/* دکمه‌های فرم اوستاصنعت */
.avs-form-container .avs-main-btn{
    width: 100%;
    background: #ffffff !important;
    color: #183661 !important;
    border: 1px solid #183661 !important;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
}

/* حذف کامل هاور */
.avs-form-container .avs-main-btn:hover{
    background: #ffffff !important;
    color: #183661 !important;
    border: 1px solid #183661 !important;
}
.avs-back-btn{
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ظرف نگهدارنده باکس‌های کد */
.avs-otp-container {
    display: flex;
    justify-content: space-between; /* فاصله مساوی بین باکس‌ها */
    direction: ltr !important;      /* چپ به راست برای ترتیب درست اعداد */
    margin: 25px 0;
    gap: 10px;                     /* فاصله کوچک بین باکس‌ها */
}

/* استایل هر باکس تکی */
.otp-input {
    width: 60px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    border: 1px solid #e0e0e2 !important; /* رنگ کادر مشابه دیجی‌کالا */
    border-radius: 12px;
    background: #ffffff;
    color: #183661;
    transition: all 0.2s;
}

/* افکت فوکوس روی هر باکس */
.otp-input:focus {
    border-color: #183661 !important;
    outline: none;
    box-shadow: 0 0 5px rgba(24, 54, 97, 0.2);
}

/* استایل دکمه بازگشت برای حذف اون مربع آبی که گفتی */
.avs-back-btn {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}
.avs-logo img.avs-logo-img{
  width: 90px !important;   /* اندازه دلخواه */
  max-width: 90px !important;
  height: auto !important;
  display: block;
}

.avs-logo a.avs-logo-link{
  display: inline-block;
  line-height: 0;
}
/* کانتینر اصلی فرم */
.avs-login-wrapper {
    position: fixed !important; /* این خط باعث می‌شود کانتینر از جریان عادی صفحه خارج شود */
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important; /* تمام عرض مرورگر */
    height: 100dvh !important; /* تمام ارتفاع مرورگر بدون اسکرول */
    background: #fff !important;
    z-index: 99999 !important; /* می‌آید روی همه چیز (هدر و فوتر) قرار می‌گیرد */
    display: flex !important;
    align-items: center !important; /* وسط‌چین عمودی */
    justify-content: center !important; /* وسط‌چین افقی */
    overflow: hidden !important;
}

/* باکس فرم داخل آن */
.avs-form-card {
    width: 90% !important;
    max-width: 420px !important;
    margin: 0 auto !important;
}
