:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #60a5fa;
    --secondary: #0ea5e9;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --white: #ffffff;
    --bg-color: #f0f9ff;
    --error: #ef4444;
}

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

body {
    background: linear-gradient(135deg, #e0f2fe 0%, #bfdbfe 100%);
    min-height: 100vh;
    display: flex;
    align-items: flex-start; /* Prevents top cutoff when scrolling */
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding: 20px 0; /* Ensures space top and bottom when scrolling */
}

/* Background Animation */
.bubbles {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    top: 0;
    left: 0;
    pointer-events: none;
}

.bubble {
    position: absolute;
    bottom: -100px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: rise 10s infinite ease-in;
}

.bubble:nth-child(1) { width: 40px; height: 40px; left: 10%; animation-duration: 8s; }
.bubble:nth-child(2) { width: 20px; height: 20px; left: 20%; animation-duration: 5s; animation-delay: 1s; }
.bubble:nth-child(3) { width: 50px; height: 50px; left: 35%; animation-duration: 7s; animation-delay: 2s; }
.bubble:nth-child(4) { width: 80px; height: 80px; left: 50%; animation-duration: 11s; animation-delay: 0s; }
.bubble:nth-child(5) { width: 35px; height: 35px; left: 55%; animation-duration: 6s; animation-delay: 1s; }
.bubble:nth-child(6) { width: 45px; height: 45px; left: 65%; animation-duration: 8s; animation-delay: 3s; }

@keyframes rise {
    0% { bottom: -100px; transform: translateX(0); }
    50% { transform: translateX(100px); }
    100% { bottom: 1080px; transform: translateX(-200px); }
}

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    margin: auto;
}

.login-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    overflow: hidden;
    min-height: 600px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Left Panel */
.login-brand {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 10%, transparent 20%);
    background-size: 20px 20px;
    top: -50%;
    left: -50%;
    animation: movePattern 20s linear infinite;
    opacity: 0.3;
}

@keyframes movePattern {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.brand-content {
    position: relative;
    z-index: 2;
}

.logo {
    width: 120px;
    height: auto;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
    background: white;
    padding: 10px;
    border-radius: 50%;
}

.brand-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.brand-content h3 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 24px;
    opacity: 0.9;
}

.brand-content p {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.8;
}

/* Right Panel */
.login-form-container {
    flex: 1.2;
    padding: 50px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--white);
}

.login-header {
    margin-bottom: 30px;
    text-align: center;
}

.login-header h2 {
    color: var(--text-dark);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-light);
    font-size: 15px;
}

/* Role Selector */
.role-selector {
    display: flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 30px;
}

.role-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

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

.role-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon i:first-child {
    position: absolute;
    left: 16px;
    color: var(--text-light);
    font-size: 18px;
    transition: 0.3s;
}

.input-icon input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-dark);
    transition: all 0.3s ease;
    outline: none;
    background: #f8fafc;
}

.input-icon input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.input-icon input:focus + i,
.input-icon input:focus ~ i {
    color: var(--primary);
}

.toggle-password {
    position: absolute;
    right: 16px;
    color: var(--text-light);
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.toggle-password:hover {
    color: var(--text-dark);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-light);
}

.remember-me input {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.forgot-password {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Submit Button */
.btn-login {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.btn-login:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
        min-height: auto;
    }
    
    .login-brand {
        padding: 40px 20px;
    }
    
    .login-form-container {
        padding: 40px 30px;
    }
}

@media (max-width: 480px) {
    .login-form-container {
        padding: 30px 20px;
    }
    
    .role-btn {
        font-size: 12px;
        flex-direction: column;
        gap: 4px;
        padding: 10px 5px;
    }
    
    .login-header h2 {
        font-size: 26px;
    }
}
