/* Rétablissement de certains comportements par défaut pour ces éléments */
#container,
#logo,
#msg,
#form,
#motdepasseoublie,
#emailpourrappelmotdepasse,
#sendit,
#premiereconnexion {
    position: unset;
    transform: unset;
    color: unset;
    background: unset;
    width: unset;
    margin: unset;
    border-radius: unset;
    box-shadow: unset;
}

@media screen and (max-width: 899px) {
    #container,
    #logo,
    #msg,
    #form,
    #motdepasseoublie,
    #emailpourrappelmotdepasse,
    #sendit,
    #premiereconnexion {
        position: unset;
        transform: unset;
        color: unset;
        background: unset;
        width: unset;
        margin: unset;
        border-radius: unset;
        box-shadow: unset;
    }
}

/* Structure générale en Flex */
.page-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Zone de connexion défilable si nécessaire */
.login-container {
    background: var(--primary-color);
    z-index: 10;
    width: 33.33%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.info-container {
    background: url('/images/motifs/fond.svg') no-repeat;
    background-size: cover;
    background-position: center;
    height: 100dvh;
    width: 66.66%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: fixed;
    right: 0;
    overflow: hidden;
}

/* Style pour le H1 dans le container d'information */
.info-container h1 {
    color: var(--light-color);
    position: relative;
    z-index: 2;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

/* Adaptation mobile : sur mobile, seule la partie connexion est affichée et occupe toute la page */
@media screen and (max-width: 768px) {
    .page-wrapper {
        flex-direction: column;
        min-height: 100vh;
    }

    .login-container {
        width: 100%;
        min-height: 100vh;
        /* Remplit toute la hauteur */
        padding: 0;
    }

    .info-container {
        display: none;
    }
}

/* Logo et tagline */
.logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-img {
    width: 300px;
    max-width: 70%;
}

.tagline {
    font-size: var(--font-size-title);
    font-weight: 700;
    margin: 1.125rem auto;
    font-style: italic;
}

/* Formulaire de connexion */
.form-container {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-form {
    width: 100%;
}

/* Titre du formulaire centré */
.form-title {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    font-size: 1.25rem;
    font-weight: 600;
}

/* Labels du formulaire */
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-weight: 500;
    font-size: 0.875rem;
}

/* Centrage des champs du formulaire */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-container .input-login {
    width: 100%;
    padding: 0.875rem;
    border-radius: var(--border-radius-small);
    background: var(--tertiary-color);
    color: var(--dark-color);
    border: 2px solid transparent;
    font-size: var(--font-size-text);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-container .input-login:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(var(--secondary-color-rgb), 0.1);
}

/* Boutons */
.button {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: var(--font-size-normal);
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}

.button-primary {
    background: var(--primary-color);
    color: var(--light-color);
}

.button-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.button-secondary {
    background: var(--secondary-color);
    color: var(--light-color);
}

.button-secondary:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

/* Section d'aide */
.help-section {
    margin-top: 2rem;
    border-top: 1px solid var(--tertiary-color);
    padding-top: 1.5rem;
}

.help-item {
    margin-bottom: 0.75rem;
}

.help-trigger {
    width: 100%;
    background: transparent;
    border: 1px solid var(--tertiary-color);
    border-radius: var(--border-radius-small);
    padding: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--dark-color);
    transition: all 0.3s ease;
    text-align: left;
}

.help-trigger:hover {
    background: var(--tertiary-color);
    border-color: var(--secondary-color);
}

.help-trigger.active {
    background: var(--tertiary-color);
    border-color: var(--secondary-color);
}

.help-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.chevron-icon {
    width: 16px;
    height: 16px;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.help-content {
    display: none;
    margin-top: 0.5rem;
    animation: slideDown 0.3s ease-out;
}

.help-content[style*="display: block"] {
    display: block !important;
}

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

.help-card {
    background: var(--light-color);
    border: 1px solid var(--tertiary-color);
    border-radius: var(--border-radius-small);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.help-card-header {
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--light-color);
}

.help-card-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.help-card-header p {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

.help-card-body {
    padding: 1.25rem;
    background: var(--light-color);
}

/* Texte d'information dans les cartes */
.info-text {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(52, 152, 219, 0.05);
    border-radius: var(--border-radius-small);
    border-left: 3px solid var(--secondary-color);
}

.info-text p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--dark-color);
    line-height: 1.5;
}

/* Guide par étapes */
.steps-guide {
    margin-bottom: 1.5rem;
}

.step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    align-items: flex-start;
}

.step:last-child {
    margin-bottom: 0;
}

.step-number {
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: var(--light-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark-color);
}

.step-content p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--dark-color);
    opacity: 0.8;
    line-height: 1.4;
}

/* Note d'information */
.help-note {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: rgba(52, 152, 219, 0.1);
    padding: 1rem;
    border-radius: var(--border-radius-small);
    border-left: 3px solid var(--secondary-color);
    margin-top: 1rem;
}

.note-icon {
    width: 18px;
    height: 18px;
    color: var(--secondary-color);
    flex-shrink: 0;
    margin-top: 1px;
}

.help-note span {
    font-size: 0.8rem;
    color: var(--dark-color);
    line-height: 1.4;
}

/* Styles spécifiques pour les éléments dans les cartes d'aide */
.help-card .form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.help-card .form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-weight: 500;
    font-size: 0.875rem;
}

.help-card .input-login {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--border-radius-small);
    background: #ffffff;
    color: var(--dark-color);
    border: 2px solid #e0e0e0;
    font-size: var(--font-size-text);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.help-card .input-login:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background: #ffffff;
}

.help-card .input-login::placeholder {
    color: #999999;
    opacity: 1;
}

/* Actions du formulaire */
.form-actions {
    margin-top: 1rem;
}

/* Messages de réponse */
.response-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--border-radius-small);
    font-size: 0.875rem;
    font-weight: 500;
    display: none;
}

.response-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.response-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Messages d'erreur généraux */
#msg {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.875rem;
    border-radius: var(--border-radius-small);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    text-align: center;
}

/* Responsive pour mobile */
@media screen and (max-width: 768px) {
    .form-container {
        padding: 1rem;
        margin: 1rem;
        border-radius: var(--border-radius);
    }
    
    .help-card-header, .help-card-body {
        padding: 1rem;
    }
    
    .step {
        gap: 0.75rem;
    }
    
    .step-number {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
}