:root {
    --color-background: #f7f3ed; /* Light beige/off-white background */
    --color-dark-red: #5c0e0e; /* Deep red for the form box (Used as reference, but you use #5c0e0e below) */
    --color-input-bg: #ffffff; /* White for the input field */
    --color-button-text: #ffffff; /* White text for the button */
    --color-text-dark: #333333; /* Dark text for the label */
}

@font-face {
    font-family: 'Juana';
    src: url('fonts/JuanaRegular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Parfumerie Script Pro';
    src: url('fonts/ParfumerieScriptPro.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root,
html {
    color-scheme: light;
    isolation: isolate;
}

/* Basic Reset and Body Styles */
body {
    font-family: 'Juana', sans-serif; /* Fallback font */
    background-color: var(--color-background) !important;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    margin: 0;
    /* NEW: Add padding to prevent content from touching screen edges on mobile */
    padding: 20px;
    box-sizing: border-box;
}

/* Main Page Container (Enables Stacking on small screens) */
.page-container {
    display: flex;
    max-width: 1000px;
    width: 100%;
    flex-wrap: wrap;
}

/* --- Image Section Styling (Left Side - Desktop) --- */
.image-section {
    flex: 1; /* Takes up 50% of the space initially */
    background-image: url("img/login.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    min-height: 500px;
    margin-right: 50px; /* Space between the image and the form */
}

/* --- Form Section Styling (Right Side - Desktop) --- */
.form-section-wrapper {
    flex: 1; /* Takes up the other 50% of the space */
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 380px;
    flex-direction: column; /* Stack the form and disclaimer vertically */
}

.login-form-box {
    background-color: var(--color-dark-red) !important;
    padding: 40px;
    border-radius: 15px;
    width: 300px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.login-form-box .error {
    background-color: var(--color-background) !important;
    color: var(--color-dark-red) !important;
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 400;
    width: 100%;
    box-sizing: border-box;
}

.form-label {
    color: var(--color-button-text) !important;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    margin-top: 0;
}

.password-input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 25px;
    border: none;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    outline: none;
}

.submit-button {
    width: 100%;
    padding: 12px 15px;
    background-color: #5c0e0e !important;
    color: var(--color-button-text) !important;
    border: 2px solid var(--color-input-bg) !important;;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
    font-family: 'Juana', sans-serif;
}

.submit-button:hover {
    opacity: 0.9;
}

.disclaimer {
    /* Use a color that contrasts minimally with the beige background */
    color: #999999; /* Light Grey */

    font-family: 'Juana', sans-serif;
    font-size: 0.65rem; /* Small font size */
    line-height: 1.4;

    /* Center the text and limit its width to prevent it from stretching too far */
    text-align: center;
    max-width: 350px;

    /* Add vertical space above the disclaimer */
    margin-top: 25px;
}

/* ========================================================= */
/* 📱 MEDIA QUERY: LAYOUT CHANGE FOR SMALLER VIEWPORTS */
/* This is the key part that makes the layout stack. */
/* ========================================================= */

@media (max-width: 768px) {
    .page-container {
        flex-direction: column;
        align-items: center;
        padding: 0 20px;
    }

    .image-section,
    .form-section-wrapper {
        width: 100%; /* Take full width of the padded container */
        max-width: 400px; /* *** NEW: Standardize max width for consistent size *** */
        min-width: 300px; /* Prevent shrinking too small */
    }

    .image-section {
        min-height: 300px;
        margin-bottom: 30px;
        margin-right: 0; /* Remove desktop margin */
    }

    .form-section-wrapper {
        /* Remove the conflicting max-width and min-width */
        min-width: auto;
    }

    .login-form-box {
        /* Allow the form box to fill the new, constrained wrapper width */
        width: 80%;
        max-width: 400px; /* Match the max-width of the wrapper if needed, but 100% should suffice */
        padding: 30px; /* Slightly less padding on mobile */
    }

    /* Ensure the disclaimer is also constrained to the same width */
    .disclaimer {
        max-width: 400px;
    }
}
