/* ========================================
   Auth Pages Shared Styles - Enhanced with Modern Touches
   ======================================== */

/* Auth Section */
.auth-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%);
    min-height: 100vh;
    padding: 60px 0;
    display: flex;
    align-items: center;
}

/* Auth Card - مع تحسينات حديثة - إزالة hover effect */
.auth-card {
    background: white;
    border-radius: 30px;
    padding: 40px 35px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(121, 73, 156, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary-dark));
}

/* Auth Header - تصميم محسن مع أيقونة دائرية */
.auth-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px dashed rgba(121, 73, 156, 0.1);
}

.header-icon {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-icon i {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 10px 20px rgba(121, 73, 156, 0.25);
    z-index: 2;
    position: relative;
}

.header-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 2px dashed rgba(121, 73, 156, 0.3);
    border-radius: 50%;
    animation: rotateRing 10s linear infinite;
    pointer-events: none;
}

@keyframes rotateRing {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.header-text {
    flex: 1;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark-purple);
    margin: 0 0 5px 0;
    line-height: 1.2;
}

.auth-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}

/* Auth Form */
.auth-form {
    max-width: 400px;
    margin: 0 auto;
}

/* Form Group مع تحسينات */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-purple);
    font-size: 0.95rem;
}

.form-label i {
    color: var(--primary);
    margin-left: 8px;
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(121, 73, 156, 0.15);
    border-radius: 16px;
    font-family: 'Almarai', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-align: right;
    background: rgba(255, 255, 255, 0.9);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(121, 73, 156, 0.1);
    background: white;
}

.form-control::placeholder {
    color: rgba(121, 73, 156, 0.3);
    font-size: 0.9rem;
    text-align: right;
}

/* Password Input - محسن (العين في اليسار) */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-control {
    padding-left: 45px; /* مسافة لليسار للعين */
    padding-right: 18px;
    text-align: right;
}

.password-toggle {
    position: absolute;
    left: 12px; /* العين في اليسار */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(121, 73, 156, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 3;
}

.password-toggle:hover {
    color: var(--primary);
    background: rgba(121, 73, 156, 0.08);
}

.password-toggle i {
    font-size: 1.1rem;
}

/* RTL adjustment */
[dir="rtl"] .password-input-wrapper .form-control {
    padding-left: 45px;
    padding-right: 18px;
}

[dir="rtl"] .password-toggle {
    left: 12px;
    right: auto;
}

/* Password Hint */
.password-hint {
    color: var(--text-light);
    font-size: 0.75rem;
    margin-top: 8px;
    padding-right: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.password-hint i {
    color: var(--primary);
    font-size: 0.7rem;
}

/* Form Row */
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* Checkbox Custom - محسن بشكل أكبر */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    height: 20px;
    width: 20px;
    background-color: white;
    border: 2px solid rgba(121, 73, 156, 0.25);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.checkbox-container:hover input~.checkmark {
    border-color: var(--primary);
    background-color: rgba(121, 73, 156, 0.02);
    transform: scale(1.05);
}

.checkbox-container input:checked~.checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 5px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Forgot Link */
.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 5px 10px;
    border-radius: 30px;
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: none;
    background: rgba(121, 73, 156, 0.05);
}

/* Buttons - محسنة بشكل أكبر */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 14px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(121, 73, 156, 0.3);
    cursor: pointer;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn-primary-custom::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-primary-custom:hover::before {
    left: 100%;
}

.btn-primary-custom:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: 0 15px 30px rgba(121, 73, 156, 0.4);
}

.btn-primary-custom:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary-custom i {
    font-size: 1rem;
}

/* Google Button - محسنة */
.btn-google {
    background: white;
    border: 1px solid rgba(121, 73, 156, 0.15);
    color: var(--text-dark);
    padding: 14px 24px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn-google:hover {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(121, 73, 156, 0.15);
}

.btn-google i {
    color: #DB4437;
    font-size: 1.2rem;
}

/* Divider - أنحف */
.divider {
    position: relative;
    text-align: center;
    margin: 25px 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(121, 73, 156, 0.2), transparent);
}

.divider-text {
    position: relative;
    background: white;
    padding: 0 15px;
    color: var(--text-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Auth Footer - أنحف */
.auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px dashed rgba(121, 73, 156, 0.1);
    color: var(--text-light);
    font-size: 0.95rem;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-right: 5px;
    transition: all 0.2s ease;
    padding: 5px 10px;
    border-radius: 30px;
}

.auth-footer a:hover {
    color: var(--primary-dark);
    background: rgba(121, 73, 156, 0.05);
    text-decoration: none;
}

/* Terms Check - محسن */
.terms-check {
    margin-bottom: 20px;
    padding: 5px 0;
}

.terms-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.terms-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Floating Elements */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-icon {
    position: absolute;
    color: rgba(121, 73, 156, 0.05);
    font-size: 2rem;
    animation: float 10s ease-in-out infinite;
}

.floating-icon.book-1 {
    top: 15%;
    left: 10%;
    animation-delay: 0s;
}

.floating-icon.book-2 {
    bottom: 20%;
    right: 15%;
    animation-delay: -5s;
    font-size: 2.5rem;
}

.floating-icon.star {
    top: 40%;
    right: 20%;
    animation-delay: -2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* Responsive - محسن */
@media (max-width: 768px) {
    .auth-section {
        padding: 40px 0;
    }

    .auth-card {
        padding: 30px 25px;
    }

    .auth-header {
        gap: 12px;
        margin-bottom: 25px;
        padding-bottom: 15px;
    }

    .header-icon {
        width: 50px;
        height: 50px;
    }

    .header-icon i {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }

    .header-icon::after {
        width: 52px;
        height: 52px;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-subtitle {
        font-size: 0.85rem;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-control {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .auth-card {
        padding: 25px 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .checkbox-text {
        font-size: 0.85rem;
    }

    .btn-primary-custom,
    .btn-google {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .floating-icon {
        display: none;
    }
}