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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

/* Background Animation */
.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0; /* Make sure it's behind everything */
    pointer-events: none; /* ✅ Allow clicks to pass through */
}

.floating-shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.shape-3 {
    width: 60px;
    height: 60px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    top: 10%;
    right: 30%;
    animation-delay: 1s;
}

.shape-5 {
    width: 140px;
    height: 140px;
    bottom: 30%;
    right: 40%;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 1;
    }
}

/* Login Container */
.login-container {
    position: relative;
    z-index: 10; /* ✅ Ensure it's above background */
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding: 2rem;
    pointer-events: auto; /* ✅ Ensure this layer can receive clicks */
}

/* Login Card */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    position: relative;
    animation: slideInUp 0.8s ease;
}

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

/* Login Header */
.login-header {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.login-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.logo-section {
    position: relative;
    z-index: 2;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.login-logo:hover {
    transform: scale(1.05) rotate(5deg);
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.login-header p {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Login Form Container */
.login-form-container {
    padding: 2.5rem 2rem;
}

.login-form-container h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.login-subtitle {
    color: #7f8c8d;
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

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

.input-container input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 1rem;
    background: #f8f9fa;
    transition: all 0.3s ease;
    outline: none;
}

.input-container input:focus {
    border-color: #e74c3c;
    background: white;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.input-container input:focus + label,
.input-container input:not(:placeholder-shown) + label {
    transform: translateY(-2.5rem) scale(0.85);
    color: #e74c3c;
    background: white;
    padding: 0 0.5rem;
}

.input-container input:valid + label,
.input-container.focused label {
    transform: translateY(-2.5rem) scale(0.85);
    color: #e74c3c;
    background: white;
    padding: 0 0.5rem;
}

.input-container label {
    position: absolute;
    left: 3rem;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s ease;
    background: transparent;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: #7f8c8d;
    font-size: 1.1rem;
    z-index: 2;
    transition: color 0.3s ease;
}

.input-container input:focus ~ .input-icon {
    color: #e74c3c;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 2;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.password-toggle:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    transform: scale(1.1);
}

.password-toggle:active {
    transform: scale(0.95);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
}

.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #62809e;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    transition: all 0.3s ease;
}

.remember-me:hover {
    color: #e74c3c;
    transform: translateX(2px);
}

.remember-me input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #e0e6ed;
    border-radius: 4px;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.remember-me input:checked + .checkmark {
    background: #e74c3c;
    border-color: #e74c3c;
}

.remember-me input:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
}

.forgot-password {
    color: #e74c3c;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.forgot-password:hover {
    color: #c0392b;
    text-decoration: underline;
    transform: translateX(2px);
}

/* Login Button */
.login-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    min-height: 50px;
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.login-btn::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;
}

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

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(231, 76, 60, 0.3);
}

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

.login-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-icon {
    transition: transform 0.3s ease;
}

.login-btn:hover .btn-icon {
    transform: translateX(5px);
}

/* Login Footer */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e6ed;
}

.login-footer p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.support-link {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.support-link:hover {
    color: #c0392b;
    text-decoration: underline;
    transform: translateX(2px);
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 20px;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading-spinner p {
    color: #2c3e50;
    font-weight: 500;
}

/* Demo Info */
.demo-info {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    padding: 0;
    max-width: 350px;
    animation: slideInRight 0.8s ease 0.3s both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.demo-card {
    padding: 2rem;
}

.demo-card h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.demo-card h3 i {
    color: #3498db;
}

.demo-credentials {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #e74c3c;
}

.credential-item {
    margin-bottom: 0.8rem;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

.credential-item:last-child {
    margin-bottom: 0;
}

.credential-item strong {
    color: #2c3e50;
    display: inline-block;
    width: 80px;
}

.demo-note {
    color: #7f8c8d;
    font-size: 0.9rem;
    line-height: 1.5;
    font-style: italic;
    text-align: center;
}

#autoFillBtn {
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#autoFillBtn:hover {
    background: #c0392b !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

#autoFillBtn:active {
    transform: translateY(0);
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 1rem 1.5rem;
    z-index: 3000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast.success .toast-icon {
    color: #27ae60;
}

.toast.error .toast-icon {
    color: #e74c3c;
}

.toast.info .toast-icon {
    color: #3498db;
}

.toast-message {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .login-container {
        flex-direction: column;
        gap: 2rem;
    }
    
    .demo-info {
        max-width: 450px;
        width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        overflow-y: auto;
        min-height: 100vh;
        padding: 1rem 0;
    }
    
    .login-container {
        padding: 1rem;
        min-height: 100vh;
        justify-content: flex-start;
        padding-top: 2rem;
    }
    
    .login-card {
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    .login-header {
        padding: 1.5rem;
    }
    
    .login-logo {
        width: 60px;
        height: 60px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .login-form-container {
        padding: 2rem 1.5rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .demo-card {
        padding: 1.5rem;
    }
    
    .floating-shape {
        display: none;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
        max-width: none;
    }
    
    .toast.show {
        transform: translateY(0);
    }
    
    .login-btn,
    .password-toggle,
    .remember-me,
    .forgot-password,
    .support-link,
    #autoFillBtn {
        -webkit-tap-highlight-color: rgba(231, 76, 60, 0.2);
        touch-action: manipulation;
    }
}

@media (max-width: 480px) {
    .login-form-container {
        padding: 1.5rem 1rem;
    }
    
    .input-container input {
        padding: 0.8rem 0.8rem 0.8rem 2.5rem;
        font-size: 0.9rem;
    }
    
    .input-container label {
        left: 2.5rem;
        font-size: 0.9rem;
    }
    
    .input-icon {
        left: 0.8rem;
        font-size: 1rem;
    }
    
    .password-toggle {
        right: 0.8rem;
    }
    
    .login-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .demo-card {
        padding: 1rem;
    }
    
    .credential-item {
        font-size: 0.85rem;
    }
    
    .credential-item strong {
        width: 70px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .login-card {
        background: rgba(44, 62, 80, 0.95);
        color: #ecf0f1;
    }
    
    .login-form-container h2 {
        color: #ecf0f1;
    }
    
    .login-subtitle {
        color: #bdc3c7;
    }
    
    .input-container input {
        background: rgba(52, 73, 94, 0.8);
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .input-container input:focus {
        background: rgba(52, 73, 94, 0.9);
    }
    
    .demo-info {
        background: rgba(44, 62, 80, 0.95);
        color: #ecf0f1;
    }
    
    .demo-card h3 {
        color: #ecf0f1;
    }
    
    .demo-credentials {
        background: rgba(52, 73, 94, 0.8);
    }
    
    .credential-item strong {
        color: #ecf0f1;
    }
    
    .demo-note {
        color: #bdc3c7;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .login-card {
        border: 2px solid #2c3e50;
    }
    
    .input-container input {
        border-width: 3px;
    }
    
    .login-btn {
        border: 2px solid #c0392b;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-shape {
        animation: none;
    }
    
    .spinner {
        animation: none;
        border: 4px solid #e74c3c;
    }
    
    /* Ensure all interactive elements remain clickable */
    .login-btn,
    .password-toggle,
    .remember-me,
    .forgot-password,
    .support-link,
    #autoFillBtn {
        animation: none !important;
        transition: none !important;
    }}