/* ======================================================================================== */
/* Home CSS                                                                                 */
/* Projekt: JS Demo Snake-Game                                                              */
/* Description: Stile für die Startseite des Snake-Spiels.                                  */
/* Autor: BRULSIM                                                                           */
/* Datum: 2026-06-20                                                                        */
/* ======================================================================================== */

/**********************/
/* main-Stile     */
/**********************/
main .main-limit {
    padding: 0 5%;
    max-width: 800px;
    margin: auto;
}

/**********************/
/* Formular-Stile     */
/**********************/

/* Der neue Auth-Switch */
.auth-toggle {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.toggle-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 10px;
    font-size: 1rem;
    cursor: pointer;
    color: #888;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    color: #2196F3;
    border-bottom: 2px solid #2196F3;
    font-weight: bold;
}

/* MAGIE: Felder ein-/ausblenden basierend auf der Formular-Klasse */
#loginForm.mode-login #group-username,
#loginForm.mode-login #group-passwordConfirm {
    display: none;
}

/* --- 3. FORMULAR SYSTEM & PASSPORT STRENGTH --- */
.form-container {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin: 20px 0;
    border: 1px solid #e2e8f0;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label { font-weight: bold; color: #4a5568; font-size: 0.95em; }

.form-group input {
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1em;
    background-color: #f8fafc;
    color: #334155;
    transition: 0.2s;
}

.form-group input:focus {
    background-color: #ffffff;
    border-color: #564ac1;
    box-shadow: 0 0 0 3px rgba(86, 74, 193, 0.15);
    outline: none;
}

/* NEU: Passwort-Stärke-Balken */
.password-strength-container {
    margin-top: 2px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.strength-bar {
    height: 6px;
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.guest-game {
    margin-top: 20px;
}

.strength-text { font-weight: bold; font-size: 0.8em; }

/* Dynamische Stärkeklassen (werden via JS gesteuert) */
.strength-bar.weak { width: 33%; background-color: #dc2626; }
.strength-text.weak { color: #dc2626; }

.strength-bar.medium { width: 66%; background-color: #f97316; }
.strength-text.medium { color: #f97316; }

.strength-bar.strong { width: 100%; background-color: #22c55e; }
.strength-text.strong { color: #22c55e; }

.storage-settings-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.form-group-inline { display: flex; align-items: center; gap: 10px; }
.form-group-inline input { width: 80px; padding: 8px; text-align: center; }
.form-group-checkbox { display: flex; align-items: center; gap: 8px; font-weight: bold; color: #4a5568; }

/* --- 4. LIVE VALIDATION STATES --- */
.error-message { display: none; color: #dc2626; font-size: 0.85em; font-weight: bold; margin-top: 4px; }
.form-group.has-error input { border-color: #dc2626; background-color: #fef2f2; }
.form-group.has-error .error-message { display: block; }
#btnSubmit:disabled { background-color: #cbd5e1; color: #94a3b8; cursor: not-allowed; }
