/**
 * Custom Forms CSS
 * Styles pour les formulaires personnalisés TDS
 */

/* Styles généraux pour les champs de formulaire */

.tds-form .label{
    font-family: Poppins-Medium;
    font-size: 16px;
    color: #001c44;
}

.tds-form textarea {
    border-radius: 6px;
    border: 1px solid var(--Gray-gray-input, #dce1e6);
    width: 100%;
    min-height: 150px;
    resize: none;
    background-color: #fbfdff;
    font-family: Poppins-Regular;
    font-size: 16px;
    color: #001c44;
    padding: 4px 8px;
}

/* Styles pour les champs larges (100%) */
.tds-form .form-field.large {
    width: 100% !important;
}

.tds-form .textarea-field.large {
    width: 100% !important;
}

.tds-form .file-field.large {
    width: 100% !important;
}

/* Styles pour les listes déroulantes */
.tds-form .select-wrapper {
    position: relative;
    width: 100%;
}

.tds-form .select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #0a2d5e;
    pointer-events: none;
}

.tds-form .input-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fbfdff;
    font-family: Poppins-Regular;
    color: #001c44;
    cursor: pointer;
}

.tds-form .input-select:focus {
    border-color: #0a2d5e;
    box-shadow: 0 0 0 2px rgba(10, 45, 94, 0.2);
    outline: none;
}

.tds-form .input-select option {
    padding: 10px;
}

/* .tds-form .input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.tds-form .input:focus,
.tds-form textarea:focus {
    border-color: #0a2d5e;
    box-shadow: 0 0 0 2px rgba(10, 45, 94, 0.2);
    outline: none;
} */

/* Styles pour les boutons radio */
.tds-form .radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.tds-form .radio-option {
    position: relative;
    display: flex;
    align-items: center;
}

.tds-form .input-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tds-form .radio-option label {
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    display: inline-block;
    line-height: 22px;
    font-size: 16px;
    user-select: none;
}

.tds-form .radio-option label:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    background: #fff;
    transition: all 0.3s ease;
}

.tds-form .input-radio:checked + label:before {
    border-color: #0a2d5e;
}

.tds-form .input-radio:checked + label:after {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0a2d5e;
    transition: all 0.3s ease;
}

.tds-form .input-radio:focus + label:before {
    box-shadow: 0 0 0 3px rgba(10, 45, 94, 0.2);
}

/* Styles pour les cases à cocher */
.tds-form .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tds-form .checkbox-option {
    position: relative;
    display: flex;
    align-items: center;
}

.tds-form .input-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tds-form .checkbox-option label {
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    display: inline-block;
    font-family: Poppins-Medium;
    font-size: 14px;
    /* line-height: 22px;
    font-size: 16px; */
    user-select: none;
}

.tds-form .checkbox-option label:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #fff;
    transition: all 0.3s ease;
}

.tds-form .input-checkbox:checked + label:before {
    border-color: #0a2d5e;
    background: #0a2d5e;
}

.tds-form .input-checkbox:checked + label:after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.tds-form .input-checkbox:focus + label:before {
    box-shadow: 0 0 0 3px rgba(10, 45, 94, 0.2);
}

/* Styles pour les champs textarea */
.tds-form .textarea-field {
    width: 100%;
    margin-bottom: 20px;
    position: relative;
}

/* Styles pour le champ de téléchargement de fichier */
.tds-form .form-field {
    width: 100%;
    margin-bottom: 20px;
    position: relative;
}

.tds-form .file-upload-wrapper {
    position: relative;
    width: 100%;
    height: 60px;
    overflow: hidden;
}

.tds-form .file-upload-input {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
    padding: 0;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    filter: alpha(opacity=0);
    width: 100%;
    height: 100%;
    z-index: 2;
}

.tds-form .file-upload-button {
    position: absolute;
    top: 0;
    right: 0;
    background: #0a2d5e;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 0 4px 4px 0;
    height: 100%;
    cursor: pointer;
    transition: background 0.3s;
    font-family: Poppins-Medium;
    font-size: 14px;
}

.tds-form .file-upload-button:hover {
    background: #0d3b7a;
}

.tds-form .file-upload-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 100px;
    padding: 0 15px;
    line-height: 60px;
    height: 60px;
    background: #fbfdff;
    border: 1px solid #dce1e6;
    border-radius: 4px 0 0 4px;
    color: #999;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-family: Poppins-Regular;
    font-size: 14px;
}

.tds-form .file-upload-wrapper.has-file .file-upload-text {
    color: #001c44;
}

/* Styles pour la liste des fichiers sélectionnés */
.tds-form .selected-files-list {
    margin-top: 10px;
    border: 1px solid #dce1e6;
    border-radius: 4px;
    background: #fbfdff;
    max-height: 200px;
    overflow-y: auto;
}

.tds-form .selected-files-list:empty {
    display: none;
}

.tds-form .selected-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.tds-form .selected-file-item:last-child {
    border-bottom: none;
}

.tds-form .selected-file-item:hover {
    background-color: #f8f9fa;
}

.tds-form .selected-file-item .file-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.tds-form .selected-file-item .file-name {
    font-family: Poppins-Medium;
    font-size: 14px;
    color: #001c44;
    margin-right: 8px;
    word-break: break-word;
    flex: 1;
}

.tds-form .selected-file-item .file-size {
    font-family: Poppins-Regular;
    font-size: 12px;
    color: #666;
    margin-right: 10px;
    white-space: nowrap;
}

.tds-form .selected-file-item .remove-file-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.tds-form .selected-file-item .remove-file-btn:hover {
    background: #c82333;
}

.tds-form .selected-file-item .remove-file-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3);
}

/* Styles pour les barres de progression */
.tds-form .file-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.tds-form .progress-bar {
    flex: 1;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.tds-form .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0a2d5e 0%, #1e5aa8 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.tds-form .progress-text {
    font-family: Poppins-Medium;
    font-size: 12px;
    color: #0a2d5e;
    min-width: 35px;
    text-align: right;
}

/* Styles pour les statuts de fichier */
.tds-form .file-status {
    font-family: Poppins-Medium;
    font-size: 12px;
    margin-top: 5px;
}

.tds-form .file-status.completed {
    color: #28a745;
}

.tds-form .file-status.error {
    color: #dc3545;
}

/* Styles pour le bouton d'annulation */
.tds-form .cancel-upload-btn {
    background: #ffc107;
    color: #212529;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.tds-form .cancel-upload-btn:hover {
    background: #e0a800;
}

.tds-form .cancel-upload-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
}

/* Amélioration de la structure des éléments de fichier */
.tds-form .selected-file-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    position: relative;
}

.tds-form .selected-file-item .file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

.tds-form .selected-file-item .file-name {
    font-family: Poppins-Medium;
    font-size: 14px;
    color: #001c44;
    flex: 1;
    margin-right: 10px;
    word-break: break-word;
}

.tds-form .selected-file-item .file-size {
    font-family: Poppins-Regular;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.tds-form .selected-file-item .remove-file-btn,
.tds-form .selected-file-item .cancel-upload-btn {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* Styles pour le bouton de soumission */
.tds-form .submit {
    background-color: #0a2d5e;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tds-form .submit:hover {
    background-color: #0d3b7a;
}

.tds-form .submit:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 45, 94, 0.3);
}

/* Styles pour les messages */
.tds-form .form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
}

.tds-form .form-message .success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    padding: 10px;
    border-radius: 4px;
}

.tds-form .form-message .error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
    padding: 10px;
    border-radius: 4px;
}

/* Styles pour reCAPTCHA */
.tds-form .recaptcha-field {
    margin-bottom: 20px;
}

/* Styles pour le mode sombre */
.form-quotation.dark {
    background-color: #1a1a1a;
    color: #fff;
}

.form-quotation.dark .tds-form .label {
    color: #eee;
}

.form-quotation.dark .tds-form .input,
.form-quotation.dark .tds-form textarea {
    background-color: #333;
    border-color: #444;
    color: #fff;
}

.form-quotation.dark .tds-form .file-upload-text {
    background-color: #333;
    border-color: #444;
    color: #aaa;
}

.form-quotation.dark .tds-form .file-upload-wrapper.has-file .file-upload-text {
    color: #eee;
}

.form-quotation.dark .tds-form .selected-files-list {
    background-color: #333;
    border-color: #444;
}

.form-quotation.dark .tds-form .selected-file-item {
    border-bottom-color: #444;
}

.form-quotation.dark .tds-form .selected-file-item:hover {
    background-color: #404040;
}

.form-quotation.dark .tds-form .selected-file-item .file-name {
    color: #eee;
}

.form-quotation.dark .tds-form .selected-file-item .file-size {
    color: #aaa;
}

/* Responsive */
@media (max-width: 768px) {
    .tds-form .radio-group,
    .tds-form .checkbox-group {
        flex-direction: column;
    }
    
    .tds-form .file-upload-text {
        right: 80px;
        font-size: 12px;
    }
    
    .tds-form .file-upload-button {
        width: 80px;
        font-size: 12px;
        padding: 10px 8px;
    }
    
    .tds-form .selected-file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .tds-form .selected-file-item .file-name {
        margin-right: 0;
        margin-bottom: 4px;
    }
    
    .tds-form .selected-file-item .file-size {
        margin-right: 0;
    }
    
    .tds-form .selected-file-item .remove-file-btn {
        align-self: flex-end;
        margin-top: -30px;
    }
}

@media (max-width: 480px) {
    .tds-form .file-upload-text {
        right: 70px;
        font-size: 11px;
        padding: 0 10px;
    }
    
    .tds-form .file-upload-button {
        width: 70px;
        font-size: 11px;
        padding: 10px 5px;
    }
    
    .tds-form .selected-files-list {
        max-height: 150px;
    }
    
    .tds-form .selected-file-item {
        padding: 6px 8px;
    }
    
    .tds-form .selected-file-item .file-name {
        font-size: 12px;
    }
    
    .tds-form .selected-file-item .file-size {
        font-size: 11px;
    }
    
    .tds-form .selected-file-item .remove-file-btn {
        width: 20px;
        height: 20px;
        font-size: 14px;
    }
}
