/* Auth Pages Specific Styles */
body, input, button, select, textarea, label, h1, h2, h3, p, a, span {
    font-family: 'Cairo', sans-serif !important;
}

/* Ensure Font Awesome Icons use their own font */
.fa, .fas, .far, .fal, .fab, .fa-solid, .fa-regular, .fa-brands {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome", sans-serif !important;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f4f6f9;
    background-image: none; /* Removed gradient */
    font-family: 'Cairo', sans-serif !important;
    overflow-x: hidden;
}

.auth-container {
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.box {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 450px;
    transition: transform 0.3s ease;
}

.logo-area {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-box {
    width: 80px; /* Increased size */
    height: 80px; /* Increased size */
    background: #2563eb;
    border-radius: 16px; /* Slightly larger radius */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.logo-box i {
    color: white;
    font-size: 2.5rem; /* Increased icon size */
}

.logo-area h2 {
    margin: 10px 0 5px;
    color: #1f2937;
    font-weight: 800;
    font-size: 1.8rem;
}

/* Form Group & Inputs */
.form-group {
    margin-bottom: 20px;
    text-align: right;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4b5563;
    font-weight: 600;
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 50%; /* Vertical centering */
    transform: translateY(-50%); /* Vertical centering */
    color: #4b5563;
    pointer-events: none;
    font-size: 1.2rem; /* Adjusted size */
    z-index: 10;
}

.toggle-password {
    position: absolute;
    left: 15px;
    top: 50%; /* Vertical centering */
    transform: translateY(-50%); /* Vertical centering */
    color: #4b5563;
    cursor: pointer;
    font-size: 1.2rem; /* Adjusted size */
    transition: color 0.3s;
    z-index: 10;
}

.toggle-password:hover {
    color: #2563eb;
}

input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
    background: #fff;
}

/* Force White Background on Autofill */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #000 !important;
}

/* Adjust padding specifically for RTL */
input {
    padding-right: 45px; /* More space for right icon */
    padding-left: 15px;
}

/* If password field has toggle icon on left */
.input-wrapper input[type="password"],
.input-wrapper input[type="text"] {
    padding-left: 45px; /* More space for toggle icon on left */
}

input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Options (Remember Me) */
.options {
    display: flex;
    justify-content: flex-start; /* Align Left (Right in RTL context) - Changed from flex-end */
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #4b5563;
    user-select: none;
}

.remember-me input {
    width: 18px;
    height: 18px;
    margin: 0;
    border-radius: 4px;
    cursor: pointer;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    margin-bottom: 15px;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-outline {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-outline:hover {
    background: #eff6ff;
}

/* Pseudo Password Inputs */
.secure-password-input {
    -webkit-text-security: disc;
    text-security: disc;
}

/* Error Message */
.error {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px 40px 12px 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    direction: rtl;
    font-size: 0.9rem;
    border: 1px solid #fecaca;
    position: relative;
    line-height: 1.7;
}

.error i {
    font-size: 1.2rem;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

/* Links */
.links {
    text-align: center;
    margin-top: 25px;
    font-size: 0.95rem;
    color: #6b7280;
}

.links a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.links a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .box {
        padding: 2.2rem;
        margin: 10px;
    }
    .logo-box {
        width: 68px;
        height: 68px;
    }
    .logo-box i {
        font-size: 2.1rem;
    }
    .logo-area h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 10px;
    }
    .box {
        padding: 1.6rem 1.2rem;
        border-radius: 6px;
    }
    .logo-box {
        width: 60px;
        height: 60px;
    }
    .logo-area h2 {
        font-size: 1.4rem;
    }
    .form-group label {
        font-size: 0.85rem;
    }
    input {
        font-size: 0.9rem;
        padding: 10px 40px 10px 40px;
    }
    .btn-primary {
        padding: 10px;
        font-size: 0.9rem;
    }
    .links {
        margin-top: 18px;
        font-size: 0.9rem;
    }
}
