/* ================= VARIABLES & RESET ================= */
:root {
    --primary: #13ec25;
    --primary-hover: #0fdc20;
    --bg-light: #f6f8f6;
    --bg-dark: #102212;
    --text-main: #102212;
    --text-muted: #777;
    --error: #d93025;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Public Sans', sans-serif;
}

body {
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Signup uses hidden, Login uses min-height. Hidden is safer for the "fits screen" look */
    overflow: hidden; 
}

/* ================= SHARED LAYOUT ================= */
.container {
    width: 100%;
    max-width: 1100px;
    height: 90vh;
    max-height: 850px;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* LEFT PANEL (Side Image/Stats) */
.left {
    width: 50%;
    position: relative;
    padding: 40px;
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: 
        linear-gradient(rgba(19,236,37,0.2), rgba(16,34,18,0.85)),
        url("https://peakvisor.com/photo/SD/Negros-Occidental-mount-mandalagan-volcano-philippines-1523166458.jpg");
    background-size: cover;
    background-position: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-box {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-dark);
    font-weight: bold;
}

.left h2 {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

.left p {
    font-size: 17px;
    opacity: .9;
    max-width: 420px;
    line-height: 1.6;
}

.stats {
    display: flex;
    gap: 40px;
}

.stats h3 {
    color: var(--primary);
    font-size: 25px;
}

.stats p {
    font-size: 13px;
    opacity: .7;
}

/* RIGHT PANEL (Forms) */
.right {
    width: 50%;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-wrapper {
    width: 100%;
    max-width: 400px;
}

.form-wrapper h2 {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 25px;
    font-size: 14px;
}

/* ================= FORM ELEMENTS ================= */
.input-group {
    margin-bottom: 18px;
}

.input-group label {
    font-size: 13px;
    display: block;
    margin-bottom: 6px;
    color: #444;
}

.input-group input {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 14px;
    transition: 0.2s ease;
}

.input-group input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(19, 236, 37, 0.15);
}

/* For Signup First/Last Name Row */
.name-row {
    display: flex;
    gap: 15px;
    margin-bottom: 18px;
}

.name-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #555;
}

.remember a {
    color: #2e7d32;
    font-weight: 600;
    text-decoration: underline;
}

/* ================= BUTTONS & SOCIAL ================= */
.btn {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn:hover {
    background: var(--primary-hover);
}

.divider {
    text-align: center;
    margin: 25px 0;
    font-size: 11px;
    letter-spacing: 1px;
    color: #999;
    text-transform: uppercase;
}

.social {
    display: flex;
    gap: 15px;
}

.social button {
    flex: 1;
    padding: 11px;
    border: 1px solid #ddd;
    background: var(--white);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s ease;
}

.social button:hover {
    background: #f3f3f3;
}

.footer {
    margin-top: 35px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

/* ================= ERROR / ALERT STYLES ================= */
.error-message {
    color: var(--error);
    background: #fff8f7;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #fca5a5;
    font-size: 14px;
    margin-bottom: 15px;
}

/* Error Alert Styling */
.error-alert {
    background-color: #fce8e6; /* Light red background */
    color: var(--error);       /* Your existing red variable */
    padding: 12px;
    border-radius: 3px;
    border: 1px solid #f5c2c7;
    margin-bottom: 20px;       /* Space between error and form */
    font-size: 14px;
    font-weight: 500;
    text-align: left;
}

.input-error {
    border-color: var(--error) !important;
    background: #fff8f7 !important;
}

.input-error-text {
    color: var(--error);
    font-size: 12px;
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

/* ================= MODAL / OVERLAY ================= */
.modal, .alert-overlay {
    display: none; /* Controlled by JS */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    
    /* These three lines ensure the modal stays centered */
    align-items: center;
    justify-content: center;
}

/* Update the content box to remove conflicting margins */
.modal-content, .alert-box {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    margin: 0; /* Remove vh margins as flex handles centering now */
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdfdfd;
}

.modal-header h2 { margin: 0; font-size: 1.25rem; color: var(--text-main); }

.close-modal {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.6;
    color: #444;
    text-align: left; /* Ensures text stays left-aligned inside centered modal */
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    text-align: right;
    background: #fdfdfd;
}

.btn-secondary {
    background: #ececec;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-secondary:hover { background: #e0e0e0; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================= RESPONSIVE ================= */

@media screen and (max-width: 992px) {
    body { 
        overflow-y: auto; 
        padding: 20px 0;
        display: block; 
    }

    .container {
        flex-direction: column;
        height: auto; /* Crucial: Let the container grow with the content */
        max-height: none;
        width: 95%;
        margin: 0 auto;
    }

    .left { 
        width: 100%;
        height: auto; /* Changed to auto so it wraps around your stats */
        min-height: 350px; 
        padding: 5px 15px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 24px;
    }

    /* Ensure the stats row doesn't wrap or hide labels */
    .stats {
        display: flex;
        flex-direction: row; /* Keep them side-by-side */
        gap: 0.1rem;
        margin-top: 20px;
        /*background: rgba(0, 0, 0, 0.2); /* Subtle backing to make text pop against the image */
        padding: 15px;
        border-radius: 8px;
        width: fit-content;
    }

    .stats div {
        display: flex;
        flex-direction: column;
    }

    .stats p {
        display: block 
        font-size: 12px;
        opacity: 1;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .right { 
        width: 100%; 
        padding: 40px 24px; 
    }
}

@media screen and (max-width: 480px) {
    .left {
        padding: 30px 20px;
    }

    .left h2 { font-size: 24px; }
    
    /* On very small screens, make stats take full width */
    .stats {
        gap: 25px;
        width: 100%;
        justify-content: space-around;
    }
}