:root[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --text-primary: #ffffff;
    --input-bg: #222;
    --input-border: #333;
    --button-bg: #333;
    --button-hover: #444;
    --button-active: #555;
    --error-text: #ff4444;
    --attempts-text: #888;
    --attempts-warning: #ff9944;
    --attempts-danger: #ff4444;
    --container-bg: rgba(0, 0, 0, 0.7);
}

:root[data-theme="light"] {
    --bg-primary: #ffffff;
    --text-primary: #333333;
    --input-bg: #f5f5f5;
    --input-border: #dddddd;
    --button-bg: #e0e0e0;
    --button-hover: #d0d0d0;
    --button-active: #c0c0c0;
    --error-text: #dc3545;
    --attempts-text: #666;
    --attempts-warning: #ffc107;
    --attempts-danger: #dc3545;
    --container-bg: rgba(255, 255, 255, 0.7); 
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.background-slideshow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.background-slideshow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Darkens the background images */
    z-index: 1;
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.background-image.active {
    opacity: 1;
}

.container {
    text-align: center;
    padding: 2rem;
    animation: fadeIn 0.5s ease-in;
    position: relative;
    z-index: 1;
    background-color: var(--container-bg);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

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

h1 {
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
    font-weight: 400;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 300px;
    margin: 0 auto;
}

input {
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--input-border);
}

.error-message {
    color: var(--error-text);
    font-size: 0.875rem;
    min-height: 1.25rem;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.error-message.visible {
    opacity: 1;
}

.attempts {
    color: var(--attempts-text);
    font-size: 0.875rem;
    margin-top: 1rem;
    opacity: 0.8;
    transition: color 0.3s;
}

.attempts.warning {
    color: var(--attempts-warning);
}

.attempts.danger {
    color: var(--attempts-danger);
}

.button {
    background-color: var(--button-bg);
    color: var(--text-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 0.5rem;
}

.button:hover {
    background-color: var(--button-hover);
}

.button:active {
    background-color: var(--button-active);
}

.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem;
    border-radius: 50%;
    border: 1px solid var(--input-border);
    background-color: var(--button-bg);
    color: var(--text-primary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 2;
}

.theme-toggle:hover {
    background-color: var(--button-hover);
}
