* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray: #64748b;
    --gray-light: #cbd5e1;
    --gray-lighter: #f1f5f9;
    --white: #ffffff;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--dark);
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1200px;
    width: 100%;
    background: var(--white);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-height: 700px;
}

/* Left Side - Branding */
.login-left {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.login-branding {
    position: relative;
    z-index: 1;
}

.logo-section {
    margin-bottom: 50px;
}

.portal-logo {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.portal-tagline {
    font-size: 18px;
    opacity: 0.9;
    font-weight: 500;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.feature-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.feature-item svg {
    flex-shrink: 0;
    margin-top: 4px;
    opacity: 0.9;
}

.feature-item h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.feature-item p {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.5;
}

/* Right Side - Login Form */
.login-right {
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.login-box {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

.login-header {
    margin-bottom: 40px;
}

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

.login-header p {
    font-size: 15px;
    color: var(--gray);
    line-height: 1.6;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-label svg {
    color: var(--gray);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: var(--gray-light);
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-input {
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--gray);
    transition: color 0.3s ease;
}

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

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gray);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

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

.forgot-link:hover {
    color: var(--primary-dark);
}

.btn-login {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

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

.login-divider {
    position: relative;
    text-align: center;
    margin: 8px 0;
}

.login-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--gray-light);
}

.login-divider span {
    position: relative;
    background: var(--white);
    padding: 0 16px;
    font-size: 13px;
    color: var(--gray);
    font-weight: 500;
}

.btn-secondary-login {
    width: 100%;
    padding: 14px 24px;
    background: var(--white);
    color: var(--dark);
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-secondary-login:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.login-footer {
    margin-top: 32px;
    text-align: center;
}

.login-footer p {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 16px;
}

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

.login-footer a:hover {
    text-decoration: underline;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--gray-lighter);
    border-radius: 8px;
    font-size: 12px;
    color: var(--gray);
}

.security-badge svg {
    color: var(--success);
}

.back-to-main {
    position: absolute;
    bottom: 30px;
    left: 50px;
}

.back-to-main a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gray);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-to-main a:hover {
    color: var(--primary);
}

/* Error Message */
.login-error {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: 12px;
    color: var(--danger);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
    transition: opacity 0.3s ease;
}

.login-error svg {
    flex-shrink: 0;
}

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

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.login-form.shake {
    animation: shake 0.5s ease;
}

/* Loading State */
.btn-login.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-login.loading span {
    opacity: 0;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 968px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }

    .login-left {
        display: none;
    }

    .login-right {
        padding: 40px 30px;
    }

    .back-to-main {
        position: static;
        margin-top: 30px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .login-right {
        padding: 30px 20px;
    }

    .login-header h2 {
        font-size: 26px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
