/* Styles spécifiques pour le formulaire de demande de création de compte */

.login-choice .form-label {
    font-weight: 600;
    color: var(--color-base-black);
    margin-bottom: 0.5rem;
}

.login-choice .form-control {
    border: 1px solid var(--color-neutrals-600);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-choice .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(81, 117, 86, 0.25);
}

.login-choice .form-control.is-invalid {
    border-color: var(--color-system-error-500);
    box-shadow: 0 0 0 0.2rem rgba(228, 70, 70, 0.25);
}

.login-choice .form-text {
    font-size: 0.875rem;
    color: var(--color-neutrals-700);
    margin-top: 0.25rem;
}

.login-choice .alert {
    border: none;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: var(--font-family-medium);
}

.login-choice .alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: currentColor;
    opacity: 0.8;
}

.login-choice .alert-danger {
    background: linear-gradient(135deg, #fef7f7 0%, #fef2f2 100%);
    color: var(--color-system-error-500);
    border: 1px solid rgba(228, 70, 70, 0.2);
}

.login-choice .alert-danger::before {
    background-color: var(--color-system-error-500);
}

.login-choice .alert-info {
    background: linear-gradient(135deg, var(--color-primary-100) 0%, #f0f9f7 100%);
    color: var(--color-base-black);
    border: 1px solid rgba(0, 161, 108, 0.2);
}

.login-choice .alert-info::before {
    background-color: var(--primary-aux);
}

.login-choice .alert-success {
    background: linear-gradient(135deg, var(--color-system-success-100) 0%, #f0f9f4 100%);
    color: var(--color-base-black);
    border: 1px solid rgba(10, 164, 68, 0.2);
}

.login-choice .alert-success::before {
    background-color: var(--color-system-success-500);
}

.login-choice .alert-heading {
    font-weight: 600;
    color: var(--color-base-black);
    margin-bottom: 0.5rem;
}

.login-choice .alert ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.login-choice .alert li {
    margin-bottom: 0.25rem;
    line-height: 1.5;
}

.login-choice .alert li:last-child {
    margin-bottom: 0;
}

/* Style spécifique pour les messages d'erreur de validation */
.login-choice .alert-danger,
.login-choice .alert-info,
.login-choice .alert-success {
    line-height: 1.5;
}

/* Responsive pour les petits écrans */
@media (max-width: 576px) {
    .login-choice .preserv-card {
        padding: 1.5rem !important;
    }
    
    .login-choice .d-flex.flex-column.flex-md-row {
        flex-direction: column !important;
    }
    
    .login-choice .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Animation pour les champs requis */
.login-choice .form-control[required]:valid {
    border-color: var(--color-system-success-500);
}

.login-choice .text-danger {
    color: var(--color-system-error-500) !important;
    font-weight: 600;
}

/* Amélioration de l'espacement */
.login-choice .row.g-3 > * {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Style pour les icônes dans les alertes */
.login-choice .alert img {
    flex-shrink: 0;
}

/* Animation d'entrée pour les éléments du formulaire */
.login-choice .form-control {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.login-choice .form-control:nth-child(1) { animation-delay: 0.1s; }
.login-choice .form-control:nth-child(2) { animation-delay: 0.2s; }
.login-choice .form-control:nth-child(3) { animation-delay: 0.3s; }
.login-choice .form-control:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style pour les messages d'erreur de validation */
.login-choice .invalid-feedback {
    display: block;
    color: var(--color-system-error-500);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Hover effects pour les boutons */
.login-choice .preserv-button-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.login-choice .preserv-button:hover {
    background-color: var(--color-neutrals-300);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Focus visible pour l'accessibilité */
.login-choice .btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Styles pour les sections de structure */
.login-choice .structure-item {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
}

.login-choice .structure-item:hover,
.login-choice .structure-item.structure-hover {
    background-color: var(--color-neutrals-200);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-choice .structure-item:last-child {
    border-bottom: none !important;
}

.login-choice .clickable-structure {
    cursor: pointer;
    user-select: none;
}

.login-choice .clickable-structure:hover {
    background-color: var(--color-neutrals-200);
}

.login-choice .clickable-structure h6 {
    margin: 0;
    color: var(--color-base-black);
    font-weight: 600;
}

.login-choice .clickable-structure .text-muted {
    color: var(--color-neutrals-700) !important;
    font-size: 0.9rem;
}

.login-choice .clickable-structure .fa-chevron-right {
    color: var(--color-neutrals-600);
    transition: transform 0.2s ease;
}

.login-choice .clickable-structure:hover .fa-chevron-right {
    transform: translateX(2px);
    color: var(--primary);
}

/* Styles pour les switches */
.login-choice .form-check-input {
    width: 2rem;
    height: 1rem;
    background-color: var(--color-neutrals-400);
    border: none;
    transition: all 0.3s ease;
}

.login-choice .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.login-choice .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(81, 117, 86, 0.25);
}

/* Styles pour les sections qui apparaissent/disparaissent */
.login-choice #piloteReseauSection,
.login-choice #structureExistanteSection,
.login-choice #nouvelleStructureSection {
    transition: all 0.3s ease;
}

/* Styles pour les titres de section */
.login-choice h5.preserv-text-primary {
    color: var(--primary) !important;
    font-weight: 600;
    border-bottom: 2px solid var(--color-neutrals-200);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.login-choice h5.preserv-text-primary i {
    color: var(--primary);
}

/* Amélioration des cards pour les résultats de recherche */
.login-choice .card {
    border: 1px solid var(--color-neutrals-300);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-choice .card-header {
    background-color: var(--color-neutrals-100);
    border-bottom: 1px solid var(--color-neutrals-300);
    padding: 0.75rem 1rem;
}

.login-choice .card-body {
    padding: 1rem;
}

/* Animation pour les alertes */
.login-choice .alert {
    animation: slideInDown 0.4s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive pour les alertes */
@media (max-width: 576px) {
    .login-choice .alert {
        padding: 1rem;
        margin-bottom: 1rem;
        font-size: 0.9rem;
    }
}

/* Style pour les radio buttons */
.login-choice .form-check-input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
}

.login-choice .form-check-input[type="radio"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Responsive improvements pour les nouvelles sections */
@media (max-width: 768px) {
    .login-choice .structure-item .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .login-choice .structure-item .btn {
        align-self: flex-start;
        width: auto;
    }
    
    .login-choice h5.preserv-text-primary {
        font-size: 1.1rem;
    }
    
    .login-choice .col-md-4,
    .login-choice .col-md-6,
    .login-choice .col-md-8 {
        margin-bottom: 1rem;
    }
}

/* Style pour les placeholders */
.login-choice .form-control::placeholder {
    color: var(--color-neutrals-600);
    font-style: italic;
}

/* Style pour les champs obligatoires avec indicateur visuel */
.login-choice .form-label .text-danger {
    font-size: 1.1em;
    margin-left: 0.25rem;
}

/* Loading state pour le bouton de recherche */
.login-choice #btnRechercherStructure.loading {
    pointer-events: none;
    opacity: 0.6;
}

.login-choice #btnRechercherStructure.loading::after {
    content: "";
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Ajustement hauteur Select2 pour correspondre aux autres champs */
.login-choice .select2-container--bootstrap-5 .select2-selection {
    min-height: calc(1.5em + 1.5rem + 2px) !important;
    padding: .75rem .75rem !important;
}

/* Information sur les données personnelles (bas de page) : première phrase cliquable, suite dépliable */
.login-choice .mention-donnees-personnelles {
    border-top: 1px solid var(--color-neutrals-300);
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--color-neutrals-700);
}

.login-choice .mention-donnees-toggle {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.login-choice .mention-donnees-toggle:hover span {
    text-decoration: underline;
}

.login-choice .mention-donnees-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.login-choice .mention-donnees-toggle i {
    flex-shrink: 0;
    color: var(--primary);
    transition: transform 0.2s ease;
}

.login-choice .mention-donnees-toggle:not(.collapsed) i {
    transform: rotate(180deg);
}

/* La suite reprend la taille et la police de la première phrase (base.css fixe p à 16px Barlow-Light) */
.login-choice .mention-donnees-personnelles p {
    font-family: inherit;
    font-size: inherit;
}

.login-choice .mention-donnees-personnelles a {
    color: var(--primary);
    text-decoration: underline;
}
