/* Overall page container and main section */
.registration-main {
    padding: 40px 20px; /* Top/bottom padding and side padding */
    font-family: Arial, sans-serif;
    background-color: #f8f9fa; /* Light background for the page */
}

.registration-section {
    max-width: 1000px; /* Max width for the content */
    margin: 0 auto; /* Center the section on larger screens */
    background-color: #ffffff; /* White background for the grid container itself */
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* Ensures child elements respect border-radius */
}

/* Grid Container for Form and Image */
.registration-grid-container {
    display: grid;
    /* Two columns: one for the form (1.2fr, slightly larger) and one for the image (1fr) */
    grid-template-columns: 1.2fr 1fr;
    gap: 0; /* No gap between columns, as we want them to touch */
    min-height: 500px; /* Ensure a minimum height for the grid */
}

/* Form Column Styles */
.registration-form-column {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically center content */
    align-items: center; /* Horizontally center content in column */
    text-align: center; /* Center align text */
}

.form-title {
    font-size: 2.2rem;
    color: #343a40;
    margin-bottom: 30px;
}

.registration-form {
    width: 100%;
    max-width: 400px; /* Limit form width for better readability */
    margin: 0 auto;
}

/* Styling for Django form fields (as_p renders each field in a <p>) */
.registration-form p {
    margin-bottom: 15px; /* Space between form fields */
}

.registration-form label {
    display: block; /* Make labels take full width */
    text-align: left; /* Align labels to the left */
    margin-bottom: 5px;
    font-weight: bold;
    color: #495057;
    font-size: 0.95rem;
}

.registration-form input[type="text"],
.registration-form input[type="email"],
.registration-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    color: #495057;
    box-sizing: border-box; /* Include padding and border in element's total width/height */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.registration-form input[type="text"]:focus,
.registration-form input[type="email"]:focus,
.registration-form input[type="password"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Error list for form fields */
.registration-form ul.errorlist {
    list-style: none;
    padding: 0;
    margin-top: 5px;
    margin-bottom: 10px;
    color: #dc3545; /* Red color for errors */
    font-size: 0.85rem;
    text-align: left;
}

.form-submit-container {
    margin-top: 30px;
    text-align: center;
}

.submit-btn {
    padding: 15px 30px;
    background-color: #28a745; /* Green button */
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
}

.submit-btn:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.3);
}

/* Image Column Styles */
.registration-image-column {
    background-color: #e9ecef; /* Light gray background for image side */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically center content */
    align-items: center; /* Horizontally center content */
    padding: 40px;
}

.image-heading {
    font-size: 1.8rem;
    color: #343a40;
    margin-bottom: 30px;
    text-align: center;
}

.welcome-image {
    max-width: 100%; /* Image responsive within its column */
    height: auto; /* Maintain aspect ratio */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: block; /* Remove extra space below image */
}

/* --- Media Queries for Responsiveness --- */

@media (max-width: 768px) { /* Tablets and smaller screens */
    .registration-grid-container {
        grid-template-columns: 1fr; /* Stack columns vertically */
        min-height: unset; /* Remove min-height when stacked */
    }

    .registration-form-column,
    .registration-image-column {
        padding: 30px; /* Reduce padding on smaller screens */
    }

    .form-title {
        font-size: 2rem;
        margin-bottom: 20px;
    }

    .image-heading {
        font-size: 1.6rem;
        margin-top: 20px; /* Add some space above heading when stacked */
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) { /* Smartphones */
    .registration-section {
        margin: 20px 10px; /* Smaller margins on very small screens */
        border-radius: 5px;
    }

    .registration-form-column,
    .registration-image-column {
        padding: 20px;
    }

    .form-title {
        font-size: 1.8rem;
    }

    .image-heading {
        font-size: 1.4rem;
    }

    .submit-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }
}