:root {
    --primary-green: #67B749;
    --primary-green-dark: #56a03d;
    --accent-light-gray: #D3D3D3;
    --text-dark: #333333;
    --text-medium: #4B4B4B;
    --bg-white: #FFFFFF;
    --border-color: #E0E0E0;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-medium);
    background-color: var(--bg-white);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow:scroll; /* Prevent scroll for grid */
}

.login-container {
    display: flex;
    width: 90%;
    max-width: 1100px;
    height: 700px; /* Fixed height for consistent look */
    background-color: var(--bg-white);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Left Branding Section */
.branding-section {
    flex: 1;
    background-color: var(--primary-green);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

.branding-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 50px 50px; /* Adjust grid density */
    opacity: 0.8;
    z-index: 1;
}

.illustration-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%; /* Adjust height of the illustration */
    background: url('https://via.placeholder.com/500x400/67B749/FFFFFF?text=Agricultural+Illustration') no-repeat center bottom; /* Replace with your illustration */
    background-size: cover;
    mix-blend-mode: soft-light; /* Creates a nice overlay effect */
    opacity: 0.7;
    z-index: 2;
}

.logo-area {
    position: relative;
    z-index: 3; /* Ensure logo and text are above background elements */
    text-align: center;
    color: var(--bg-white);
}

.logo-area img {
    max-width: 180px;
    height: auto;
    margin-bottom: 20px;
}

.tagline {
    font-size: 1.3em;
    font-weight: 500;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Right Login Form Section */
.login-form-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px 30px;
    background-color: var(--bg-white);
    border-radius: 10px;
}
    /* box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); /* Optional: if you want a separate card shadow */ */


.login-card h2 {
    color: var(--text-dark);
    font-size: 2em;
    margin-bottom: 30px;
    text-align: center;
}

/* Role Tabs */
.role-tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--accent-light-gray);
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 15px;
    font-size: 1em;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-speed) ease;
    flex-grow: 1;
    text-align: center;
}

.tab-button:hover:not(.active) {
    color: var(--primary-green-dark);
    border-color: rgba(103, 183, 73, 0.3);
    text-decoration: underline;
}

.tab-button.active {
    color: var(--primary-green);
    border-color: var(--primary-green);
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    color: var(--text-dark);
    outline: none;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-group input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(103, 183, 73, 0.1);
}

.forgot-password {
    text-align: right;
    margin-bottom: 25px;
}

.forgot-password a {
    color: var(--primary-green);
    text-decoration: none;
    font-size: 0.95em;
    transition: color var(--transition-speed);
}

.forgot-password a:hover {
    color: var(--primary-green-dark);
    text-decoration: underline;
}

/* Error Message */
.error-message {
    background-color: #f8d7da;
    color: #dc3545;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 14px;
    text-align: center;
}

.login-button {
    width: 100%;
    padding: 14px 20px;
    background-color: var(--primary-green);
    color: var(--bg-white);
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-speed), transform 0.1s ease;
}

.login-button:hover {
    background-color: var(--primary-green-dark);
    transform: translateY(-2px);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 30px 0;
    color: var(--text-light);
    font-size: 0.9em;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider:not(:empty)::before {
    margin-right: .25em;
}

.divider:not(:empty)::after {
    margin-left: .25em;
}

/* Register Section */
.register-section {
    text-align: center;
}

.register-section p {
    font-size: 0.95em;
    margin-bottom: 15px;
}

.register-button {
    background-color: var(--accent-light-gray);
    color: var(--text-dark);
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-speed), transform 0.1s ease;
}

.register-button:hover {
    background-color: #c0c0c0; /* Fallback color */
    transform: translateY(-2px);
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .login-container {
        flex-direction: column;
        width: 95%;
        height: auto; /* Allow height to adjust */
        margin: 20px auto;
    }

    .branding-section {
        height: 250px; /* Reduced height for mobile */
        border-radius: 15px 15px 0 0;
    }

    .logo-area img {
        max-width: 150px;
    }

    .tagline {
        font-size: 1.1em;
    }

    .illustration-overlay {
        height: 100%; /* Make illustration fill more of its section */
        background-size: cover;
        background-position: center;
    }

    .login-form-section {
        padding: 20px;
        border-radius: 0 0 15px 15px;
    }

    .login-card {
        padding: 30px 20px;
    }

    .login-card h2 {
        font-size: 1.8em;
        margin-bottom: 25px;
    }

    .tab-button {
        padding: 10px 10px;
        font-size: 0.95em;
    }

    .form-group input,
    .login-button,
    .register-button {
        font-size: 0.95em;
    }

    .forgot-password a,
    .register-section p {
        font-size: 0.9em;
    }
}

@media (max-width: 576px) {
    .login-container {
        width: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .branding-section {
        border-radius: 0;
    }

    .login-form-section {
        padding: 15px;
        border-radius: 0;
    }

    .login-card {
        padding: 25px 15px;
        box-shadow: none;
    }

    .login-card h2 {
        font-size: 1.6em;
        margin-bottom: 20px;
    }

    .tab-button {
        font-size: 0.9em;
        padding: 10px 8px;
    }

    .login-button {
        padding: 12px 15px;
    }

    .register-button {
        padding: 10px 20px;
    }
}