/* File: assets/css/index.css */

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #1565C0;
    --light-blue: #E8F4FD;
    --very-light-blue: #F5F9FF;
    --dark-blue: #0D47A1;
    --accent-blue: #1976D2;
    --white: #FFFFFF;
    --light-gray: #F8F9FA;
    --border-light: #D1D9E0;
    --text-dark: #1A1A1A;
    --text-gray: #4A4A4A;
    --text-light: #666666;
    --welcome-orange: #E67A00;
    --pistachio-color: #F0FFF0;

    /* NEW/ADJUSTED: Poppins font integration */
    --font-heading: 'Poppins', 'Noto Sans Devanagari', sans-serif;
    --font-body: 'Poppins', 'Noto Sans Devanagari', sans-serif;
}

body {
    font-family: var(--font-body); /* Apply Poppins */
    min-height: 100vh;
    position: relative;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #F8F0E4;

    background-image: url('https://raw.githubusercontent.com/diragcg/pmfby/main/images/warli-art-1.svg');
    background-repeat: repeat;
    background-position: center center;
    background-size: 250px;
    background-attachment: fixed;
}

/* Title Logo in Head (favicon styling is in HTML via <link rel="icon">) */
/* No direct CSS for title-logo here as it's a favicon */

/* Main Login Container */
.login-page-container {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 900px;
    display: flex;
    overflow: hidden;
    min-height: 550px;
}

/* Left Section - Logo and Map */
.login-left-section {
    flex: 1;
    background: linear-gradient(135deg, var(--white), var(--light-gray));
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.login-left-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/2/25/Chhattisgarh_Map.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 80%;
    opacity: 0.1;
    z-index: 0;
}

.login-left-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.login-left-content .cg-logo {
    height: 100px;
    width: auto;
    margin-bottom: 20px;
    filter: drop-shadow(2px 2px 5px rgba(0, 0, 0, 0.2));
}

.login-left-content h4 {
    font-size: 1.5rem; /* Smaller font */
    font-weight: 600; /* Poppins weight */
    color: var(--text-dark);
    margin-bottom: 10px;
    font-family: var(--font-heading);
}

.login-left-content p {
    font-size: 0.9rem; /* Smaller font */
    color: var(--text-gray);
    font-weight: 400; /* Poppins weight */
    font-family: var(--font-body);
}

/* Right Section - Login Form */
.login-right-section {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--white);
}

.login-right-section .welcome-text {
    color: var(--welcome-orange);
    font-size: 0.95rem; /* Smaller font */
    margin-bottom: 10px;
    font-family: var(--font-body);
    font-weight: 500;
}

.login-right-section h2 {
    font-size: 1.8rem; /* Smaller font */
    font-weight: 700; /* Poppins weight */
    color: var(--text-dark);
    margin-bottom: 30px;
    font-family: var(--font-heading);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600; /* Poppins weight */
    font-family: var(--font-body);
    font-size: 0.85rem; /* Smaller font */
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 12px; /* Adjusted padding */
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 0.9rem; /* Smaller font */
    font-family: var(--font-body);
    transition: all 0.3s ease;
    background: var(--white);
    color: var(--text-dark);
}

/* Pistachio color for specific inputs */
#username, #password, #captchaInput {
    background-color: var(--pistachio-color);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
    background: var(--white);
}

/* CAPTCHA specific styles */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.captcha-input-group {
    flex-grow: 1;
}

.captcha-display {
    width: 140px;
    height: 45px;
    background-color: var(--light-gray);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Poppins', monospace; /* Poppins for CAPTCHA */
    font-size: 1.3rem; /* Adjusted font size */
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--text-dark);
    user-select: none;
    padding: 0 10px;
}

.captcha-refresh-btn {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: 1.2rem; /* Adjusted font size */
    cursor: pointer;
    transition: color 0.3s;
}

.captcha-refresh-btn:hover {
    color: var(--dark-blue);
}

/* Login Button */
.login-submit-btn {
    width: 100%;
    background: var(--primary-blue);
    color: white;
    padding: 12px; /* Adjusted padding */
    border: none;
    border-radius: 6px;
    font-size: 1rem; /* Smaller font */
    font-weight: 600; /* Poppins weight */
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: var(--font-heading);
    margin-top: 10px;
}

.login-submit-btn:hover {
    background: var(--dark-blue);
}

.login-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* NEW: Top-Right Flash Message Box Styles */
.message-box {
    position: fixed; /* Position relative to the viewport */
    top: 20px;
    right: 20px;
    z-index: 1000; /* Ensure it's on top of other content */

    background-color: var(--white);
    padding: 15px 25px; /* Adjusted padding for a notification style */
    border-radius: 8px; /* Slightly smaller radius */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Lighter shadow */
    text-align: left; /* Align text left for notifications */
    max-width: 350px; /* Adjust max-width for notification */
    min-width: 250px;
    font-family: var(--font-body);

    opacity: 0; /* Hidden by default */
    visibility: hidden; /* Hidden by default for accessibility */
    transform: translateX(110%); /* Start off-screen to the right */
    transition: opacity 0.3s ease, transform 0.3s ease-out, visibility 0.3s ease; /* Smooth animation */
}

/* State when the message is active/visible */
.message-box.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0); /* Slide into view */
}

.message-box h4 {
    margin-top: 0;
    margin-bottom: 8px; /* Adjusted margin */
    font-size: 1.3rem; /* Adjusted font size */
    color: var(--text-dark);
    font-weight: 600;
}

.message-box p {
    margin-bottom: 0;
    font-size: 0.95rem; /* Adjusted font size */
    line-height: 1.4;
    color: var(--text-gray);
    font-weight: 400;
}

.message-box.error {
    border: 2px solid #dc3545;
}

.message-box.success {
    border: 2px solid #28a745;
}

.message-box .close-btn {
    position: absolute;
    top: 5px; /* Adjusted position */
    right: 10px; /* Adjusted position */
    font-size: 1.5rem; /* Adjusted font size */
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
}

.message-box .close-btn:hover {
    color: #333;
}

/* Spinner (needed for login button loading state) */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.125em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}
.spinner-border-sm {
    width: 0.875rem;
    height: 0.875rem;
    border-width: 0.125em;
}
@keyframes spinner-border {
    to { transform: rotate(360deg); }
}


/* Responsive Design */
@media (max-width: 768px) {
    .login-page-container {
        flex-direction: column;
        min-height: auto;
        max-width: 450px;
    }
    .login-left-section {
        padding: 30px;
        height: 250px;
    }
    .login-left-content .cg-logo {
        height: 80px;
    }
    .login-left-content h4 {
        font-size: 1.3rem;
    }
    .login-left-content p {
        font-size: 0.85rem;
    }
    .login-right-section {
        padding: 30px;
    }
    .login-right-section h2 {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }
    .form-group label {
        font-size: 0.8rem;
    }
    .form-group input, .form-group select {
        font-size: 0.85rem;
        padding: 8px 10px;
    }
    .captcha-row {
        flex-wrap: wrap;
        justify-content: center;
    }
    .captcha-display {
        width: 120px;
        height: 40px;
        font-size: 1.1rem;
    }
    .captcha-refresh-btn {
        font-size: 1.1rem;
    }
    .login-submit-btn {
        font-size: 0.95rem;
        padding: 10px;
    }
    .message-box h4 {
        font-size: 1.4rem;
    }
    .message-box p {
        font-size: 1rem;
    }
}
