* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'HelveticaNeue', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh; /* Locks body to exactly the window height */
    overflow: hidden; /* Removes scrollbar from the main body */
    padding: 20px;
    color: #111111;
}

.split-container {
    position: relative;
    display: block;
    width: 100%;
    max-width: 500px; /* Changed from 1000px to make a clean, centered form */
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    height: 90vh;
    max-height: 800px;
}

.image-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 30%;
    height: 100%;
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #e2e8f0;
    z-index: 2;
}

.image-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.form-panel {
    position: relative; /* Changed from absolute */
    width: 100%; /* Changed from 70% */
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #ffffff;
    z-index: 1;
}

.split-container.signup-mode .image-panel {
    left: 70%;
}

.split-container.signup-mode .form-panel {
    left: 0;
}

.panel-header {
    padding: 20px 30px 10px 30px;
    flex-shrink: 0;
    display: flex;
    justify-content: center; /* Centers the logo */
    border-bottom: 1px solid #f1f5f9;
    background-color: #ffffff;
    z-index: 10;
}

.logo {
    height: 100px;
    width: auto;
    display: block;
}

.toggle-link {
    text-align: center;
    margin-top: 24px;
    font-size: 0.95rem;
    color: #64748b;
}

.toggle-link a {
    color: #184989;
    font-weight: 600;
    text-decoration: none;
}

.toggle-link a:hover {
    text-decoration: underline;
}

.success-content {
    height: auto;
    min-height: 200px;
}

.full-height-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 1;
    transform: translateY(0);
}

.form-fade-down {
    opacity: 0 !important;
    transform: translateY(30px) !important;
    pointer-events: none;
}

.form-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px 60px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Custom Scrollbar Styling */
.form-scroll-area::-webkit-scrollbar {
    width: 8px;
}
.form-scroll-area::-webkit-scrollbar-track {
    background: #f8fafc; 
    border-radius: 10px;
}
.form-scroll-area::-webkit-scrollbar-thumb {
    background: #cbd5e1; 
    border-radius: 10px;
}
.form-scroll-area::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; 
}

.panel-footer {
    padding: 20px 60px 40px 60px;
    flex-shrink: 0;
    background-color: #ffffff;
    border-top: 1px solid #f1f5f9;
    z-index: 10;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
}

.form-group.hidden {
    display: none;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #3f4770;
}

select, input, .selector-btn {
    width: 100%;
    padding: 14px 24px; /* Increased side padding for the pill curve */
    border: 1px solid #cbd5e1;
    border-radius: 999px; /* Creates the pill shape */
    font-size: 1rem;
    color: #111111;
    background-color: #f8fafc;
    transition: all 0.2s ease;
    outline: none;
    appearance: none;
    cursor: pointer;
}

.selector-btn {
    text-align: left;
    cursor: pointer;
    color: #737373;
}

select, .selector-btn {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23111111%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 20px top 50%; /* Adjusted arrow slightly inward */
    background-size: 12px auto;
    padding-right: 44px;
}

select:focus, input:focus, .selector-btn:focus {
    border-color: #184989;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(24, 73, 137, 0.1);
}

.submit-btn {
    background-color: #184989;
    color: #ffffff;
    border: none;
    padding: 16px;
    border-radius: 999px; /* Creates the pill shape */
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    width: 100%;
    display: block;
    text-align: center;
}

.image-badge {
    position: absolute;
    bottom: 24px;
    left: 24px;
    background-color: rgba(15, 23, 42, 0.65); /* Dark, semi-transparent background */
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 10;
    backdrop-filter: blur(4px); /* Adds a premium blur effect behind the badge */
    pointer-events: none; /* Prevents it from interfering with clicks */
}

.submit-btn:hover {
    background-color: #123666;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 73, 137, 0.2);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 17, 17, 0.4); /* Slightly softer, darker overlay */
    backdrop-filter: blur(4px); /* Adds a premium blur effect to the background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeInBackground 0.3s ease forwards;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 450px; /* Slightly wider for better breathing room */
    height: auto; /* Let the content dictate the height */
    min-height: 250px;
    border-radius: 16px; /* Rounder, more modern corners */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05); /* Deep shadow with subtle border ring */
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
}

/* The Pop-in Animation Trigger */
.modal:not(.hidden) .modal-content {
    animation: popInModal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Keyframes for Animations */
@keyframes fadeInBackground {
    0% { background: rgba(17, 17, 17, 0); backdrop-filter: blur(0px); }
    100% { background: rgba(17, 17, 17, 0.4); backdrop-filter: blur(4px); }
}

@keyframes popInModal {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    font-size: 1.1rem;
    color: #111111;
}

#close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    transition: color 0.2s ease;
}

#close-modal:hover {
    color: #111111;
}

.modal-search {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-list {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-list li {
    padding: 14px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
    color: #3f4770;
    transition: background-color 0.2s ease;
}

.modal-list li:hover {
    background-color: #f8fafc;
    color: #184989;
    font-weight: 500;
}

@media (max-width: 768px) {
    .split-container {
        display: flex;
        flex-direction: column;
        max-width: 480px;
    }
    .image-panel {
        position: relative;
        width: 100%;
        height: 200px;
        left: 0 !important;
        flex: none;
    }
    .form-panel {
        position: relative;
        width: 100%;
        height: auto;
        left: 0 !important;
        flex: 1; 
    }
    .panel-header {
        padding: 24px 24px 16px 24px;
    }
    .form-scroll-area {
        padding: 16px 24px;
    }
    .panel-footer {
        padding: 16px 24px 24px 24px;
    }
    .split-container.signup-mode .image-panel {
        order: 1;
    }
    .split-container.signup-mode .form-panel {
        order: 2;
    }
}
form.hidden {
    display: none !important;
}

/* --- Success Modal Specific Styles --- */

.success-content {
    max-width: 400px; /* Keeps it perfectly proportioned */
    min-height: auto;
}

/* The Clean 'X' Button */
#close-success, #close-error {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#close-success:hover, #close-error:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

/* The Body and Icon */
.success-body {
    padding: 32px 24px 24px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.success-icon-wrapper {
    background-color: #d1fae5; /* Soft green background */
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    /* This makes the icon pop in right after the modal opens */
    animation: scaleInBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s backwards;
}

.success-body p {
    color: #475569;
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 28px;
}

#btn-ok-success {
    width: 100%;
    margin-top: 0;
}

@keyframes scaleInBounce {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}