@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

:root {
    --primary-blue: #4cc9f0;
    --primary-blue-dark: #7b2cbf;
    --text-dark: #203040;
    --text-gray: #7a8a9a;
    --text-light: #a0b0c0;
    --bg-white: #ffffff;
    --border-color: #e5ebf0;
    --input-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login-body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-white);
    color: var(--text-dark);
    direction: rtl;
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

.login-layout {
    display: flex;
    flex-direction: row-reverse;
    width: 100vw;
    height: 100vh;
}

/* Left Panel - Form */
.login-panel {
    width: 45%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-white);
    position: relative;
    z-index: 2;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 380px;
    /* Narrower to match screenshot */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-card-head {
    text-align: center;
    margin-bottom: 2.5rem;
}

.welcome-text {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-bottom: -0.2rem;
    font-weight: 600;
}

.brand-title {
    color: var(--primary-blue-dark);
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.alert {
    width: 100%;
    padding: 0.8rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 600;
}

.alert-error {
    background-color: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.login-form {
    width: 100%;
}

.field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.2rem;
}

.field-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
    text-align: right;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    right: 1rem;
    color: var(--text-light);
    transition: color 0.2s ease;
    pointer-events: none;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 1rem;
    padding-right: 2.8rem;
    /* Space for the absolute icon on the right */
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    background-color: var(--input-bg);
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(46, 180, 255, 0.15);
}

.login-form input[type="text"]:focus+.input-icon,
.login-form input[type="password"]:focus+.input-icon,
.input-group:focus-within .input-icon {
    color: var(--primary-blue);
}

.login-form input::placeholder {
    color: #cbd5e1;
    font-weight: 600;
}

/* Toggle Switch */
.remember-me {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
}

.remember-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-gray);
    cursor: pointer;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d8e0e8;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
    background-color: var(--primary-blue);
}

input:checked+.slider:before {
    transform: translateX(18px);
}

.btn {
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(90deg, #4cc9f0, #7b2cbf);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(123, 44, 191, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(90deg, #48bce0, #6a25a3);
    box-shadow: 0 10px 25px rgba(123, 44, 191, 0.35);
    transform: translateY(-2px);
}

.footer-brand {
    position: absolute;
    bottom: 2rem;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Right Panel - Image */
.login-visual {
    width: 55%;
    position: relative;
    padding: 1.5rem;
    /* Margins around the image */
    background-color: var(--bg-white);
    display: flex;
    justify-content: flex-end;
    /* Align image to the right if needed */
}

.login-visual-inner {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 35px;
    overflow: hidden;
    /* Adjusted clip path for a subtler, exact slant matching the image */
    clip-path: polygon(26% 0, 100% 0, 100% 100%, 0 100%);
    
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.login-visual-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.03);
    /* slight zoom to avoid clip edge artifacts */
}

.logo-overlay {
    position: absolute;
    top: 3.5rem;
    right: 3.5rem;
    width: 60px;
    height: 60px;
    background-color: var(--bg-white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.logo-overlay img {
    width: 32px;
    height: auto;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: fadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;

}

/* Responsive */
@media (max-width: 900px) {
    body.login-body {
        overflow: auto;
    }

    .login-layout {
        flex-direction: column-reverse;
        height: auto;
        min-height: 100vh;
    }

    .login-panel {
        width: 100%;
        padding: 3rem 1.5rem;
    }

    .login-visual {
        width: 100%;
        height: 400px;
        padding: 1rem;
    }

    .login-visual-inner {
        clip-path: none;
        border-radius: 20px;
    }

    .footer-brand {
        position: relative;
        bottom: 0;
        margin-top: 3rem;
    }

    .logo-overlay {
        top: 2rem;
        right: 2rem;
        width: 50px;
        height: 50px;
    }
}