/* ============================================
   صفحة تسجيل الدخول - تصميم احترافي جديد
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary: #5B21B6;
    --primary-light: #7C3AED;
    --secondary: #EC4899;
    --danger: #EF4444;
    --success: #10B981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    padding: 20px;
}

/* خلفية متحركة احترافية */
body::before {
    content: '';
    position: absolute;
    width: 300%;
    height: 300%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(91, 33, 182, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(124, 58, 237, 0.3) 0%, transparent 50%);
    animation: backgroundMove 25s ease-in-out infinite;
    z-index: 0;
}

@keyframes backgroundMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(50px, -50px) rotate(120deg); }
    66% { transform: translate(-50px, 50px) rotate(240deg); }
}

/* دوائر متحركة */
body::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(91, 33, 182, 0.2), transparent);
    top: -250px;
    right: -250px;
    animation: float 15s ease-in-out infinite;
    z-index: 0;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(100px, 100px) scale(1.2); }
}

.login-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px);
    border-radius: 32px;
    padding: 56px 48px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(91, 33, 182, 0.1), transparent);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.logo {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
    z-index: 1;
}

.logo-icon {
    width: 96px;
    height: 96px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    box-shadow: 0 15px 40px rgba(91, 33, 182, 0.5);
    position: relative;
    overflow: hidden;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: rotate(45deg);
    animation: shine 4s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.logo h1 {
    font-size: 36px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.logo p {
    color: #64748b;
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

/* Input Groups */
.input-group {
    position: relative;
    margin-bottom: 28px;
}

.input-group i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    transition: color 0.3s;
    z-index: 2;
    font-size: 18px;
}

.input-group input {
    width: 100%;
    padding: 18px 60px 18px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 16px;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s;
    background: #f8fafc;
    color: var(--dark);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 5px rgba(91, 33, 182, 0.1);
    transform: translateY(-2px);
}

.input-group input:focus + i,
.input-group:focus-within i {
    color: var(--primary);
}

.input-group.error input {
    border-color: var(--danger);
    animation: shake 0.5s;
    background: rgba(239, 68, 68, 0.05);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.input-group.error i {
    color: var(--danger);
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(91, 33, 182, 0.4);
    margin-top: 8px;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.7s, height 0.7s;
}

.btn-login:hover::before {
    width: 400px;
    height: 400px;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 45px rgba(91, 33, 182, 0.5);
}

.btn-login:active {
    transform: translateY(-1px);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Alerts */
.alert {
    padding: 18px 20px;
    border-radius: 16px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: slideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-right: 4px solid;
    position: relative;
    z-index: 1;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border-color: var(--danger);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border-color: var(--success);
}

.alert i {
    font-size: 20px;
}

/* Countdown Box */
.countdown-box {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 28px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(91, 33, 182, 0.4);
    animation: pulse 2s infinite;
    position: relative;
    z-index: 1;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 15px 35px rgba(91, 33, 182, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 20px 45px rgba(91, 33, 182, 0.6); }
}

.countdown-timer {
    font-size: 40px;
    font-weight: 900;
    margin: 16px 0;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.countdown-label {
    font-size: 15px;
    opacity: 0.95;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Security Alert */
.security-alert {
    background: rgba(255, 243, 205, 0.95);
    border: 2px solid #ffc107;
    color: #856404;
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 24px;
    font-size: 15px;
    text-align: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    font-weight: 600;
}

.security-alert i {
    margin-left: 8px;
    font-size: 18px;
}

/* Footer */
.footer-text {
    text-align: center;
    margin-top: 40px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.login-info {
    margin-top: 16px;
    font-size: 13px;
    opacity: 0.85;
}

.login-info i {
    margin-left: 6px;
}

.version-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    margin-top: 8px;
    box-shadow: 0 10px 24px rgba(15,23,42,0.18);
    border: 1px solid rgba(255,255,255,0.15);
    animation: floatUpDown 3s ease-in-out infinite;
}

.form-note {
    margin-top: 16px;
    font-size: 13px;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 10px 12px;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    .login-box {
        padding: 40px 28px;
        border-radius: 24px;
    }
    
    .logo h1 {
        font-size: 32px;
    }
    
    .logo-icon {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }
    
    .countdown-timer {
        font-size: 32px;
    }
    
    .input-group input {
        padding: 16px 55px 16px 18px;
    }
    
    .btn-login {
        padding: 16px;
        font-size: 16px;
    }
}