/* Variables CSS pour cohérence */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-light: #ffffff;
    --text-dark: #2d3748;
    --bg-glass: rgba(0, 0, 0, 0.7);
    --shadow-soft: 0 20px 40px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 30px 60px rgba(0, 0, 0, 0.15);
    --border-radius: 20px;
    --container-padding: 40px;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    overflow-x: hidden;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Gestion de l'image de fond splash */
body.body_splash {
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(240, 147, 251, 0.2) 0%, transparent 50%);
    animation: gradientShift 15s ease-in-out infinite;
    z-index: -1;
}

body.body_splash::before {
    display: none;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Conteneur principal unifié */
.main-container,
.login-container,



.msgbox-container,
.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}



/* Cartes unifiées avec même structure */
.login-card,
.msgbox-card,
.error-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    padding: var(--container-padding);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-soft);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
    text-align: center;
}

.login-card:hover,
.msgbox-card:hover,
.error-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* Réduction de la largeur maximale pour la carte de login */
.login-card {
    max-width: 420px;
}

/* Headers uniformisés */
.card-header,
.login-title,
.msgbox-card h3,
.error-title {
    color: var(--text-light);
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 20px 0;
    text-align: center;
}

.card-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%) !important;
    color: var(--text-light) !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    text-align: center !important;
    padding: 20px 30px !important;
    border-radius: 20px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
}

.card-header h3 {
    margin: 0;
}

.login-title {
    font-size: 28px;
    margin-bottom: 8px;
}

.card-body {
    margin-bottom: 20px;
}

/* Descriptions uniformisées */
.form-description,
.login-subtitle,
.msgbox-card p,
.error-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
    text-align: center;
}

.form-description {
    font-size: 14px;
    line-height: 1.5;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
    font-weight: 400;
}

/* Groupes d'input uniformisés */
.input-group,
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group {
    display: flex;
    justify-content: center;
}

/* Style de l'icône à gauche */
.input-group-text {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-right: none;
    border-radius: 12px 0 0 12px;
    color: var(--text-light);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
}

/* Champs de saisie */
.form-control,
.form-input {
    width: 100%;
    max-width: 320px;
    height: 48px; /* Hauteur fixe */
    line-height: 48px; /* Centrage vertical */
    padding: 0 20px 0 50px; /* Padding vertical à 0 */
    border-radius: 16px;
    font-weight: 500;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-light);
    transition: all 0.3s ease;
    box-sizing: border-box;
}


/* Champ avec icône à gauche */
.form-control {
    border-left: none;
    border-radius: 0 12px 12px 0;
    padding: 12px 15px;
    flex: 1;
}

/* Champ autonome avec icône absolue */
.form-input {
    width: 100%;
    max-width: 320px;
    padding: 12px 20px 12px 50px;
    border-radius: 16px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    line-height: 1.5;
    display: flex;
    align-items: center;
}

/* Placeholder */
.form-control::placeholder,
.form-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

/* Focus */
.form-control:focus,
.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(240, 147, 251, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.form-input:focus {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* Focus sur l'icône */
.input-group-text:focus-within,
.form-control:focus + .input-group-text {
    border-color: var(--accent-color);
}

/* Icône absolue dans le champ */
.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 1;
}

.form-input:focus + .input-icon {
    color: var(--text-light);
    transform: translateY(-50%) scale(1.1);
}


/* Boutons uniformisés */
.btn-modern,
.login-button,
.error-button {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    border: none;
    border-radius: 16px;
    color: var(--text-light);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.btn-modern {
    padding: 14px 30px;
    width: 100%;
    margin-top: 10px;
}

.login-button {
    padding: 16px;
    width: 100%;
    max-width: 320px;
}

.error-button {
    padding: 12px 30px;
    display: inline-block;
}

.btn-modern::before,
.login-button::before,
.error-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-modern:hover::before,
.login-button:hover::before,
.error-button:hover::before {
    left: 100%;
}

.btn-modern:hover,
.login-button:hover,
.error-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.4);
}

.btn-modern:active,
.login-button:active,
.error-button:active {
    transform: translateY(0);
}

.btn-modern:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Footers uniformisés */
.card-footer,
.forgot-password {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.forgot-password {
    margin-top: 24px;
    border-top: none;
    padding-top: 0;
}

.card-footer {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%) !important;
    text-align: center !important;
    padding: 20px 30px !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
}

.card-footer a {
    color: var(--text-light) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    transition: color 0.3s ease !important;
}

.card-footer a:hover {
    color: var(--accent-color) !important;
}

.forgot-password a {
    font-weight: 500 !important;
    position: relative !important;
}

.forgot-password a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background: var(--accent-color) !important;
    transition: all 0.3s ease !important;
    transform: translateX(-50%);
}

.card-footer a:hover,
.forgot-password a:hover {
    color: var(--accent-color) !important;
}

.forgot-password a:hover::after {
    width: 100% !important;
}

/* Icônes uniformisées */
.msgbox-icon,
.error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.msgbox-icon.success {
    color: #4ade80;
}

.msgbox-icon.warning {
    color: #fbbf24;
}

.msgbox-icon.error,
.error-icon {
    color: #ff6b6b;
}

/* Section logo uniformisée */
.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo-section img {
    max-height: 80px;
    max-width: 200px;
    filter: brightness(0) invert(1);
    margin-bottom: 20px;
}

.version-info {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 400;
    font-style: italic;
}

.button-group {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Animation d'apparition */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation de chargement */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive uniformisé */
@media (max-width: 480px) {
    .main-container,
    .login-container,
    .msgbox-container,
    .error-container {
        padding: 15px;
    }
    
    .login-card,
    .msgbox-card,
    .error-card {
        padding: 30px 20px;
        margin: 0;
        border-radius: var(--border-radius);
        max-width: 100%;
    }
    
    .card-header,
    .login-title,
    .msgbox-card h3,
    .error-title {
        font-size: 20px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .form-input,
    .login-button {
        max-width: 100%;
    }
    
    .form-input {
        padding: 14px 18px 14px 45px;
	line-height: 1.5;
    	padding: 12px 20px 12px 50px; /* Réduit le padding vertical */
   	 display: flex;
    	align-items: center;

    }
    
    .error-icon,
    .msgbox-icon {
        font-size: 36px;
    }
}



.clignote {
    animation: clignote-animation 1s infinite;
}

@keyframes clignote-animation {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}


.webauthn-button {
    background-color: #444;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.webauthn-button:hover {
    background-color: #666;
}

