/* --- Sélecteur de langue --- */
.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-size: 14px;
    z-index: 100;
}

[dir="rtl"] .language-selector {
    right: auto;
    left: 20px;
}

.language-selector a {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: color 0.3s;
}

.language-selector a.active {
    color: #3b82f6;
    font-weight: 700;
}

.language-selector a:hover:not(.active) {
    color: #1e293b;
}

.language-selector span {
    margin: 0 8px;
    color: #e2e8f0;
}

/* Réinitialisation de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Corps de page - Gris ultra-clair pour faire ressortir la carte blanche */
body {
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Conteneur de connexion */
.login-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

/* Carte du formulaire */
.login-card {
    background-color: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 480px;
}

/* En-tête interne avec plus d'espacement pour la séparation */
.hospital-header-inner {
    text-align: center;
    margin-bottom: 35px;
    padding-bottom: 30px;
    border-bottom: 1px solid #f0f0f0;
}

.hcm-logo-small {
    width: 85px;
    height: auto;
    margin-bottom: 15px;
}

.hospital-header-inner h2 {
    color: #1a252f;
    font-size: 22px;
    font-weight: 700;
}

.hospital-header-inner .subtitle {
    color: #64748b;
    font-size: 14px;
    margin-top: 8px;
}

.login-card h3 {
    color: #1a252f;
    margin-bottom: 15px;
    text-align: center;
    font-size: 18px;
}

.instruction-text {
    font-size: 14px;
    color: #475569;
    text-align: center;
    margin-bottom: 30px;
}

/* Conteneur pour l'icône dans l'input */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input {
    width: 100%;
    padding-right: 45px; /* Espace pour l'icône à droite */
}

[dir="rtl"] .input-with-icon input {
    padding-right: 16px;
    padding-left: 45px;
}

/* Infobulle d'aide (i) positionnée à droite dans l'input */
.info-tooltip-wrapper {
    position: absolute;
    right: 15px;
    display: flex;
    align-items: center;
    cursor: help;
}

[dir="rtl"] .info-tooltip-wrapper {
    right: auto;
    left: 15px;
}

.info-icon {
    width: 22px;
    height: 22px;
    color: #94a3b8; /* Couleur plus discrète dans l'input */
    transition: color 0.2s;
}

.info-tooltip-wrapper:hover .info-icon {
    color: #3b82f6;
}

.tooltip-text {
    visibility: hidden;
    width: 260px;
    background-color: #1e293b;
    color: #fff;
    text-align: center;
    border-radius: 10px;
    padding: 14px;
    position: absolute;
    z-index: 10;
    bottom: 145%; /* Affiche au-dessus */
    right: -10px;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

[dir="rtl"] .tooltip-text {
    right: auto;
    left: -10px;
}

/* Triangle de l'infobulle */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 20px;
    border-width: 6px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

[dir="rtl"] .tooltip-text::after {
    right: auto;
    left: 20px;
}

.info-tooltip-wrapper:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateY(-5px);
}

/* Champs de saisie */
.input-group {
    margin-bottom: 22px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155; /* Gris sombre adouci pour moins d'agressivité */
    margin-bottom: 10px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.25s ease;
    color: #1e293b;
}

/* État de focus professionnel */
.input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background-color: #fff;
}

/* Bouton plus humain et dynamique */
.btn-submit {
    width: 100%;
    padding: 16px;
    background-color: #0056b3;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-submit:hover {
    background-color: #004494;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.2);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Sécurité renforcée */
.security-badge {
    text-align: center;
    margin-top: 35px;
    font-size: 13px;
    color: #065f46; /* Vert émeraude sombre institutionnel */
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background-color: #f0fdf4;
    padding: 10px;
    border-radius: 8px;
}

.security-icon {
    width: 16px;
    height: 16px;
}

/* FOOTER */
.hospital-footer {
    background-color: #333333;
    color: #ffffff;
    padding: 50px 20px 30px 20px;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.footer-col h4 {
    color: #3498db;
    margin-bottom: 25px;
    font-size: 18px;
    text-transform: uppercase;
}

.contact-list {
    list-style: none;
}

.contact-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.4;
    color: #cccccc;
}

.icon {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    flex-shrink: 0;
    color: #ffffff;
}

.branding-col {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo-white {
    width: 150px;
    height: auto;
    filter: brightness(0) invert(1);
    margin-top: 10px;
}

.footer-bottom {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #444;
    font-size: 12px;
    color: #888;
}

.alert-error {
    background-color: #fee2e2;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: center;
    border: 1px solid #fecaca;
    font-size: 14px;
    font-weight: 600;
}