:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow-light: 0 4px 20px rgba(102, 126, 234, 0.15);
    --shadow-medium: 0 8px 30px rgba(102, 126, 234, 0.2);
    --shadow-heavy: 0 15px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset dan base styling */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Struktur utama: 2 bahagian kiri dan kanan */
.login-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Bahagian kiri: ucapan aluan dengan enhanced styling */
.welcome-section {
    flex: 1;
    background: var(--primary-gradient);
    color: #fff;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

/* Subtle background pattern */
.welcome-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}

.welcome-section > * {
    position: relative;
    z-index: 1;
}

.welcome-section h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: fadeInUp 0.8s ease-out;
}

.welcome-section p {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 16px;
    opacity: 0.95;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.welcome-section p strong {
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.version {
    margin-top: 30px !important;
    font-size: 14px;
    color: rgba(255,255,255,0.8) !important;
    font-weight: 500;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Bahagian kanan: borang log masuk dengan premium styling */
.login-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
}

/* Subtle background decoration */
.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102,126,234,0.03) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    padding: 40px;
    text-align: center;
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out 0.3s both;
    transition: var(--transition);
}

.login-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* PERUBAHAN: Logo/Brand styling - ikon dan tulisan seimbang */
.login-logo {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-logo i {
    font-size: 32px; /* SAIZ IKON CUBE - DIBESARKAN */
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo .brand-text {
    font-size: 24px; /* SAIZ TULISAN SPARTA - SEIMBANG */
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

/* Enhanced form styling */
.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
    text-align: left;
    display: block;
}

.form-control {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    transition: var(--transition);
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255,255,255,1);
    transform: translateY(-1px);
}

.form-control:hover:not(:focus) {
    border-color: #d1d5db;
    background: rgba(255,255,255,0.9);
}

/* Enhanced button styling */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.5px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, #5a6fd8 0%, #6b5b95 100%);
}

.btn-primary:hover::before {
    left: 100%;
}

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

.btn-primary i {
    margin-right: 8px;
}

/* Enhanced alert styling */
.alert {
    border: none;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    animation: slideInDown 0.5s ease-out;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

.alert i {
    margin-right: 8px;
}

/* Demo credentials styling */
.text-muted {
    color: #6b7280 !important;
    font-size: 13px;
    padding: 12px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Loading state untuk button */
.btn-primary.loading {
    pointer-events: none;
    position: relative;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design: Enhanced mobile experience */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .welcome-section {
        align-items: center;
        text-align: center;
        padding: 40px 20px;
        min-height: 40vh;
    }

    .welcome-section h1 {
        font-size: 28px;
        margin-bottom: 16px;
    }

    .welcome-section p {
        font-size: 15px;
        margin-bottom: 12px;
    }

    .login-wrapper {
        padding: 20px;
        min-height: 60vh;
    }

    .login-box {
        padding: 30px 25px;
        box-shadow: var(--shadow-medium);
        max-width: 100%;
    }

    .login-box:hover {
        transform: none;
    }
}

@media (max-width: 480px) {
    .welcome-section {
        padding: 30px 15px;
    }
    
    .welcome-section h1 {
        font-size: 24px;
    }
    
    .login-box {
        padding: 25px 20px;
        border-radius: 12px;
    }
    
    .form-control {
        padding: 14px;
    }
    
    .btn-primary {
        padding: 16px 24px;
    }
}

/* Focus states untuk accessibility */
.form-control:focus,
.btn-primary:focus {
    outline: none;
}

.btn-primary:focus-visible {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 3px;
    }
    
    .btn-primary {
        border: 2px solid #000;
    }
}