
/* نظام الألوان البلورية */
:root {
    --primary-crystal: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    --secondary-crystal: linear-gradient(135deg, rgba(240, 147, 251, 0.8) 0%, rgba(245, 87, 108, 0.8) 100%);
    --success-crystal: linear-gradient(135deg, rgba(79, 172, 254, 0.8) 0%, rgba(0, 242, 254, 0.8) 100%);
    --warning-crystal: linear-gradient(135deg, rgba(246, 211, 101, 0.8) 0%, rgba(253, 160, 133, 0.8) 100%);
    --dark-bg: #0f0f1a;
    --darker-bg: #0a0a12;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.08);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    --glow: 0 0 30px rgba(102, 126, 234, 0.4);
    --crystal-border: 1px solid rgba(255, 255, 255, 0.2);
}

/* الخلفية البلورية */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(240, 147, 251, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 30%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    animation: backgroundShift 10s ease-in-out infinite alternate;
    z-index: 0;
}

/* الحاوية المركزية */
.auth-container {
    width: 100%;
    max-width: 500px;
    z-index: 1;
    position: relative;
}

/* البطاقة البلورية */
.auth-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: var(--crystal-border);
    border-radius: 20px;
    padding: 40px 35px;
    box-shadow: 
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        var(--glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* رأس الصفحة */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--primary-crystal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow);
    position: relative;
    overflow: hidden;
}

.auth-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to bottom right, rgba(255,255,255,0.1), rgba(255,255,255,0));
    transform: rotate(30deg);
}

.auth-icon .icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.auth-header h1 {
    font-size: 2.2rem;
    background: linear-gradient(135deg, #fff 0%, #a8b1ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* النموذج */
.auth-form {
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.label-icon {
    font-size: 1.1rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* مجموعة الإدخال البلورية */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 14px 50px 14px 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.2),
        0 1px 0 rgba(255, 255, 255, 0.05);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 
        0 0 0 3px rgba(102, 126, 234, 0.2),
        inset 0 1px 3px rgba(0, 0, 0, 0.2),
        0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-icon {
    position: absolute;
    left: 15px;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
}

/* زر إظهار كلمة المرور */
.password-toggle {
    position: absolute;
    left: 15px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.password-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* التلميحات والرسائل */
.hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 5px;
    line-height: 1.4;
    padding-left: 5px;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #ff6b6b;
    font-size: 0.8rem;
    margin-top: 5px;
    padding-left: 5px;
}

.error-icon {
    font-size: 0.9rem;
}

/* قوة كلمة المرور */
.password-strength {
    margin-top: 8px;
    padding-left: 5px;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px currentColor;
}

.strength-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* شروط الخدمة */
.terms-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.3s ease;
}

.terms-label:hover {
    background: rgba(255, 255, 255, 0.05);
}

.terms-link {
    color: #a8b1ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.terms-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.checkbox-label input:checked + .checkmark {
    background: var(--primary-crystal);
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.checkbox-label input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* زر الإنشاء البلوري */
.auth-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.auth-btn.primary {
    background: var(--primary-crystal);
    color: white;
    box-shadow: 
        0 5px 15px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.auth-btn.primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.auth-btn.primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 
        0 10px 25px rgba(102, 126, 234, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.auth-btn.primary:hover:not(:disabled)::before {
    left: 100%;
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* تذييل الصفحة */
.auth-footer {
    text-align: center;
    color: var(--text-secondary);
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-link {
    color: #a8b1ff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.auth-link:hover {
    color: #ffffff;
}

.link-arrow {
    transition: transform 0.3s ease;
}

.auth-link:hover .link-arrow {
    transform: translateX(5px);
}

/* التنبيهات */
.alert {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #f8d7da;
    backdrop-filter: blur(5px);
}

.alert-icon {
    font-size: 1.5rem;
}

/* الرسوم المتحركة */
@keyframes backgroundShift {
    0% {
        transform: translateX(0) translateY(0);
    }
    100% {
        transform: translateX(-20px) translateY(-10px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: fadeInUp 0.8s ease-out;
}

/* التصميم المتجاوب */
@media (max-width: 768px) {
    .auth-wrapper {
        padding: 10px;
    }
    
    .auth-card {
        padding: 30px 25px;
        margin: 10px;
    }
    
    .auth-header h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 25px 20px;
    }
    
    .auth-header h1 {
        font-size: 1.6rem;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
}
