@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* --- CSS Variables for Modern Theme --- */
:root {
    --primary-color: #007bff;
    /* Sleek Blue */
    --primary-dark: #0056b3;
    --background-body: #eaeff3;
    /* Slightly darker body bg for contrast */
    --background-white: #ffffff;
    --text-dark: #343a40;
    --text-muted: #868e96;
    --input-bg: #f8f9fa;
    --input-border: #e9ecef;
    --card-border-radius: 24px;
    /* Larger radius for modern look */
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--background-body);
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* --- The Main Split Card Container --- */
.main-card-container {
    display: flex;
    width: 100%;
    max-width: 900px;
    /* Max width for desktop split view */
    height: 550px;
    /* Fixed height for sleek look */
    background: var(--background-white);
    border-radius: var(--card-border-radius);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    /* Ensures children respect border radius */
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Split Screen Layout for Desktop --- */
.split-screen-container {
    display: flex;
    height: 100%;
}

/* Left Half: Welcome Section */
.welcome-section {
    flex: 0.8;
    /* Takes up slightly less space than form */
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
    /* No explicit border-radius needed here because parent has overflow:hidden */
}

.welcome-section .logo {
    font-size: 50px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.welcome-content {
    max-width: 400px;
    text-align: center;
}


.welcome-content h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.welcome-content p {
    font-size: 0.9rem;
    opacity: 0.8;
    max-width: 250px;
    margin: 0 auto;
}

/* Right Half: Login Form Section */
.login-section {
    flex: 1;
    background: var(--background-white);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: var(--background-dark);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    animation: fadeIn 0.8s ease-out;
}

/* --- Right White Form Section --- */
.login-section {
    flex: 1;
    background: var(--background-white);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
}

.login-wrapper {
    width: 100%;
    max-width: 320px;
    /* Restrict form width for cleaner look */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    margin-bottom: 35px;
}

.header h1 {
    margin: 0;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.header h2 {
    margin: 0;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.header p {
    color: #6c757d;
    font-size: 0.95rem;
}

/* --- Form Styling --- */
.input-group {
    margin-bottom: 20px;
    position: relative;
    /* Needed for absolute positioning of label/icons */
}

/* The Input Field itself */
.floating-label input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    /* Left padding room for icon */
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    /* Ensures padding doesn't affect width */
}

/* Icons inside input */
.floating-label .icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
    /* Clicks pass through */
    z-index: 2;
    transition: color 0.3s ease;
}

/* The Password Toggle Eye */
.togglePassword {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    z-index: 3;
    transition: color 0.3s ease;
}

/* The Floating Label text */
.floating-label label {
    position: absolute;
    left: 45px;
    /* Match input left padding */
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: 0.3s ease all;
    background-color: transparent;
    /* Initially transparent */
    padding: 0 5px;
    z-index: 1;
}

/* --- The Magic: Active/Filled State --- */
/* When input is focused OR contains text (not placeholder-shown) */
.floating-label input:focus,
.floating-label input:not(:placeholder-shown) {
    border-color: var(--primary-color);
    background: var(--background-white);
}

.floating-label input:focus~.icon,
.floating-label input:not(:placeholder-shown)~.icon {
    color: var(--primary-color);
}

/* Move the label up */
.floating-label input:focus~label,
.floating-label input:not(:placeholder-shown)~label {
    top: 0;
    /* Move to top border line */
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-color);
    background-color: var(--background-white);
    /* Add background to hide border behind it */
}




.forgot-password {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: var(--primary-color);
}

.login-btn {
    background: var(--primary-color);
    color: white;
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.login-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.3);
}

.login-btn:active {
    transform: scale(0.98);
}

.message {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
    min-height: 20px;
}

.message.error {
    color: #dc3545;
}

.message.success {
    color: #28a745;
}

/* --- Mobile View Adjustments (Small Screens) --- */
@media (max-width: 992px) {

    body {
        align-items: flex-start;
        /* Align to top on mobile */
        padding: 0;
        background: var(--background-white);
        overflow: hidden;
    }


    .main-card-container {
        box-shadow: none;
        border-radius: 0;
        height: 100%;
        width: 100%;
    }

    /* Remove the Welcome Section completely */
    .welcome-section {
        display: none;
    }

    /* Make the Login Section take full width and height */
    .login-section {
        padding: 40px 30px;
        height: 100vh;
        /* Full viewport height */
        align-items: center;
        /* Center vertically */
    }

    /* Reduce padding and max-width on the card for mobile */
    .login-card {
        max-width: 450px;
        padding: 30px 25px;
        box-shadow: none;
        /* Remove box shadow on mobile for a cleaner look */
    }

    .login-wrapper {
        max-width: 100%;
        /* Allow form to be wider on mobile */
    }

    .header h2 {
        font-size: 1.2rem;
    }

    .split-screen-container {
        height: auto;
    }
}