html {
    background-color: var(--bg-color);
    --overlay-bg: rgba(255, 255, 255, 0.4);
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: transparent;
    color: var(--text-main);

    /* Background Image Support */
    background-image: url('../img/backgrounds/bg_light.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    position: relative;
    z-index: 0;
    /* Create stacking context for ::before overlay */
}

/* Overlay for readability */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Reduced opacity to ensure background visibility */
    background: var(--overlay-bg);
    backdrop-filter: blur(3px);
    z-index: -1;
    pointer-events: none;
}

.login-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 30px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card h1 {
    color: var(--accent-color);
    margin-bottom: 30px;
    font-size: 2rem;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#auth-form input {
    padding: 15px;
    border-radius: 12px;
    border: 2px solid rgba(0, 0, 0, 0.05);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s;
}

#auth-form input:focus {
    outline: none;
    border-color: var(--accent-color);
}

#auth-submit-btn {
    padding: 15px;
    border-radius: 12px;
    border: none;
    background: var(--accent-color);
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
}

#auth-submit-btn:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.back-link {
    display: block;
    margin-top: 20px;
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--accent-color);
}

#auth-switch a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 100;
}

.theme-toggle-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

:root.dark-mode .theme-toggle-btn {
    border-color: rgba(255, 255, 255, 0.1);
}