/* Authentication Styles - RTL Support */

/* Base RTL Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: ltr;
    text-align: left;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

/* خلفية متحركة */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.floating-shapes {
    position: relative;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.shape-3 {
    width: 60px;
    height: 60px;
    top: 80%;
    left: 20%;
    animation-delay: 4s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    top: 30%;
    right: 30%;
    animation-delay: 1s;
}

.shape-5 {
    width: 70px;
    height: 70px;
    top: 70%;
    right: 5%;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 1;
    }
}

/* تأثيرات إضافية للخلفية */
.shape::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.8;
    }
}

.auth-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Auth Container */
.auth-container {
    width: 100%;
    /*max-width: 400px;*/
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-container .auth-card-large {
    max-width: 800px;
    width: 100%;
}

/* Auth Card */
.auth-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    animation: cardSlideIn 0.6s ease;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
}

.auth-card-large {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 800px;
    animation: cardSlideIn 0.6s ease;
    position: relative;
    overflow: hidden;
}

.auth-card-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container {
    margin-bottom: 20px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    animation: logoRotate 3s ease-in-out infinite;
}

.logo-circle i {
    font-size: 32px;
    color: white;
}

@keyframes logoRotate {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(10deg);
    }
}

.auth-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    display: block;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.auth-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
}

.auth-header p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Sections */
.form-section {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.form-section legend {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    padding: 0 10px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section legend i {
    color: #667eea;
    font-size: 20px;
}

/* Form Groups */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: #667eea;
    font-size: 16px;
}

/* Input Container */
.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-container input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.input-container input:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-container.focused input {
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-icon {
    position: absolute;
    right: 15px;
    color: #adb5bd;
    font-size: 16px;
    transition: color 0.3s ease;
    pointer-events: none;
}

.input-container.focused .input-icon {
    color: #667eea;
}

.password-toggle {
    position: absolute;
    left: 15px;
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.3s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: #667eea;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #adb5bd;
}

/* Form Rows */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Error Messages */
.error-message {
    font-size: 12px;
    color: #dc3545;
    font-weight: 500;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.error-message::before {
    /*content: '⚠️';*/
    font-size: 12px;
}

/* Success Messages */
.success-message {
    font-size: 12px;
    color: #28a745;
    font-weight: 500;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.success-message::before {
    content: '✅';
    font-size: 12px;
}

/* Help Text */
.help-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
    height: 6px;
    border-radius: 3px;
    background-color: #e9ecef;
    overflow: hidden;
    position: relative;
}

.password-strength::after {
    content: '';
    display: block;
    height: 100%;
    width: 0%;
    background-color: #dc3545;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.password-strength.weak::after {
    width: 25%;
    background-color: #dc3545;
}

.password-strength.medium::after {
    width: 50%;
    background-color: #ffc107;
}

.password-strength.strong::after {
    width: 100%;
    background-color: #28a745;
}

/* File Upload Container */
.file-upload-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    border: 2px dashed #e9ecef;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.file-upload-container:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f2ff 0%, #ffffff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.file-upload-container.file-selected {
    border-color: #28a745;
    background: linear-gradient(135deg, #f0fff4 0%, #ffffff 100%);
}

.file-upload-container input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #6c757d;
    font-weight: 500;
    transition: color 0.3s ease;
}

.file-upload-label i {
    font-size: 32px;
    color: #667eea;
    transition: all 0.3s ease;
}

.file-upload-container:hover .file-upload-label i {
    transform: scale(1.1);
    color: #5a6fd8;
}

.file-upload-container.file-selected .file-upload-label {
    color: #28a745;
}

.file-upload-container.file-selected .file-upload-label i {
    color: #28a745;
}

/* File Input Styles */
.form-group input[type="file"] {
    padding: 8px;
    background-color: white;
    border: 2px dashed #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group input[type="file"]:hover {
    border-color: #667eea;
    background-color: #f8f9fa;
}

/* File Preview */
.file-preview {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.file-preview img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #2c3e50;
    line-height: 1.5;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    transform: scale(1.3);
    accent-color: #667eea;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked {
    transform: scale(1.4);
}

.checkbox-label a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.checkbox-label a:hover {
    text-decoration: underline;
    color: #5a6fd8;
}

/* Form Actions */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

/* Button Styles */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    position: relative;
    overflow: hidden;
}

.btn::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;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* Auth Links */
.auth-links {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: rgba(102, 126, 234, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.auth-link:hover {
    color: white;
    background-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-decoration: none;
}

.auth-link i {
    font-size: 16px;
}

/* Alert Container */
.alert-container {
    margin-top: 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: alertSlideIn 0.3s ease;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
    opacity: 0.3;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert .icon {
    font-size: 16px;
}

/* Loading State */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn-primary.loading::after {
    border-top-color: white;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Validation States */
.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: #28a745;
    background-color: #f8fff9;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #dc3545;
    background-color: #fff8f8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 15px;
    }
    
    .auth-card,
    .auth-card-large {
        padding: 25px;
        margin: 0;
        max-width: 100%;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .auth-header p {
        font-size: 14px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .form-section {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .form-section legend {
        font-size: 16px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .logo-circle {
        width: 60px;
        height: 60px;
    }
    
    .logo-circle i {
        font-size: 24px;
    }
    
    .file-upload-container {
        min-height: 100px;
    }
    
    .file-upload-label i {
        font-size: 24px;
    }
    
    .auth-links {
        gap: 10px;
    }
    
    .auth-link {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .auth-body {
        padding: 10px;
    }
    
    .auth-card,
    .auth-card-large {
        padding: 20px;
        border-radius: 12px;
    }
    
    .auth-logo {
        width: 60px;
        height: 60px;
    }
    
    .auth-header h1 {
        font-size: 20px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .input-container input {
        padding: 10px 40px 10px 12px;
    }
    
    .form-actions {
        margin-top: 20px;
        gap: 10px;
    }
    
    .auth-links {
        margin-top: 20px;
        padding-top: 20px;
    }
    
    .auth-links a {
        display: block;
        margin: 5px 0;
    }
    
    .form-section {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .form-section legend {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .logo-circle {
        width: 50px;
        height: 50px;
    }
    
    .logo-circle i {
        font-size: 20px;
    }
    
    .file-upload-container {
        min-height: 80px;
    }
    
    .file-upload-label {
        font-size: 12px;
    }
    
    .file-upload-label i {
        font-size: 20px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 45px;
    }
    
    .auth-link {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* Dark Mode Support */
/*@media (prefers-color-scheme: dark) {*/
/*    .auth-card,*/
/*    .auth-card-large {*/
/*        background: #2c3e50;*/
/*        color: white;*/
/*    }*/
    
/*    .auth-header h1 {*/
/*        color: white;*/
/*    }*/
    
/*    .auth-header p {*/
/*        color: #bdc3c7;*/
/*    }*/
    
/*    .form-group label {*/
/*        color: white;*/
/*    }*/
    
/*    .form-group input,*/
/*    .form-group select,*/
/*    .form-group textarea {*/
/*        background-color: #34495e;*/
/*        border-color: #4a5f7a;*/
/*        color: white;*/
/*    }*/
    
/*    .form-group input:focus,*/
/*    .form-group select:focus,*/
/*    .form-group textarea:focus {*/
/*        background-color: #34495e;*/
/*        border-color: #667eea;*/
/*    }*/
    
/*    .form-section {*/
/*        border-color: #4a5f7a;*/
/*    }*/
    
/*    .form-section legend {*/
/*        color: white;*/
/*    }*/
    
/*    .checkbox-label {*/
/*        color: white;*/
/*    }*/
    
/*    .auth-links {*/
/*        border-color: #4a5f7a;*/
/*    }*/
    
/*    .help-text {*/
/*        color: #95a5a6;*/
/*    }*/
/*}*/

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .auth-card,
    .auth-card-large {
        border: 2px solid #000;
    }
    
    .btn-primary {
        background: #000;
        border: 2px solid #000;
    }
    
    .btn-secondary {
        background: #666;
        border: 2px solid #666;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
