/* Register Page Styles */
.register-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background-color: #f9fafb;
}

.register-card {
    width: 100%;
    max-width: 28rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.register-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.register-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.register-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.register-header p {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.register-header a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.register-header a:hover {
    color: #2563eb;
}

.register-body {
    padding: 1.5rem 2rem 2rem;
}

.register-form .form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.register-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.register-form .form-control {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #111827;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.register-form .form-control:focus {
    border-color: #93c5fd;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.5);
}

.register-form .form-control.is-invalid {
    border-color: #f87171;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef4444' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Messages d'erreur et de feedback améliorés */
.invalid-feedback,
.error-message {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.4rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: #991b1b;
    background-color: #fef2f2;
    border-radius: 0.375rem;
    line-height: 1.4;
    animation: fadeIn 0.25s ease-out;
    border: 1px solid #fecaca;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Icône d'erreur */
.error-message::before {
    content: '⚠️';
    font-size: 1.1em;
    margin-top: 0.1em;
    flex-shrink: 0;
}

/* Alertes flash */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.5;
    position: relative;
}

.alert-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.15em;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.alert p {
    margin: 0;
    flex: 1;
}

/* Animations améliorées */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-8px);
        max-height: 0;
        padding: 0;
        margin: 0;
        border-width: 0;
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
        max-height: 100px;
        padding: 0.5rem 0.75rem;
        margin-top: 0.4rem;
        border-width: 1px;
    }
}

/* Animation de pulse pour attirer l'attention */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Classe pour l'animation de pulse */
.pulse-error {
    animation: pulse 1.5s infinite;
}

/* Style pour les champs avec erreur */
.form-control.is-invalid {
    border-color: #dc2626 !important;
    background-color: #fff8f8;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23dc2626' viewBox='0 0 16 16'%3e%3cpath d='M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem 1rem;
    padding-right: 2.5rem;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1), 0 0 0 1px rgba(220, 38, 38, 0.3);
    border-color: #b91c1c !important;
    background-color: #fff;
}

/* Animation de secousse pour les champs invalides */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

.form-control.is-invalid:focus {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* Style pour les messages d'aide des champs */
.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Style pour le wrapper des champs de mot de passe */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-control {
    padding-right: 2.5rem;
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
}

.toggle-password:hover {
    color: #3b82f6;
    background-color: #f3f4f6;
}

.toggle-password:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.toggle-password .toggle-icon {
    display: inline-block;
    font-size: 1rem;
    line-height: 1;
}

/* Style pour le groupe de termes et conditions */
.terms-group {
    margin: 1.5rem 0;
}

.terms-group .form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.terms-group .form-check-input {
    margin-top: 0.25rem;
}

.terms-group .form-check-label {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #4b5563;
}

.terms-group a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.terms-group a:hover {
    text-decoration: underline;
}

/* Style pour le bouton de soumission */
.btn-register {
    display: block;
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    color: white;
    background-color: #3b82f6;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-top: 1rem;
}

.btn-register:hover:not(:disabled) {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-register:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

.btn-register:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-register:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #93c5fd;
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 1.25rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    color: #3b82f6;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
}

.form-check-input:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.form-check-label {
    font-size: 0.875rem;
    color: #4b5563;
}

.form-check a {
    color: #3b82f6;
    text-decoration: none;
}

.form-check a:hover {
    text-decoration: underline;
}

.btn-register {
    display: block;
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    color: white;
    background-color: #3b82f6;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-register:hover {
    background-color: #2563eb;
}

.btn-register:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

.btn-register:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #93c5fd;
    transform: none;
    box-shadow: none;
}

.btn-register .spinner-border {
    margin-right: 0.5rem;
    vertical-align: middle;
}

.register-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.register-footer a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.register-footer a:hover {
    text-decoration: underline;
}

/* Grid layout for first name and last name */
.name-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Amélioration de l'accessibilité au focus */
.form-control:focus, 
.form-check-input:focus {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.5);
}

/* Amélioration du contraste pour l'accessibilité */
.register-header h2 {
    color: #1f2937;
}

.register-form label {
    color: #374151;
}

/* Styles pour le toggle de mot de passe */
.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0.25rem;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
}

.toggle-password:hover {
    color: #3b82f6;
    opacity: 1;
}

/* Styles pour les messages flash */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    animation: fadeIn 0.3s ease-in-out;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

/* Styles pour le conteneur principal */
.register-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background-color: #f9fafb;
}

.register-card {
    width: 100%;
    max-width: 28rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.register-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.register-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.register-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem;
    line-height: 1.25;
}

.register-header p {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.register-header a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.register-header a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.register-body {
    padding: 1.5rem 2rem 2rem;
}

/* Styles pour les champs du formulaire */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #111827;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #93c5fd;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.5);
}

/* Grille pour les champs de nom et prénom */
.name-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Styles pour le pied de page */
.register-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.register-footer a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    margin-left: 0.25rem;
}

.register-footer a:hover {
    text-decoration: underline;
}

/* Styles pour les messages de chargement */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: -0.125em;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Styles pour les champs désactivés */
:disabled,
[disabled] {
    opacity: 0.7;
    cursor: not-allowed !important;
}

/* Styles pour les liens dans les formulaires */
a {
    transition: color 0.2s ease;
}

a:hover {
    color: #2563eb;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .register-container {
        padding: 0;
        background-color: #fff;
    }
    
    .register-card {
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        border: none;
        padding: 1rem;
    }
    
    .register-header {
        padding: 1rem 0 0.5rem;
    }
    
    .register-body {
        padding: 1rem 0 1.25rem;
    }
    
    .name-fields {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .btn-register {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
    
    .alert {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}
