/**
 * Mobile Auth Pro - Frontend Styles
 * استایل‌های دیفالت منطبق با صفحه لاگین
 */

/* ========================================
   متغیرهای پایه (بر اساس استایل صفحه)
   ======================================== */
:root {
    /* رنگ‌های اصلی */
    --sms-primary: #4F46E5;
    --sms-primary-hover: #4338CA;
    --sms-primary-light: #EEF2FF;

    /* رنگ‌های وضعیت */
    --sms-success: #10B981;
    --sms-error: #EF4444;

    /* رنگ‌های پس‌زمینه و متن */
    --sms-bg: #FFFFFF;
    --sms-bg-alt: #F9FAFB;
    --sms-text: #111827;
    --sms-text-secondary: #5A5A5A;
    --sms-border: #C6A15B45;

    /* ابعاد و فاصله‌ها */
    --sms-radius: 12px;
    --sms-radius-sm: 8px;
    --sms-padding: 24px;
    --sms-gap: 16px;

    /* سایه‌ها */
    --sms-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);

    /* انیمیشن‌ها */
    --sms-transition: 0.3s ease;
}

/* ========================================
   کانتینر اصلی (مطابق با استایل صفحه)
   ======================================== */
.sms-auth-container {
    direction: rtl;
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    padding: var(--sms-padding);
    background: var(--sms-bg);
    border-radius: var(--sms-radius);
    box-shadow: var(--sms-shadow);
    border: 1px solid var(--sms-border);
    transition: all var(--sms-transition);
    position: relative;
}

/* ========================================
   انیمیشن‌های ورود (Entrance)
   ======================================== */

/* ۱. محو شدن (Fade) */
.sms-auth-container.animation-fade {
    animation: smsFadeIn 0.4s ease forwards;
}

/* ۲. اسلاید (Slide) */
.sms-auth-container.animation-slide {
    animation: smsSlideIn 0.5s ease forwards;
}

/* ۳. بزرگ‌نمایی (Scale) */
.sms-auth-container.animation-scale {
    animation: smsScaleIn 0.5s ease forwards;
}

/* ۴. جهش (Bounce) */
.sms-auth-container.animation-bounce {
    animation: smsBounceIn 0.6s ease forwards;
}

/* ۵. درخشش (Glow) */
.sms-auth-container.animation-glow {
    animation: smsGlowPulse 2s ease infinite;
}

/* ۶. شناور (Float) */
.sms-auth-container.animation-float {
    animation: smsFloat 3s ease-in-out infinite;
}

/* ۷. ضربان (Pulse) */
.sms-auth-container.animation-pulse {
    animation: smsPulse 2s ease infinite;
}

/* ۸. چرخش (Rotate) */
.sms-auth-container.animation-rotate {
    animation: smsRotateIn 0.6s ease forwards;
}

/* ========================================
   انیمیشن‌های هاور (Hover)
   ======================================== */

/* شناور هاور */
.sms-auth-container.hover-float:hover {
    animation: smsFloat 2s ease-in-out infinite;
}

/* ضربان هاور */
.sms-auth-container.hover-pulse:hover {
    animation: smsPulse 1.5s ease infinite;
}

/* درخشش هاور */
.sms-auth-container.hover-glow:hover {
    animation: smsGlowPulse 1.5s ease infinite;
}

/* بزرگ‌نمایی هاور */
.sms-auth-container.hover-scale:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
}

/* چرخش هاور */
.sms-auth-container.hover-rotate:hover {
    transform: rotate(1deg) scale(1.02);
}

/* ========================================
   تعریف انیمیشن‌های کلیدی (Keyframes)
   ======================================== */

/* محو شدن */
@keyframes smsFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* اسلاید */
@keyframes smsSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* بزرگ‌نمایی */
@keyframes smsScaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* جهش */
@keyframes smsBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

/* درخشش */
@keyframes smsGlowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(79, 70, 229, 0.1);
    }

    50% {
        box-shadow: 0 0 40px rgba(79, 70, 229, 0.25), 0 0 60px rgba(79, 70, 229, 0.1);
    }
}

/* شناور */
@keyframes smsFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ضربان */
@keyframes smsPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }
}

/* چرخش */
@keyframes smsRotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }

    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* ========================================
   لوگو و هدر فرم (مطابق با استایل صفحه)
   ======================================== */
.sms-auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.sms-auth-header .site-logo {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}

.sms-auth-header .site-logo img {
    max-width: 95px;
    max-height: 95px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: all var(--sms-transition);
}

.sms-auth-header .site-logo img:hover {
    transform: scale(1.05) rotate(-3deg);
}

.sms-auth-header .site-logo .logo-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--sms-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--sms-primary);
    transition: all var(--sms-transition);
}

.sms-auth-header .site-logo .logo-placeholder:hover {
    transform: scale(1.05) rotate(-3deg);
    background: var(--sms-primary);
    color: #fff;
}

.sms-auth-header .site-title {
    font-size: 24px;
    font-weight: 600;
    color: #1E1E1E;
    margin: 0 0 2px;
}

.sms-auth-header .site-title a {
    color: inherit;
    text-decoration: none;
    transition: all var(--sms-transition);
}

.sms-auth-header .site-title a:hover {
    color: var(--sms-primary);
}

.sms-auth-header .form-subtitle {
    font-size: 14px;
    color: var(--sms-text-secondary);
    margin: 0;
}

/* ========================================
   استپ‌های فرم
   ======================================== */
.sms-auth-step-panel {
    display: flex;
    flex-direction: column;
    gap: var(--sms-gap);
    animation: smsFadeIn 0.4s ease;
}

/* ========================================
   فیلدهای ورودی (مطابق با استایل صفحه)
   ======================================== */
.sms-auth-field {
    position: relative;
}

.sms-auth-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
}

.sms-auth-label .required {
    color: var(--sms-error);
    margin-right: 4px;
}

.sms-auth-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #00000035;
    border-radius: var(--sms-radius-sm);
    font-size: 16px;
    font-weight: 500;
    color: #111827;
    background: transparent;
    transition: all var(--sms-transition);
    box-sizing: border-box;
    direction: ltr;
    text-align: center;
    letter-spacing: 1px;
}

.sms-auth-input:focus {
    border-color: #C6A15B35;
    outline: none;
    background: transparent;
}

.sms-auth-input:hover {
    border-color: #C6A15B50;
}

.sms-auth-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sms-auth-input.error {
    border-color: var(--sms-error);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    animation: smsShake 0.4s ease;
}

.sms-auth-input.success {
    border-color: var(--sms-success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* انیمیشن تکان خوردن برای خطا */
@keyframes smsShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

/* فیلد OTP اختصاصی */
#sms-otp-input {
    font-size: 28px;
    letter-spacing: 12px;
    font-weight: 700;
    padding: 16px 12px;
    text-align: center;
}

/* ========================================
   دکمه‌ها (مطابق با استایل صفحه)
   ======================================== */
.sms-auth-btn {
    width: 100%;
    padding: 12px 22px;
    border: 2px solid transparent;
    border-radius: var(--sms-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--sms-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

/* افکت ریپل برای دکمه */
.sms-auth-btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, 0.2) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.sms-auth-btn-primary:hover::after {
    opacity: 1;
}

.sms-auth-btn-primary {
    background: #4F46E5;
    color: #FFFFFF;
    border-color: #4F46E5;
}

.sms-auth-btn-primary:hover:not(:disabled) {
    background: #4338CA;
    border-color: #4338CA;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}

.sms-auth-btn-primary:active:not(:disabled) {
    transform: scale(0.96);
}

.sms-auth-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.sms-auth-btn-primary .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: smsSpin 0.6s linear infinite;
}

/* ========================================
   تایمر (مطابق با استایل صفحه)
   ======================================== */
.sms-auth-timer-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
}

.sms-auth-timer-wrapper .timer-label {
    font-size: 14px;
    color: #6B7280;
}

.sms-auth-timer-wrapper .timer-value {
    font-weight: 700;
    color: #4F46E5;
    font-size: 18px;
    min-width: 30px;
    display: inline-block;
    transition: all var(--sms-transition);
}

.sms-auth-timer-wrapper .timer-value.warning {
    color: var(--sms-error);
    animation: smsPulse 0.5s ease infinite;
}

.sms-auth-timer-wrapper .timer-unit {
    font-size: 14px;
    color: #6B7280;
}

/* ========================================
   لینک‌ها (مطابق با استایل صفحه)
   ======================================== */
.sms-auth-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.sms-auth-link {
    font-size: 13px;
    color: #6B7280;
    text-decoration: none;
    transition: all var(--sms-transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.sms-auth-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--sms-primary);
    transition: width var(--sms-transition);
}

.sms-auth-link:hover {
    color: var(--sms-primary);
}

.sms-auth-link:hover::after {
    width: 100%;
}

/* ========================================
   پیام‌های هشدار (مطابق با استایل صفحه)
   ======================================== */
.sms-auth-alert {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--sms-radius-sm);
    font-size: 14px;
    line-height: 1.6;
    animation: smsFadeIn 0.3s ease;
    display: none;
}

.sms-auth-alert.error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.sms-auth-alert.success {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #065F46;
}

.sms-auth-alert.info {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E40AF;
}

/* ========================================
   ریسپانسیو
   ======================================== */
@media (max-width: 480px) {
    .sms-auth-container {
        padding: 20px;
    }

    .sms-auth-header .site-title {
        font-size: 18px;
    }

    #sms-otp-input {
        font-size: 22px;
        letter-spacing: 8px;
        padding: 14px 10px;
    }

    .sms-auth-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}