/* ========================================
   VARIABLES CSS GLOBALES
   ======================================== */
:root {
    --primary-color: #6be194;
    --primary-hover: #4c9f69;
    --error-color: #f11717;
    --bg-main: #fdefc2;
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #cccccc;
    --border-radius: 8px;
    --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 12px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --max-width: 350px;
}

/* ========================================
   RESET ET BASE
   ======================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: #f5e6a3;
    margin: 0;
    padding: 0;
    text-align: center;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ========================================
   TYPOGRAPHIE
   ======================================== */
h1 {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 2.2em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
    letter-spacing: -0.5px;
}

/* ========================================
   LIENS ET NAVIGATION
   ======================================== */
#logout {
    color: var(--error-color);
    text-decoration: underline;
    display: block;
    margin: 40px auto;
    text-align: center;
    width: fit-content;
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: var(--border-radius);
}

#logout:hover {
    background-color: rgba(241, 23, 23, 0.1);
    text-decoration: none;
    transform: translateY(-1px);
}

/* ========================================
   FORMULAIRES
   ======================================== */
form {
    max-width: var(--max-width);
    margin: 40px auto;
    padding: 30px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #4ecdc4);
}

form:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* ========================================
   CHAMPS DE SAISIE
   ======================================== */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: left;
    font-size: 0.95em;
}

input[type="text"], 
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1em;
    transition: var(--transition);
    background: #fafafa;
    outline: none;
}

input[type="text"]:focus, 
input[type="password"]:focus,
input[type="email"]:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(107, 225, 148, 0.1);
    transform: scale(1.01);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder {
    color: #999;
    font-style: italic;
}

/* ========================================
   BOUTONS
   ======================================== */
button {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

button:hover {
    background: linear-gradient(135deg, var(--primary-hover), #3d7a54);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 225, 148, 0.4);
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(107, 225, 148, 0.3);
}

/* Bouton secondaire */
.btn-secondary {
    background: linear-gradient(135deg, #e0e0e0, #bdbdbd);
    color: var(--text-primary);
    margin-top: 10px;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #bdbdbd, #9e9e9e);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ========================================
   ÉLÉMENTS DÉCORATIFS
   ======================================== */
.form-container {
    position: relative;
}

.form-container::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, var(--primary-color), transparent);
    border-radius: 50%;
    opacity: 0.1;
    z-index: -1;
}

.form-container::after {
    content: '';
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #4ecdc4, transparent);
    border-radius: 50%;
    opacity: 0.15;
    z-index: -1;
}

/* ========================================
   LOADER/SPINNER
   ======================================== */
.spinner {
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 600px) {
    :root {
        --max-width: 95%;
    }
    
    body {
        padding: 10px;
        background: var(--bg-main);
    }
    
    form {
        margin: 20px auto;
        padding: 20px;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-light);
    }
    
    h1 {
        font-size: 1.8em;
        margin-top: 20px;
        margin-bottom: 16px;
    }
    
    input[type="text"], 
    input[type="password"],
    input[type="email"] {
        padding: 14px 16px;
        font-size: 1.1em;
        margin-bottom: 18px;
    }
    
    button {
        padding: 16px;
        font-size: 1.2em;
    }
    
    #logout {
        margin: 30px auto;
        font-size: 1.1em;
    }
}

@media (max-width: 400px) {
    form {
        margin: 15px auto;
        padding: 16px;
    }
    
    h1 {
        font-size: 1.6em;
    }
    
    input[type="text"], 
    input[type="password"],
    input[type="email"] {
        padding: 12px 14px;
        font-size: 1em;
    }
    
    button {
        padding: 14px;
        font-size: 1.1em;
    }
}

/* ========================================
   ANIMATIONS ET TRANSITIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ========================================
   MODE SOMBRE (OPTIONNEL)
   ======================================== */
@media (prefers-color-scheme: dark) {
    
    
    input[type="text"], 
    input[type="password"],
    input[type="email"] {
        background: #ffffff;
        color: black;
        border-color: var(--border-color);
    }
    
    input[type="text"]:focus, 
    input[type="password"]:focus,
    input[type="email"]:focus {
        background: #e8e8e8;
    }
}

/* ========================================
   UTILITAIRES
   ======================================== */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none; }
.visible { display: block; }


#score-equipe {
    text-align: center;
    color: #dc2626;
    font-size: 1.8em;
    font-weight: 800;
    margin: 30px auto;
    padding: 20px 25px;
    
    /* Fond dégradé cirque */
    background: linear-gradient(45deg, 
        #fef3c7 0%, 
        #fed7aa 25%, 
        #fef3c7 50%, 
        #fed7aa 75%, 
        #fef3c7 100%);
    background-size: 20px 20px;
    
    /* Bordure festive à rayures */
    border: 4px solid;
    border-image: repeating-linear-gradient(
        45deg,
        #dc2626 0px,
        #dc2626 8px,
        #ffffff 8px,
        #ffffff 16px,
        #dc2626 16px,
        #dc2626 24px
    ) 1;
    border-radius: 10px;
    
    /* Ombre colorée */
    box-shadow: 
        0 8px 25px rgba(220, 38, 38, 0.3),
        0 3px 10px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    
    /* Effet de texte cirque */
    text-shadow: 
        3px 3px 0 #ffffff,
        -1px -1px 0 #ffffff,
        1px -1px 0 #ffffff,
        -1px 1px 0 #ffffff,
        4px 4px 8px rgba(220, 38, 38, 0.4);
    
    /* Transitions */
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: default;
    
    /* Taille mobile optimisée */
    max-width: 280px;
    min-width: 200px;
    
    /* Police festive */
    letter-spacing: 1px;
    text-transform: uppercase;
    
    /* Position relative pour les étoiles */
    position: relative;
    overflow: hidden;
}

/* Étoiles décoratives */
#score-equipe::before,
#score-equipe::after {
    content: "★";
    position: absolute;
    color: #f59e0b;
    font-size: 1.2em;
    animation: sparkle 2s infinite alternate;
}

#score-equipe::before {
    top: 8px;
    left: 15px;
    animation-delay: 0s;
}

#score-equipe::after {
    top: 8px;
    right: 15px;
    animation-delay: 1s;
}

/* Effet au survol/touch */
#score-equipe:hover,
#score-equipe:active {
    transform: translateY(-2px) scale(1.05) rotate(1deg);
    box-shadow: 
        0 12px 35px rgba(220, 38, 38, 0.4),
        0 5px 15px rgba(0, 0, 0, 0.25),
        inset 0 3px 0 rgba(255, 255, 255, 0.4);
    
    background: linear-gradient(45deg, 
        #fde68a 0%, 
        #fdba74 25%, 
        #fde68a 50%, 
        #fdba74 75%, 
        #fde68a 100%);
}

/* Animation des étoiles */
@keyframes sparkle {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.3) rotate(360deg);
        opacity: 1;
    }
}

/* Animation d'apparition festive */
@keyframes scoreAppear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8) rotate(-10deg);
    }
    50% {
        transform: translateY(-5px) scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

#score-equipe {
    animation: scoreAppear 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}