/* ==========================================================================
   Authentication Styles (auth.css) - نالش
   يحتوي على: نوافذ تسجيل الدخول، إدخال رقم الهاتف، رموز الـ OTP، وتحدي النقر الذكي
   ========================================================================== */

/* ----------------------------------
   1. النافذة المنبثقة والخلفية (Overlay & Card)
------------------------------------- */
#auth-page-overlay { 
    position: fixed; 
    inset: 0; 
    z-index: 2000; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    opacity: 0; 
    visibility: hidden; 
    transition: all 0.4s ease; 
    background: rgba(15, 23, 42, 0.6); 
    backdrop-filter: blur(15px); 
}

#auth-page-overlay.open { 
    opacity: 1; 
    visibility: visible; 
}

.auth-card { 
    width: 90%; 
    max-width: 420px; 
    position: relative; 
    background: var(--bg-card); 
    border: 1px solid var(--border); 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); 
    border-radius: 30px; 
    padding: 40px 30px; 
    text-align: center; 
    color: var(--text-main); 
    transform: translateY(30px); 
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); 
    z-index: 2001;
}

#auth-page-overlay.open .auth-card { 
    transform: translateY(0); 
}

#auth-close-btn { 
    position: absolute; 
    top: 15px; 
    left: 15px; 
    width: 40px; 
    height: 40px; 
    background: var(--bg-body); 
    color: var(--text-main); 
    border: 1px solid var(--border); 
    border-radius: 50%; 
    cursor: pointer; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    transition: 0.2s;
}

.auth-card h3 { 
    font-size: 2.2rem; 
    margin-bottom: 10px; 
    font-weight: 900; 
}

.auth-card p { 
    color: var(--text-muted); 
    font-size: 1.1rem; 
    margin-bottom: 25px; 
    line-height: 1.5; 
}

/* ----------------------------------
   2. حقل إدخال رقم الهاتف (Phone Input)
------------------------------------- */
#auth-phone-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.phone-input-group {
    width: 100%;
    margin-bottom: 10px;
    direction: ltr !important; /* إجبار الاتجاه من اليسار لليمين */
}

.phone-input-container {
    display: flex;
    align-items: center;
    background: var(--bg-body) !important;
    border: 1px solid rgba(150, 150, 150, 0.2) !important;
    border-radius: 16px !important;
    height: 60px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
}

.phone-input-container:focus-within {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15) !important;
    background-color: var(--bg-card) !important;
}

.country-code {
    padding: 0 15px;
    background: rgba(0,0,0,0.04);
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--text-main);
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    letter-spacing: 1px;
}

.phone-input-field {
    flex: 1;
    min-width: 0;
    border: none !important;
    background: transparent !important;
    font-size: 1.3rem !important;
    font-weight: 900;
    padding: 0 15px;
    letter-spacing: 2px;
    text-align: left;
    box-shadow: none !important;
    height: 100%;
    color: var(--text-main);
}

.phone-input-field:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* ----------------------------------
   3. مربعات كود التحقق (OTP Boxes)
------------------------------------- */
.modern-otp-container { 
    display: flex; 
    gap: 8px; 
    justify-content: center; 
    margin-bottom: 30px; 
    direction: ltr; 
}

.otp-box { 
    width: 45px; 
    height: 55px; 
    border-radius: 12px; 
    border: 2px solid var(--border); 
    background: var(--bg-body); 
    font-size: 1.5rem; 
    font-weight: 900; 
    text-align: center; 
    color: var(--text-main); 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
    caret-color: var(--primary); 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); 
    padding: 0; 
}

.otp-box.filled { 
    border-color: var(--primary); 
    background: rgba(79, 70, 229, 0.05); 
    color: var(--primary); 
}

.otp-box:focus { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15), inset 0 2px 4px rgba(0,0,0,0.02); 
    outline: none; 
    transform: translateY(-3px); 
    background: var(--bg-card); 
}

.otp-box.error { 
    border-color: var(--danger) !important; 
    color: var(--danger) !important; 
    background: rgba(244, 63, 94, 0.05) !important; 
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both; 
}

.otp-box.success { 
    border-color: var(--success) !important; 
    color: var(--success) !important; 
    background: rgba(16, 185, 129, 0.05) !important; 
    transform: scale(1.05); 
}

@keyframes shake { 
    10%, 90% { transform: translate3d(-1px, 0, 0); } 
    20%, 80% { transform: translate3d(2px, 0, 0); } 
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); } 
    40%, 60% { transform: translate3d(4px, 0, 0); } 
}

/* ----------------------------------
   4. تحدي النقر الذكي (Smart Tap)
------------------------------------- */
.smart-tap-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
    min-height: 180px;
}

.smart-tap-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 0 4px var(--bg-body), 0 0 0 6px var(--primary);
    transition: all 0.3s ease;
    padding: 0;
}

.smart-tap-btn .icon-container {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2rem;
    z-index: 2;
    transition: all 0.3s;
}

.smart-tap-btn .progress-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    z-index: 1;
    pointer-events: none;
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.1s linear;
}

.instruction-text {
    margin-top: 15px;
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-muted);
    text-align: center;
}