/* --- RESET ET BASE --- */
* {
    box-sizing: border-box;
    user-select: none; /* Empêche la sélection de texte sur mobile */
    -webkit-tap-highlight-color: transparent; /* Supprime le flash bleu sur Android */
}

body {
    background-color: #121212;
    color: #ffffff;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    text-align: center;
}

/* --- PARTIE TÉLÉCOMMANDE --- */

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

h1 {
    margin: 0;
    font-size: 24px;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* La petite LED d'état */
.status-indicator {
    width: 10px;
    height: 10px;
    background-color: #333;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    transition: background-color 0.2s;
}

.status-indicator.active {
    background-color: #00ff88;
    box-shadow: 0 0 15px #00ff88;
}

/* Texte "Prêt" ou "Ouverture..." */
#feedback-text {
    height: 20px;
    color: #888;
    font-size: 14px;
    margin-top: -10px;
    font-weight: 500;
}

.button-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Style des gros boutons */
.big-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 180px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.big-btn:active {
    transform: scale(0.96);
    filter: brightness(0.8);
}

.big-btn .icon {
    font-size: 50px;
    margin-bottom: 10px;
}

.big-btn .label {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* COULEURS DES BOUTONS */
.btn.portail {
    background: linear-gradient(135deg, #0288d1, #01579b); /* Bleu */
}

.btn.garage {
    background: linear-gradient(135deg, #43a047, #2e7d32); /* Vert */
}

/* Lien de déconnexion discret */
.logout-link {
    color: #666;
    text-decoration: none;
    font-size: 12px;
    margin-top: -20px;
    border: 1px solid #333;
    padding: 5px 15px;
    border-radius: 15px;
    align-self: center;
    transition: all 0.2s;
}

.logout-link:hover {
    border-color: #666;
    color: #888;
}

/* --- PARTIE LOGIN (Page de connexion) --- */

.login-box {
    background: #1e1e1e;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.login-box p {
    color: #aaa;
    margin: 0;
    font-size: 14px;
}

/* Champ de saisie du code */
.code-input {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #333;
    background: #2a2a2a;
    color: white;
    font-size: 20px;
    text-align: center;
    letter-spacing: 3px;
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.2s;
}

.code-input:focus {
    border-color: #00ff88;
    background: #333;
}

.code-input::placeholder {
    color: #555;
    letter-spacing: 1px;
}

/* Bouton VALIDER */
.btn-login {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    border: none;
    background: #00ff88;
    color: #121212;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.2s;
}

.btn-login:active {
    background: #00cc6a;
    transform: scale(0.98);
}

.error-msg {
    color: #ff4444 !important;
    font-weight: bold;
    background: rgba(255, 68, 68, 0.1);
    padding: 10px;
    border-radius: 5px;
}