/* --- Global & Font --- */
body {
    /* Using a light tint of your brand color #17611C */
    background-color: #f2f7f2;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    display: flex;
    /* *** MODIFIED: This centers the new box too *** */
    flex-direction: column;
    align-items: center; 
    justify-content: flex-start;
    min-height: 100vh;
    box-sizing: border-box;
}

h2, h3 {
    color: #333;
    margin-top: 0;
}

/* --- Base Form Container --- */
.form-container {
    background-color: #ffffff;
    padding: 2.5rem 3rem;
    border-radius: 12px;
    /* Using your brand color #17611C */
    border: 3px solid #17611C;
    box-shadow: 0 10px 25px rgba(23, 97, 28, 0.1);
    width: 100%;
    max-width: 900px;
    box-sizing: border-box;
    margin: 2rem 0;
}

/* --- Narrow Container (for Login/Register/Forgot) --- */
/* *** THIS IS NOW FIXED AND REVERTED *** */
.form-container-narrow {
    max-width: 500px;
    margin-top: 2rem;
    padding: 2rem;
}

/* Compact version for login/register to reduce top/bottom space */
.form-compact {
    padding-top: 1.5rem; /* Slightly less top padding */
    padding-bottom: 1.5rem; /* Slightly less bottom padding */
    margin-top: 1rem; /* Move up slightly from the page top */
}

/* --- Headers (Login/Register) --- */
.logo {
    display: block;
    margin: 0 auto 1.5rem auto; /* Center logo and give space below */
    max-width: 120px;
    height: auto;
}

/* Logo styling for login/register/forgot */
.form-container-narrow .logo {
    width: 120px;
    height: 100px;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid #eee;
    margin-bottom: 0.1in;
}

.form-container-narrow h2 {
    text-align: center;
    color: #17611C; /* Brand color */
    margin-bottom: 0.5rem;
}

/* Specific H3 styling for the College Name (Font size set to 1rem) */
.form-container-narrow h3 {
    text-align: center;
    color: #17611C; /* Brand color, matches H2 */
    font-size: 1rem;
    font-weight: 500;
    margin-top: 0; 
    margin-bottom: 1.5rem; /* Space before .page-desc */
    line-height: 1.3;
}

.page-desc {
    text-align: center;
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 2rem; /* Space before form */
}
/* Reduce margin for .page-desc on compact forms */
.form-compact .page-desc {
    margin-bottom: 1rem;
}

/* --- Headers (Admission Form) --- */
.student-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f4f9f4;
    padding: 10px 20px;
    border-radius: 8px;
    margin: -1.5rem -2rem 2rem -2rem;
    border-bottom: 2px solid #e0e0e0;
}
/* Re-adjustment for narrower container */
@media (min-width: 769px) {
    .form-container {
        padding: 2.5rem 3rem;
    }
    .student-header {
        margin: -2.5rem -3rem 2.5rem -3rem;
        padding: 12px 3rem;
    }
}

.student-header div {
    font-size: 1.1rem;
    color: #333;
}
.student-header strong {
    color: #17611C;
}
.student-header small {
    display: block;
    font-size: 0.9rem;
    color: #555;
    margin-top: 2px;
}
.logout-link {
    font-size: 0.95rem;
    color: #d9534f;
    text-decoration: none;
    font-weight: 500;
}
.logout-link:hover {
    text-decoration: underline;
}

.form-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #17611C;
}
.form-header .logo {
    margin: 0;
    width: 120px;
    height: 100px;
    object-fit: contain;
    border-radius: 8px;
}
.form-header h2 {
    color: #17611C;
    margin-bottom: 0;
    text-transform: uppercase;     
}

.form-subtitle {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    margin: 0.5rem 0 0 0;
}

/* --- Form Sections --- */
.form-section {
    background: #fafcfa;
    border: 1px solid #ddeadf;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}
.form-section:last-of-type {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.5rem;
    color: #17611C;
    border-bottom: 2px solid #f0f0e0;
    padding-bottom: 10px;
    margin-bottom: 1.5rem;
}
.form-section > p {
    font-size: 0.95rem;
    color: #555;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

/* --- Form Grids --- */
.form-grid, .district-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 25px;
}
.grid-col-span-2 {
    grid-column: span 2;
}

.personal-info-layout {
    display: flex;
    gap: 25px;
}

.personal-fields-container {
    flex: 3;
}

.photo-uploader-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 5px;
}

.photo-uploader-container .form-group {
    width: 100%;
    align-items: center;
    text-align: center;
    margin-bottom: 0;
}
.photo-uploader-container .form-group label {
    margin-bottom: 12px;
}

.photo-preview-box {
    width: 150px;
    height: 200px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    overflow: hidden;
}

.photo-preview-box .preview-text {
    color: #999;
    font-size: 0.9rem;
    padding: 10px;
}

.photo-preview-box img {
    width: 100%;
    height: 100%;
    /* Final style: Ensures the whole picture is visible */
    object-fit: contain; 
}

.field-note {
    font-size: 0.85rem;
    color: #555;
    margin-top: 8px;
    display: block;
    line-height: 1.3;
}

.field-error {
    display: none;
    font-size: 0.85rem;
    color: #d9534f;
    font-weight: 500;
    margin-top: 8px;
}

.district-group {
    margin-top: 1.5rem;
}

/* --- Form Elements --- */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}
.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* Shared styles for input, select, textarea */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #17611C;
    box-shadow: 0 0 0 3px rgba(23, 97, 28, 0.1);
}
input::placeholder {
    color: #aaa;
}

/* Readonly fields */
input:read-only {
    background-color: #f0f0f0;
    color: #555;
    cursor: not-allowed;
    border-color: #ddd;
}

/* Disabled fields */
input:disabled {
    background-color: #f5f5f5;
    color: #888;
    border-color: #ddd;
    cursor: not-allowed;
}
select:disabled {
    background-color: #f5f5f5;
    color: #888;
}

/* File Inputs */
input[type="file"] {
    font-size: 0.95rem;
    padding: 8px 0;
}

.photo-uploader-container input[type="file"] {
    padding: 0;
    width: 100%;
    /* *** MODIFIED: Was 180px *** */
    max-width: 150px;
    font-size: 0.9rem;
}

input[type="file"]::file-selector-button {
    font-weight: 500;
    padding: 8px 14px;
    border: 1px solid #17611C;
    border-radius: 6px;
    background-color: #f2f7f2;
    color: #17611C;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-right: 12px;
}
input[type="file"]::file-selector-button:hover {
    background-color: #e6f0e7;
}

.photo-uploader-container input[type="file"]::file-selector-button {
    width: 100%;
    margin-right: 0;
}


/* --- Radio & Checkbox Groups --- */
.radio-group, .checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-top: 5px;
    margin-bottom: 1rem;
}
.radio-group input, .checkbox-group input {
    transform: scale(1.1);
    margin-top: 3px;
    flex-shrink: 0;
    cursor: pointer;     
}
.radio-group label, .checkbox-group label {
    font-weight: 500;
    color: #444;
    margin-bottom: 0;
    font-size: 1rem;
    cursor: pointer;
    flex: 1;
    line-height: 1.4;
}

/* Quota Radio Chips (Hidden but styles kept just in case) */
.quota-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.radio-chip {
    position: relative;
}
.radio-chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.radio-chip label {
    display: inline-block;
    padding: 10px 18px;
    border: 2px solid #ccc;
    border-radius: 30px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}
.radio-chip input:checked + label {
    border-color: #17611C;
    background-color: #f2f7f2;
    color: #17611C;
    box-shadow: 0 2px 5px rgba(23, 97, 28, 0.1);
}
.radio-chip input:focus + label {
    border-color: #17611C;
    box-shadow: 0 0 0 3px rgba(23, 97, 28, 0.1);
}


/* --- Academic Grid --- */
.academic-grid {
    display: grid;
    grid-template-columns: 1.5fr 2.5fr 1.2fr 0.8fr 1fr 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}
.academic-header {
    font-weight: 600;
    color: #333;
    background: #f4f4f4;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
    display: grid;
    grid-template-columns: 1.5fr 2.5fr 1.2fr 0.8fr 1fr 1fr;
    gap: 10px;
}
.academic-grid .exam-title {
    font-weight: 600;
    color: #17611C;
    font-size: 1.1rem;
    /* Updated alignment */
    text-align: left; 
    padding-left: 10px;
}
.academic-grid input {
    /* Reverted to inheriting padding: 12px 14px; from the generic input selector */
    text-align: center;
}

/* New style to override the center alignment for specific text inputs */
.left-align-input {
    text-align: left !important;
}


/* Document Uploader Grid Styles */
.document-grid {
    display: grid;
    /* *** MODIFIED: Changed from 4 to 5 columns *** */
    grid-template-columns: repeat(5, 1fr);
    column-gap: 20px; /* Reduced gap slightly for 5 columns */
    row-gap: 45px;
}

.document-uploader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    /* *** NEW: Make box fill the grid cell height *** */
    height: 100%;
}

.document-uploader-box label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px; 
    /* *** MODIFIED: Font size reduced *** */
    font-size: 0.85rem;
    /* *** REMOVED height: 2.5em; *** */
    line-height: 1.25;
    /* *** NEW: Make label grow and center text *** */
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.doc-preview-box {
    width: 150px;
    height: 150px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    overflow: hidden;
    flex-direction: column;
    padding: 5px;
}

.doc-preview-box .preview-text {
    color: #999;
    font-size: 0.9rem;
    padding: 10px;
}

.doc-preview-box .pdf-preview {
    color: #d9534f;
    font-weight: 600;
    font-size: 1rem;
}

.doc-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.document-uploader-box input[type="file"] {
    /* Kept padding at 0 to ensure minimal space above the button */
    padding: 0; 
    width: 100%;
    max-width: 150px;
    font-size: 0.9rem;
}

.document-uploader-box input[type="file"]::file-selector-button {
    width: 100%;
    margin-right: 0;
}

.document-uploader-box .field-note {
    font-size: 0.8rem;
    margin-top: 5px;
}

/* *** MODIFIED: Selector updated to include photo uploader *** */
.document-uploader-box .field-error,
.photo-uploader-container .field-error {
    /* *** MODIFIED: Font size reduced *** */
    font-size: 0.75rem;
    margin-top: 5px;
    /* Also make sure it's centered for the photo */
    width: 100%;
    max-width: 180px; 
}


/* Remove bottom margin for login/register inputs */
.form-container-narrow .form-group {
    margin-bottom: 1.25rem;
}


/* --- Buttons --- */
.btn {
    display: inline-block;
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    background-color: #17611C;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s;
    /* Removed default 1rem margin from the top */
    margin-top: 0; 
}
.btn:hover {
    background-color: #135017;
    box-shadow: 0 4px 12px rgba(23, 97, 28, 0.1);
}
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(23, 97, 28, 0.2);
}

/* --- Form Links (Login/Register) --- */
.form-links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.95rem;
}
.form-links a {
    color: #17611C;
    text-decoration: none;
    font-weight: 500;
}
.form-links a:hover {
    text-decoration: underline;
}
.form-links .btn-link {
    font-weight: 600;
}
/* For login page links */
.form-links a + a::before {
    content: "|";
    color: #ccc;
    margin: 0 10px;
}


/* --- Office Use Section --- */
#office-use-section {
    background-color: #f4f4f4;
    border: 2px dashed #aaa;
    margin-top: 2rem;
}

#office-use-section .section-title {
    color: #333;
}

.office-field-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 25px;
}

.office-field {
    display: flex;
    align-items: baseline;
    padding-top: 10px;
}

.office-field label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    white-space: nowrap;
    margin-right: 10px;
}

.fill-in-line {
    display: block;
    width: 100%;
    border-bottom: 2px solid #333;
    height: 1.5rem;
}


/* --- Loading Overlay & Print Styles --- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10000;
}

#loading-overlay p {
    font-size: 1.2rem;
    font-weight: 600;
    color: #17611C;
    margin-top: 20px;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 6px solid #f2f7f2;
    border-top-color: #17611C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.no-print {
    /* This class is used by JS to hide elements before printing */
}

@media print {
    body {
        padding: 0;
    }
    .form-container {
        margin: 0;
        border: none;
        box-shadow: none;
    }
    .no-print, .student-header, .btn, #preview-btn, #final-submit-btn {
        display: none !important;
    }
}

/* --- (NEW) File Upload Success Message --- */
.file-success-message {
    display: block;
    width: 100%;
    max-width: 150px; /* Match the file input width */
    padding: 10px 14px;
    margin-top: 10px; /* Space below the 'Choose File' button */
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #f0f0f0; /* Looks like a disabled field */
    color: #333;
    /* *** MODIFIED: Font size reduced *** */
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    text-align: left;
    
    /* Helps with word breaking for long file names */
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-all;

    /* Give it a minimum height to prevent layout jumps */
    min-height: 2.5em; 
    
    /* *** MODIFIED: Added for new 2-line style *** */
    line-height: 1.4;
    padding: 8px 12px;
}

/* For the photo uploader, it needs to be wider */
.photo-uploader-container .file-success-message {
    /* *** MODIFIED: Was 180px *** */
    max-width: 150px;
}


/* Hide the box completely if it's empty */
.file-success-message:empty {
    display: none;
}


/* --- Responsive Media Queries --- */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .form-container {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    .form-grid, .district-group {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .grid-col-span-2 {
        grid-column: span 1;
    }
    .form-section {
        padding: 1.5rem;
    }

    .personal-info-layout {
        flex-direction: column-reverse;
        gap: 15px;
    }
    .photo-uploader-container {
        padding-top: 0;
        border-bottom: 1px solid #eee;
        padding-bottom: 1.5rem;
    }
    .photo-preview-box {
        width: 120px;
        height: 160px;
    }

    .document-grid {
        /* *** MODIFIED: Kept at 2 columns for mobile, which is good *** */
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .document-uploader-box label {
        /* Reverted label height for responsiveness */
        height: auto;
        margin-bottom: 8px;
        /* Font size will inherit from the smaller desktop size, which is fine */
    }
    .doc-preview-box {
        width: 100px;
        height: 100px;
        margin-bottom: 10px;
    }

    .academic-header {
        display: none;
    }
    .academic-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    .academic-grid .exam-title {
        grid-column: span 2;
        text-align: center;
        background: #f4f4f4;
        padding: 8px;
        border-radius: 4px;
        margin-top: 10px;
    }
    .academic-grid input {
        font-size: 0.9rem;
    }

    .student-header {
        margin: -1.5rem -1.5rem 1.5rem -1.5rem;
        padding: 10px 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .logout-link {
        align-self: flex-end;
    }
    .form-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    .form-header .logo {
        margin: 0;
    }
    .form-header h2 {
        font-size: 1.5rem;
    }
    .form-subtitle {
        font-size: 0.9rem;
    }
    .quota-group {
        gap: 8px;
    }
    .radio-chip label {
        padding: 8px 14px;
        font-size: 0.9rem;
    }

    .office-field-group {
        grid-template-columns: 1fr;
    }
    
    /* *** MODIFIED: Responsive styles for the new layout *** */
    @media (max-width: 900px) {
        
        /* This is the main green-bordered box */
        /* It is now DIFFERENT from .login-layout-box */
        .form-container-narrow {
            /* On mobile, it's just a normal box */
            max-width: 500px;
            margin-top: 1rem;
            padding: 1.5rem; /* Standard mobile padding */
        }
        
        /* This is the new box for the LOGIN page */
        .login-layout-box {
            max-width: 500px; /* Match the others on mobile */
            margin-top: 1rem;
            padding: 1.5rem;
        }

        .login-content-split {
            flex-direction: column;
            gap: 1.5rem;
        }

        .pre-form-message {
            flex-basis: auto;
            /* Make it look like a little info box */
            background-color: #f2f7f2;
            border: 1px solid #ddd;
            padding: 1rem;
            border-radius: 8px;
            border-right: 1px solid #ddd; /* remove desktop border */
        }

        .login-form-panel {
            flex-basis: auto;
            border-top: 1px solid #eee;
            padding-top: 1.5rem;
            padding-left: 0; /* remove desktop padding */
            padding-right: 0;
            padding-bottom: 0;
        }

        /* --- New header responsive styles --- */
        .login-header-content {
            flex-direction: column;
            text-align: center;
            align-items: center;
            gap: 1rem; /* Space between logo and text */
        }

        .login-header .logo {
            margin-bottom: 0; /* Override previous margin */
        }

        .login-title-block {
            text-align: center;
        }

        .login-title-block h2 {
            margin-bottom: 0.5rem; /* Re-add some space */
        }
    }
}

/* =======================================================
  === NEW STYLES FOR ON-DEMAND UPLOAD BUTTON ===
  =======================================================
*/

/* This is the new "Upload" button */
.btn-upload-file {
    font-weight: 600;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    /* *** MODIFIED: Changed to green *** */
    background-color: #17611C; 
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
    width: 100%;
    max-width: 150px;
    
    /* 1. Hide it by default */
    display: none; 
}
/* Photo button is wider */
.photo-uploader-container .btn-upload-file {
    /* *** MODIFIED: Was 180px *** */
    max-width: 150px;
}


.btn-upload-file:hover {
    /* *** MODIFIED: Changed to dark green *** */
    background-color: #135017;
}

/* 2. When a file is selected, this class will be added by JS to show the button */
.file-is-selected .btn-upload-file {
    display: block;
}

/* 3. When uploading, the JS will add this class */
.is-uploading .btn-upload-file {
    background-color: #555;
    color: #ccc;
    cursor: not-allowed;
}

/* 4. When upload is successful, we hide the inputs and button */
.upload-is-complete .btn-upload-file,
.upload-is-complete input[type="file"] {
    display: none;
}

/* 5. And we make the success message box green to show it's done */
.upload-is-complete .file-success-message {
    background-color: #e6f0e7;
    border-color: #17611C;
    color: #135017;
    font-weight: 600;
    /* Re-center the text for the final success message */
    text-align: center;
}

/* =======================================================
  === NEW STYLES FOR 2-LINE "READY" MESSAGE ===
  =======================================================
*/
.file-ready-name {
    display: block;
    font-weight: 600;
    color: #333;
    /* This will truncate long filenames with an ellipsis */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-ready-status {
    display: block;
    font-size: 0.9em; /* Slightly smaller than the parent */
    color: #555;
    margin-top: 4px;
}

/* =======================================================
  === NEW STYLES FOR LONG LABELS ===
  =======================================================
*/
#uploader-box-character label,
#uploader-box-provisional label {
    font-size: 0.75rem; /* Make it even smaller */
    line-height: 1.3; /* Adjust line-height to fit */
}

/* =======================================================
  === NEW STYLES FOR PASSWORD TOGGLE ===
  =======================================================
*/
.password-wrapper {
    position: relative;
    width: 100%;
}

/* This is the new style to add padding to the password input */
#password {
    padding-right: 40px; /* Make room for the icon */
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #888;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    stroke: #888; /* Icon color */
}

.toggle-password:hover svg {
    stroke: #333; /* Darker color on hover */
}

/* =======================================================
  === NEW STYLES FOR LOGIN SECURITY CHECK ===
  =======================================================
*/
/* Make the security error text small, like the uploader errors */
.form-container-narrow .field-error,
.login-form-panel .field-error {
    font-size: 0.8rem;
    text-align: left;
    margin-top: 5px;
}

/* Make the number input's "spinners" not show up (optional, but cleaner) */
#security_check::-webkit-outer-spin-button,
#security_check::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#security_check {
    -moz-appearance: textfield; /* Firefox */
}

/* *** MODIFIED STYLES FOR HORIZONTAL LAYOUT *** */
.security-check-group {
    display: flex;
    align-items: center;
    gap: 10px;
    /* NEW: Add the border you wanted */
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px 14px;
}

.security-check-group label {
    flex: 1; /* Allows it to grow */
    margin-bottom: 0; /* Override default form-group margin */
    font-size: 0.9rem; 
    white-space: nowrap; /* Keep question on one line */
}

.security-check-group input {
    /* NEW: Make it wider */
    flex: 0 1 120px; 
    text-align: center;
    padding-top: 10px; 
    padding-bottom: 10px;
}

/* =======================================================
  === NEW STYLES FOR HEADER & SPLIT LAYOUT ===
  =======================================================
*/

/* This is the new class for the login page's main box */
.login-layout-box {
    /* *** MODIFIED: Was 900px *** */
    max-width: 800px;
    padding: 0;
    overflow: hidden;
}

.login-header {
    padding: 0 2rem; 
    border-bottom: 2px solid #f0f0e0;
    margin-bottom: 0; 
}

/* Flexbox container for logo and text */
.login-header-content {
    display: flex;
    flex-direction: row; 
    align-items: center; 
    justify-content: flex-start; /* Logo on left */
    padding: 1rem 0; 
    width: 100%;
}


.login-header .logo {
    margin: 0; 
    /* *** MODIFIED: Increased logo size *** */
    width: 170px; 
    height: 140px;
    object-fit: contain;
    margin-right: 1.5rem; 
    flex-shrink: 0;
}

/* Container for the text block */
.login-title-block {
    text-align: center; 
    flex-grow: 1; 
    margin-left: auto;
    margin-right: auto;
    padding-left: 0; 
}

/* 🎯 MODIFIED CODE HERE: Reduced vertical space around H2 */
.login-title-block h2 {
    color: #17611C;
    font-size: 1.8rem; 
    margin-top: 0; 
    margin-bottom: 0; /* Reduced space below H2 */
}

/* 🎯 MODIFIED CODE HERE: Removed all vertical space around H3 */
.login-title-block h3 {
color: #333; 
    font-size: 1.1rem; 
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 0; /* SET TO 0 */
    line-height: 1.3;
}


.login-content-split {
    display: flex;
    width: 100%;
}

.pre-form-message {
    flex-basis: 40%;
    background-color: #f2f7f2; 
    padding: 2rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border-right: 2px solid #f0f0e0;
}

.pre-form-message h3 {
    color: #17611C;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.pre-form-message p {
    margin: 0;
    font-size: 1rem;
    color: #333;
    line-height: 1.5;
}

.pre-form-message a {
    font-weight: 600;
    color: #17611C;
    text-decoration: none;
}

/* *** NEW: Added the style for the red link *** */
.pre-form-message a.register-link-red {
    color: #d9534f; /* Red color */
}

.pre-form-message a:hover {
    text-decoration: underline;
}


.login-form-panel {
    flex-basis: 60%;
    padding: 2rem;
    box-sizing: border-box;
}

/* Remove margin-bottom from the last form-group in the login panel */
.login-form-panel .form-group:last-of-type {
    margin-bottom: 1.5rem;
}