@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* Main Modal Wrapper (Hidden by default) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    /* Move the original body background styles here */
    background-color: rgba(243, 244, 246, 0.95); /* Added opacity */
    background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex; /* Flex used for centering */
    align-items: center;
    justify-content: center;
    padding: 20px;

    /* Hide initially */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    backdrop-filter: blur(5px);
}

/* Active State to show modal */
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.login-card {
    position: relative; /* Needed for absolute positioning of close btn */
    display: flex;
    background: #ffffff;
    width: 100%;
    max-width: 850px;
    height: 550px;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease-out;
}

.modal-overlay.active .login-card {
    transform: translateY(0);
}

/* --- Close Button --- */
.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.close-modal-btn:hover {
    color: #000;
}

/* --- Existing Styles (Unchanged) --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; } /* Reset body to simple font */

/* ... Copy the rest of your original CSS below (from .card-visual downwards) ... */

.card-visual {
    width: 50%;
    position: relative;
    background: url('https://images.unsplash.com/photo-1516035069371-29a1b244cc32?ixlib=rb-1.2.1&auto=format&fit=crop&w=1000&q=80') no-repeat center center;
    background-size: cover;
}

.card-visual::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
}

.visual-text {
    position: absolute;
    bottom: 40px;
    left: 40px;
    right: 40px;
    z-index: 2;
    color: white;
}

.visual-text h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.visual-text p {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
    line-height: 1.5;
}

.card-form {
    width: 50%;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-header { margin-bottom: 30px; text-align: center; }
.form-header h1 { font-family: 'Cinzel', serif; font-size: 1.8rem; color: #111; margin-bottom: 5px; }
.form-header p { color: #888; font-size: 0.9rem; }

.input-group { margin-bottom: 20px; }
.input-label { display: block; margin-bottom: 8px; font-size: 0.8rem; font-weight: 600; color: #444; text-transform: uppercase; letter-spacing: 0.5px; }
.input-box { position: relative; }
.input-box input { width: 100%; padding: 12px 15px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 0.95rem; transition: all 0.3s; background: #fcfcfc; color: #333; }
.input-box input:focus { outline: none; border-color: #111; background: #fff; box-shadow: 0 0 0 3px rgba(0,0,0,0.05); }

.toggle-pass { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #999; cursor: pointer; }
.toggle-pass:hover { color: #333; }

.options-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; font-size: 0.85rem; }
.checkbox-wrap { display: flex; align-items: center; color: #666; cursor: pointer; }
.checkbox-wrap input { margin-right: 8px; accent-color: #111; }
.forgot-link { color: #111; text-decoration: none; font-weight: 500; border-bottom: 1px dotted #ccc; }
.forgot-link:hover { border-bottom-style: solid; }

.btn-primary { width: 100%; padding: 14px; background: #111; color: #fff; border: none; border-radius: 8px; font-size: 0.95rem; font-weight: 500; cursor: pointer; transition: transform 0.2s, background 0.2s; }
.btn-primary:hover { background: #333; transform: translateY(-2px); }

.google-btn { width: 100%; padding: 12px; margin-top: 20px; background: #fff; border: 1px solid #ddd; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; color: #555; font-size: 0.9rem; font-weight: 500; transition: all 0.2s; }
.google-btn:hover { background: #f9f9f9; border-color: #bbb; }

.auth-footer { text-align: center; margin-top: 25px; font-size: 0.85rem; color: #888; }
.auth-footer a { color: #111; font-weight: 600; text-decoration: none; }

@media (max-width: 768px) {
    .login-card { flex-direction: column; height: auto; max-width: 450px; }
    .card-visual { width: 100%; height: 150px; } /* Made slightly shorter for popup */
    .visual-text { display: none; }
    .card-form { width: 100%; padding: 30px; }
    /* Position close button differently on mobile if needed */
    .close-modal-btn { color: white; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
}
