.rtl h1, .rtl h2, .rtl h3, .rtl h4, .rtl h5, .rtl h6 {
    font-family: var(--wp-administration-style--font-family-sans) !important;
}
::placeholder {
    font-family: var(--wp-administration-style--font-family-sans) !important;
}
.login * {
    font-family: var(--wp-administration-style--font-family-sans) !important;
}

/* Basic Reset & Body */
body.login {
    background: #f1f5f9;
    direction: rtl;
    margin: 0;
}

/* Hide default WordPress elements */
.login h1,
.login #backtoblog,
.login .language-switcher {
    display: none !important;
}

#login {
    padding: 0;
    width: 100%;
}

/* Custom Wrappers */
.custom-login-wrapper {
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    width: 100%;
    max-width: 64rem;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Left Info Panel */
.info-panel {
    background-image: radial-gradient(circle, #fabe3b63, rgb(169 169 169 / 10%));
    border-radius: 1.25rem;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 580px;
}

@media (max-width: 1023px) {
    .info-panel {
        display: none;
    }
}

.icon-bell-wrapper {
    width: 64px;
    height: 64px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #34a853;
    box-shadow: 0 4px 14px rgb(64 243 136 / 15%);
}

.info-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.info-subtitle {
    font-size: 1rem;
    color: #475569;
    line-height: 1.6;
    max-width: 350px;
}

/* Testimonial Slider */
#testimonial-slider, .testimonial-item.active, .testimonial-header, .slider-dots {
    display: flex;
}
#testimonial-slider { position: relative; flex-direction: column; }
.testimonial-item { background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); border-radius: 1rem; padding: 1.2rem; display: none; }
.testimonial-item.active { flex-direction: column; }
.testimonial-header { align-items: center; gap: 1rem; }
.testimonial-avatar img { width: 60px; height: 60px; border-radius: 20%; object-fit: cover; }
.testimonial-author h4 { font-weight: 700; color: #1e293b; margin: 0; }
.testimonial-author p { color: #475569; font-size: 0.875rem; margin: 0; }
.testimonial-body { font-size: 0.875rem; color: #334155; line-height: 1.6; margin-top: 1rem; }
.slider-dots { gap: 0.5rem; margin-top: 1rem; }
.slider-dots .dot { width: 24px; height: 8px; background-color: #ddd; border-radius: 4px; cursor: pointer; transition: all 0.3s ease; }
.slider-dots .dot.active { width: 48px; background-color: #34a853; }

/* Right Login Form Panel */
.login-form-container {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.login-logo {
    display: none;
    margin-bottom: 2rem;
    text-align: center;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    margin-bottom: 2rem;
}

/* Form Elements */
#loginform { margin: 0; padding: 8px; box-shadow: none; background: transparent; border: none; }
#loginform p { margin-bottom: 1.5rem; }

.input-icon-wrapper { position: relative; }

/* === START: UPDATED STYLES === */
.input-icon-wrapper .icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 1rem; /* Changed from left to right for RTL */
    color: #94a3b8;
    z-index: 2;
}

#loginform input[type="text"] {
    background-color: #f8fafc;
    width: 100%;
    font-size: 0.875rem;
    color: #1e293b;
    /* Adjusted padding for RTL icon */
    padding: 0.875rem 3rem 0.875rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: none;
    height: 52px;
}

#loginform input[type="password"] {
    background-color: #f8fafc;
    width: 100%;
    font-size: 0.875rem;
    color: #1e293b;
    /* Adjusted padding for RTL icon on right and new toggle on left */
    padding: 0.875rem 3rem 0.875rem 3.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: none;
    height: 52px;
}

#loginform input[type="text"]:focus,
#loginform input[type="password"]:focus {
    border-color: #34a853;
    background-color: #fff;
    outline: 2px solid transparent;
    box-shadow: 0 0 0 2px rgba(243, 64, 95, 0.3);
}

/* New style for password visibility toggle */
.clt-toggle-password {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 1rem; /* Position on the left */
    color: #94a3b8;
    cursor: pointer;
    z-index: 2;
}
.clt-toggle-password:hover {
    color: #334155;
}
/* === END: UPDATED STYLES === */


/* Remember me & Action Buttons */
#loginform .forgetmenot { display: flex; align-items: center; }
#loginform #rememberme { height: 1rem; width: 1rem; border-radius: 0.25rem; border-color: #cbd5e1; color: #34a853; }
#loginform #rememberme:focus { box-shadow: 0 0 0 2px rgba(243, 64, 95, 0.3); }
#loginform .forgetmenot label { margin-right: 0.5rem; display: block; font-size: 0.875rem; color: #334155; margin-bottom: 0; }

.login-actions-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    align-items: stretch;
    width: 100%;
}

p.submit { margin: 0; }
#wp-submit {
    width: 100%; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); padding: 0.875rem 1rem; font-size: 1rem; font-weight: 600; border-radius: 0.75rem; color: #fff; background-color: #34a853; border: none; height: auto; line-height: inherit; text-shadow: none; transition: background-color 0.2s ease-in-out;
}
#wp-submit:hover { background-color: #1967d2; }

.separator { display: flex; align-items: center; text-align: center; color: #94a3b8; font-size: 0.875rem; margin: 0; }
.separator::before, .separator::after { content: ''; flex: 1; border-bottom: 1px solid #e2e8f0; }
.separator:not(:empty)::before { margin-left: 1rem; }
.separator:not(:empty)::after { margin-right: 1rem; }

#nav {
    padding: 0;
    margin: 0;
}

.login #nav {
    margin: 20px 0 0;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
}

#nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center !important;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    font-weight: 500;
    color: #334155 !important;
    text-decoration: none;
    cursor: not-allowed;
    background-color: #f8fafc;
}
#nav a:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

/* === START: NEW STYLES FOR ERROR MODAL === */

/* Hiding the original error box */
.login #login_error {
    display: none;
}

/* Modal Overlay */
.clt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

/* Modal Box */
.clt-modal-box {
    background: #fff;
    color: #c7254e;
    padding: 2rem 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
    max-width: 90%;
    width: 400px;
    border-top: 5px solid #d9534f;
    transform: scale(0.9);
    animation: dropIn 0.3s forwards;
}

/* Close Button */
.clt-modal-close {
    position: absolute;
    top: 10px;
    left: 15px; /* Changed from right to left for RTL */
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}
.clt-modal-close:hover {
    color: #333;
}

/* Animations */
@keyframes fadeIn {
    to { opacity: 1; }
}
@keyframes dropIn {
    to { transform: scale(1); }
}

/* === END: NEW STYLES FOR ERROR MODAL === */

/* Default Error Messages (fallback, now styled inside modal) */
.login .message, .login .success {
    border-right: 4px solid #34a853; border-left: none; margin: 1em 0; position: static; width: 100%; max-width: 100%;
}
