
:root {
    --primary: #00d084;
    --primary-dark: #02b76f;
    --dark-bg: #0d1117;
    --text-light: #c9d1d9;
    --text-muted: #9ca3af;
    --accent: #8b5cf6;
    --accent-dark: #7c3aed;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    color: white;
    display: grid;
    place-items: center;  /* Perfect center */
    min-height: 100vh;
    padding: 20px;
}

@media (max-width: 768px) {
    body {
        display: block;
        min-height: auto;
    }

    .login-container,
    .register-container {
        margin: 40px auto;
    }
}



/* Animated background - performance improved */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    /* Hardware acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 208, 132, 0.05);
    /* Simplified animation for better performance */
    animation: gentleFloat 20s infinite ease-in-out;
    /* Hardware acceleration */
    transform: translateZ(0);
    will-change: transform;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.circle-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    left: 80%;
    animation-delay: 7s;
}

.circle-3 {
    width: 150px;
    height: 150px;
    top: 80%;
    left: 20%;
    animation-delay: 14s;
}

/* Smoother animation with less movement */
@keyframes gentleFloat {
    0%, 100% { 
        transform: translateY(0) scale(1) translateZ(0);
    }
    50% { 
        transform: translateY(-10px) scale(1.02) translateZ(0);
    }
}

/* Main containers - fixed the loading issue */
.login-container,
.register-container {
    width: 100%;
    max-width: 400px;
    /* Remove problematic animations */
    opacity: 1;
    transform: none;
    animation: none;
}

.register-container {
    max-width: 500px;
}

.card {
    background: var(--card-bg);
    /* Remove backdrop-filter temporarily to test */
    /* backdrop-filter: blur(10px); */
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    /* Simple fade in */
    animation: cleanFadeIn 0.8s ease-out;
    /* Ensure no layout shift */
    transform: translateZ(0);
    will-change: opacity;
}

/* Clean fade in without transform issues */
@keyframes cleanFadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

.card-header {
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.app-logo {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 8px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.card-body {
    padding: 30px;
}

.btn {
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    width: 100%;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-google {
    background: #fff;
    color: #444;
    border: 1px solid var(--border);
}

.btn-google:hover {
    background: #f8fafc;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 10px rgba(0, 208, 132, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 7px 20px rgba(0, 208, 132, 0.4);
}

.form-control {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    width: 100%;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 208, 132, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
    display: block;
    font-size: 0.9rem;
}

/* Rest of your CSS remains the same */
.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider-text {
    padding: 0 15px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.toggle-links {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid var(--border);
}

.toggle-link {
    padding: 8px 16px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    font-size: 0.9rem;
}

.toggle-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 208, 132, 0.3);
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group .form-control {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 56%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

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

.forgot-link,
.login-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: right;
    display: block;
    margin-bottom: 20px;
}

.login-link {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.forgot-link:hover,
.login-link:hover {
    text-decoration: underline;
}

.credits {
    margin-top: 25px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Remove problematic animations */
.animated-form {
    /* animation: slideIn 0.4s ease forwards; */
    display: block;
}

/* Show form if there are errors */
.has-errors #loginForm {
    display: block !important;
}

.invalid-feedback {
    color: #f87171;
    font-size: 0.8rem;
    margin-top: 5px;
    display: block;
}

.is-invalid {
    border-color: #f87171 !important;
}

/* Register Specific Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-full {
    grid-column: 1 / -1;
}

.optional-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: normal;
}

/* Custom eye icon */
.eye-icon {
    display: inline-block;
    position: relative;
}

.eye-icon::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 50%;
    top: 2px;
    left: 2px;
}

.eye-icon::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    top: 6px;
    left: 6px;
}

.eye-slash .eye-icon::after {
    display: none;
}

.eye-slash .eye-icon::before {
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
    width: 14px;
    height: 14px;
    border-radius: 0;
    top: 1px;
    left: 1px;
}

/* Icon styles */
.icon {
    display: inline-block;
    width: 20px;
    text-align: center;
    margin-right: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .login-container,
    .register-container {
        max-width: 100%;
        padding: 10px;
    }
    
    .card-body {
        padding: 25px 20px;
    }
    
    .card-header {
        padding: 25px 20px 15px;
    }
    
    .app-logo {
        font-size: 1.7rem;
    }
    
    .btn, .form-control {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 480px) {
    .login-container {
        max-width: 100%;
    }
}