/* Variables CSS pour les couleurs */
:root {
    --te-primary: #DC3545; /* Rouge */
    --te-secondary: #FF6B35;
    --te-light-red: #FFF5F5; /* Rouge très clair */
    --te-dark-red: #B02A37; /* Rouge foncé */
    --te-gray: #6C757D;
    --te-light-gray: #F8F9FA;
}

/* Style général avec Montserrat */
body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
    color: #333;
    font-weight: 400;
}

/* Titles avec Montserrat */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
}

/* Couleurs Bootstrap personnalisées */
.btn-primary {
    background-color: var(--te-primary);
    border-color: var(--te-primary);
    color: white;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: white;
    border-color: var(--te-primary);
    color: var(--te-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-outline-primary {
    color: white;
    border-color: var(--te-primary);
    background-color: var(--te-primary);
    transition: all 0.3s ease;
}

.btn-outline-primary .fw-semibold {
    color: white;
}

.btn-outline-primary small,
.btn-outline-primary .email-description {
    color: rgba(255, 255, 255, 0.9);
}

/* Forcer le texte blanc pour tous les petits textes dans les boutons */
.btn-outline-primary .text-muted,
.connection-option .text-muted {
    color: rgba(255, 255, 255, 0.9) !important;
}

.btn-outline-primary .bi {
    color: white;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary.active,
.btn-check:checked + .btn-outline-primary {
    background-color: var(--te-primary);
    border-color: var(--te-primary);
    color: white;
}

/* Forcer le texte blanc pour l'état checked aussi */
.btn-check:checked + .btn-outline-primary .fw-semibold,
.btn-check:checked + .btn-outline-primary .text-muted,
.btn-check:checked + .btn-outline-primary .email-description,
.btn-check:checked + .btn-outline-primary small {
    color: white !important;
}

/* Hover depuis l'état checked */
.btn-check:checked + .btn-outline-primary:hover {
    background-color: white;
    border-color: var(--te-primary);
    color: var(--te-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

/* Hover pour tous les boutons outline-primary */
.btn-outline-primary:hover {
    background-color: white !important;
    border-color: var(--te-primary) !important;
    color: var(--te-primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

/* Hover pour les titres et sous-titres des boutons */
.btn-outline-primary:hover .fw-semibold {
    color: var(--te-primary) !important;
}

.btn-outline-primary:hover .email-description,
.btn-outline-primary:hover small,
.btn-outline-primary:hover .text-muted {
    color: var(--te-primary) !important;
}

/* Hover depuis l'état checked */
.btn-check:checked + .btn-outline-primary:hover .fw-semibold,
.btn-check:checked + .btn-outline-primary:hover .email-description,
.btn-check:checked + .btn-outline-primary:hover small,
.btn-check:checked + .btn-outline-primary:hover .text-muted {
    color: var(--te-primary) !important;
}

.text-primary {
    color: var(--te-primary) !important;
}

/* Header */
header {
    border-bottom: 3px solid var(--te-primary);
}

.logo-main {
    max-height: 60px;
    width: auto;
}

.logo-secondary {
    max-height: 50px;
    width: auto;
}

/* Sélecteur de langue dans la zone d'information */
.language-selector {
    position: relative;
    flex-shrink: 0;
}

.language-selector .btn {
    border-color: var(--te-gray);
    color: var(--te-gray);
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 120px;
    background-color: white;
}

.language-selector .btn:hover,
.language-selector .btn:focus {
    border-color: var(--te-primary);
    color: var(--te-primary);
    background-color: rgba(220, 53, 69, 0.1);
}

/* État actif/ouvert du dropdown */
.language-selector .btn:active,
.language-selector .btn.show {
    border-color: var(--te-primary);
    color: var(--te-primary);
    background-color: rgba(220, 53, 69, 0.1);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.language-selector .dropdown-menu {
    border-radius: 12px;
    border: 2px solid var(--te-primary);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.15);
    padding: 0.5rem 0;
    min-width: 160px;
    right: 0;
    left: auto;
}

.language-selector .dropdown-item {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    border-radius: 0;
    color: #212529;
    text-decoration: none;
}

.language-selector .dropdown-item:hover,
.language-selector .dropdown-item:focus {
    background-color: var(--te-primary);
    color: white !important;
}

.language-selector .dropdown-item:active {
    background-color: var(--te-dark-red);
    color: white !important;
}

/* Style spécifique pour les emojis dans le dropdown */
.language-selector .dropdown-item .flag-emoji {
    opacity: 1;
}

.language-selector .dropdown-item:hover .flag-emoji,
.language-selector .dropdown-item:focus .flag-emoji {
    opacity: 1;
}

/* Styles pour les drapeaux */
.flag-emoji {
    font-size: 1.1em;
    margin-right: 0.5rem;
    display: inline-block;
    vertical-align: middle;
}

/* Styles spécifiques pour le bouton principal du sélecteur de langue */
.language-selector .btn .flag-emoji,
.language-selector .btn span {
    color: inherit;
}

.language-selector .btn:hover .flag-emoji,
.language-selector .btn:hover span,
.language-selector .btn:focus .flag-emoji,
.language-selector .btn:focus span {
    color: var(--te-primary);
}

.language-selector .btn:active .flag-emoji,
.language-selector .btn:active span,
.language-selector .btn.show .flag-emoji,
.language-selector .btn.show span {
    color: var(--te-primary);
}

/* Ajustements pour la zone d'information avec sélecteur */
.introduction-text {
    text-align: center;
}

@media (max-width: 576px) {
    .introduction-text {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .language-selector {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .d-flex.justify-content-between.align-items-start {
        flex-direction: column;
        align-items: center !important;
    }
}

/* Responsive pour le sélecteur de langue */
@media (max-width: 576px) {
    .language-selector .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .language-selector .dropdown-menu {
        min-width: 180px;
        font-size: 0.85rem;
    }
}

/* Card principal */
.card {
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.card-body {
    border-radius: 15px;
}

/* Texte d'introduction */
.introduction-text {
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}

.introduction-text p {
    margin-bottom: 0.5rem;
}

.introduction-text .small {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Options de connexion */
.connection-option .btn {
    border-radius: 12px;
    border-width: 2px;
    text-align: left;
    transition: all 0.3s ease;
}

.connection-option .btn:hover {
    transform: translateX(5px);
}

/* Style pour le texte descriptif du bouton email */
.email-description {
    color: rgba(255, 255, 255, 0.9) !important; /* Blanc transparent par défaut */
    transition: color 0.3s ease;
}

/* Assurer que les icônes changent aussi de couleur au hover */
.btn-outline-primary:hover .bi {
    color: var(--te-primary) !important;
}

/* Liste des entités */
.entity-list {
    margin-top: 1rem;
    padding: 1.5rem;
    background-color: white;
    border-radius: 12px;
    border: 2px solid var(--te-primary);
    animation: slideDown 0.3s ease-out;
    position: relative;
    width: 100%;
    color: var(--te-primary); /* Couleur par défaut pour tous les textes */
}

.entity-list * {
    color: var(--te-primary);
}

.entity-list label,
.entity-list .form-label,
.entity-list .fw-semibold {
    color: #000 !important;
    font-weight: 600;
}

.entity-list .text-muted {
    color: var(--te-primary) !important;
}

.entity-list .btn-close-custom {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--te-primary) !important;
    opacity: 1;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    margin: 0;
}

.entity-list .btn-close-custom:hover {
    opacity: 0.8;
    color: var(--te-primary) !important;
}

.entity-list .btn-close-custom:active {
    opacity: 0.9;
}

.entity-list .form-select {
    border-radius: 8px;
    border: 2px solid var(--te-primary);
    font-size: 0.95rem;
    padding: 0.75rem;
    background-color: white;
    color: #000;
}

.entity-list .form-select option {
    color: #000;
    background-color: white;
}

.entity-list .form-select:focus {
    border-color: var(--te-primary);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    background-color: white;
    color: #000;
}

.entity-list .btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.75rem;
    background-color: var(--te-primary);
    border-color: var(--te-primary);
    color: white;
}

.entity-list .btn .bi {
    color: white !important;
}

.entity-list .btn:hover {
    background-color: var(--te-dark-red);
    border-color: var(--te-dark-red);
    color: white;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 300px;
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
        max-height: 300px;
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
}

/* Bouton principal */
#connectBtn {
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

#connectBtn:hover {
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

/* Footer */
footer {
    border-top: 1px solid #dee2e6;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.6s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .logo-main,
    .logo-secondary {
        max-height: 40px;
    }
    
    .card-body {
        padding: 2rem !important;
    }
    
    .connection-option .btn {
        font-size: 0.9rem;
    }
}

/* États de focus pour l'accessibilité */
.btn:focus,
.btn-check:focus + .btn {
    outline: 2px solid var(--te-secondary);
    outline-offset: 2px;
}

/* Style pour les icônes */
.bi {
    color: var(--te-primary);
}

.btn-outline-secondary .bi {
    color: var(--te-gray);
}

.btn-check:checked + .btn .bi {
    color: white;
}

/* Effet de survol pour les liens d'aide */
a:hover {
    color: var(--te-primary) !important;
    transition: color 0.3s ease;
}

/* Style pour les messages d'état (pour usage futur) */
.alert-primary {
    background-color: var(--te-light-blue);
    border-color: var(--te-primary);
    color: var(--te-dark-blue);
}

/* Loading spinner (pour usage futur) */
.spinner-border-primary {
    color: var(--te-primary);
}

/* Style pour les tooltips (Bootstrap) */
.tooltip-inner {
    background-color: var(--te-dark-blue);
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--te-dark-blue);
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: var(--te-dark-blue);
}

/* Amélioration de l'accessibilité */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Style pour la modal d'aide */
.modal-content {
    border-radius: 15px;
    border: 2px solid var(--te-primary);
    box-shadow: 0 10px 30px rgba(0, 102, 204, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--te-light-blue) 0%, #ffffff 100%);
    border-radius: 13px 13px 0 0;
}

.modal-title {
    color: var(--te-primary);
}

.modal-body {
    background-color: #fafbfc;
}

.modal-footer {
    background-color: #fafbfc;
    border-radius: 0 0 13px 13px;
}

.modal-footer .btn-primary {
    background-color: var(--te-primary);
    border-color: var(--te-primary);
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.75rem 2rem;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
    transition: all 0.2s ease;
    border: none;
    letter-spacing: 0.025em;
}

.modal-footer .btn-primary i {
    color: #ffffff !important;
}

.modal-footer .btn-primary:hover {
    background-color: var(--te-dark-red);
    border-color: var(--te-dark-red);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
    color: #ffffff !important;
}

.modal-footer .btn-primary:hover i {
    color: #ffffff !important;
}

.modal-footer .btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.5);
}

.modal-footer .btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
    outline: none;
}
