/**
 * Styles pour le formulaire d'inscription
 */

/*	*************
	 FORM STYLES
	************* */

/* Global styles */
#custom-account-form .hidden {
    display: none !important;
}

/* Form */
#custom-account-form,
#custom-account-form .billing-address {
    display:flex;
    flex-wrap:wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap:20px;
}
#custom-account-form .form-group:not(.hidden) {
    width:calc(50% - 10px);
    display:flex!important;
    flex-wrap:wrap;
    align-items:flex-start;
    gap:0 40px;
    padding:15px;
    border:1px solid var(--lagoon);
    position: relative;
}
#custom-account-form .full-width {
    width:100%!important;
}
#custom-account-form .noborder,
#custom-account-form input,
#custom-account-form select{
    border:none!important;
}
#custom-account-form .textnormal label{
    text-transform:none!important;
    letter-spacing: 0!important;
}

/* Titles */
#custom-account-form .title{
    width:100%!important;
    text-transform:none!important;
    letter-spacing:0;
    font-weight:600;
    color:var(--lagoon);
}

/* Form elements */
#custom-account-form .form-group label {
    width:calc(50% - 20px);
    display: block;
    text-transform: uppercase;
    letter-spacing:0.07rem;
    font-weight:600;
    color:var(--blue);
    font-size: 0.95rem;
    line-height: 1.4;
    padding-top: 3px;
}
#custom-account-form .full-width:not(.billing-address) label{
    width:fit-content;
}
#custom-account-form .form-group .hint{
    font-size:0.8em;
    line-height: 1.2;
    display:block;
    text-transform:none;
    letter-spacing:0;
    margin-top:5px;
    width:100%;
}
#custom-account-form .form-group input,
#custom-account-form .form-group select,
#custom-account-form .form-group textarea {
    width:calc(50% - 20px);
    background:rgba(var(--rgblagoon),0.2);
    padding:5px;
}



#custom-account-form .form-group input[type="radio"],
#custom-account-form .form-group input[type="checkbox"] {
    width:auto;
    margin-right:5px;
    display: none; /* Masquer les inputs natifs pour utiliser les before */
}
#custom-account-form .form-group input[type="radio"] + label,
#custom-account-form .form-group input[type="checkbox"] + label {
    display:inline-block;
    margin-right:10px;
    cursor: pointer;
}
#custom-account-form .form-group .radio-group {
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}
#custom-account-form .form-group .radio-option {
    display:flex;
    align-items:center;
    gap:5px;
}
#custom-account-form .form-group .radio-option input {
    margin:0;
}
#custom-account-form .form-group .radio-option label {
    margin:0;
}

/* Radio buttons - cercles */
#custom-account-form .form-group .radio-option label::before {
    content:'';
    display:inline-block;
    width:16px;
    height:16px;
    border:2px solid var(--lagoon);
    border-radius:50%;
    margin-right:5px;
}
#custom-account-form .form-group .radio-option input:checked + label::before {
    background-color:var(--lagoon); 
}

/* Checkboxes - carrés */
#custom-account-form .form-group input[type="checkbox"] + label {
    position: relative;
}
#custom-account-form .form-group input[type="checkbox"] + label::before {
    content:'';
    display:inline-block;
    width:16px;
    height:16px;
    border:2px solid var(--lagoon);
    border-radius:2px;
    margin-right:5px;
    vertical-align: middle;
}
#custom-account-form .form-group input[type="checkbox"]:checked + label::before {
    background-color:var(--lagoon);
}
/* Pas de coche pour les checkboxes, juste le remplissage bleu */

/* Gestion spécifique pour label.checkbox (structure inversée) */
#custom-account-form .form-group label.checkbox {
    position: relative;
    cursor: pointer;
}
#custom-account-form .form-group label.checkbox::before {
    content:'';
    display:inline-block;
    width:16px;
    height:16px;
    border:2px solid var(--lagoon);
    border-radius:2px;
    margin-right:5px;
    vertical-align: middle;
}
/* États cochés pour label.checkbox - gérés par JavaScript */
#custom-account-form .form-group label.checkbox.checked::before {
    background-color:var(--lagoon);
}
/* Pas de coche pour label.checkbox, juste le remplissage bleu */

/* Files upload */
#custom-account-form .upload-progress {
    margin-top: 10px;
    display: none;
}
#custom-account-form .progress-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
#custom-account-form .progress-fill {
    height: 100%;
    background-color: #0073aa;
    border-radius: 10px;
    transition: width 0.3s ease;
    background-image: linear-gradient(
        45deg,
        rgba(255,255,255,.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255,255,255,.15) 50%,
        rgba(255,255,255,.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: progress-bar-stripes 1s linear infinite;
}
@keyframes progress-bar-stripes {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 20px 0;
    }
}
#custom-account-form .progress-text {
    display: inline-block;
    margin-top: 5px;
    font-size: 14px;
    color: #666;
    font-weight: 600;
}
/* Animation de la barre de progression complétée */
#custom-account-form .progress-fill[style*="100%"] {
    background-color: #46b450;
}

/*	****************
	 ERROR MESSAGES
	**************** */
#custom-account-form-container .error-message {
    width:100%;
    font-size:0.9em;
}
#custom-account-form-container .error-message,
#custom-account-form-container .form-messages .error,
#custom-account-form-container .required,
#custom-account-form-container input.error,
#custom-account-form-container select.error {
    color: #dc3232;
}
#custom-account-form-container input.error,
#custom-account-form-container select.error,
#custom-account-form-container .radio-group.error {
    border-color: #dc3232;
}
#custom-account-form-container .form-messages .error {
    padding: 10px;
    border: 1px solid #dc3232;
    background-color: #fff8f8;
    border-radius: 4px;
}
/* Messages de succès */
#custom-account-form-container .form-messages .success {
    color: #46b450;
    padding: 10px;
    border: 1px solid #46b450;
    background-color: #f7fff7;
    border-radius: 4px;
}
/* Structure des messages */
#custom-account-form-container .form-messages {
    margin-bottom: 20px;
}
#custom-account-form-container .error-message {
    font-size: 14px;
    margin-top: 5px;
}

/* Loader overlay */
.form-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.form-loader-overlay.active {
    opacity: 1;
    visibility: visible;
}

.form-loader {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 200px;
}

.form-loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color, #007cba);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.form-loader-text {
    color: #333;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Champ inactif (lecture seule) */
.form-group.inactive .readonly-field {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    color: #666;
    font-weight: 500;
}

/* Responsive pour le loader */
@media (max-width: 768px) {
    .form-loader {
        margin: 20px;
        padding: 20px;
        min-width: auto;
    }
}