/**
 * Styles du formulaire de téléchargement de ressources
 * Version complète et mise à jour
 */

/* Container principal */
.ressource-formulaire-container {
    max-width: 650px;
    margin: 0 auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* Honeypot anti-spam - caché */
.ressource-honeypot {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
}

/* Formulaire */
.ressource-form {
    animation: fadeIn 0.5s ease;
}

/* Groupes de champs */
.form-group {
    margin-bottom: 25px;
}

.form-group.half {
    width: 48%;
    display: inline-block;
}

.form-row {
    display: flex;
    justify-content: space-between;
    gap: 4%;
}

/* Labels */
.ressource-form label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 15px;
}

.required {
    color: #e74c3c;
}

/* Champs de formulaire */
.ressource-form input[type="text"],
.ressource-form input[type="email"],
.ressource-form select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
    box-sizing: border-box;
}

.ressource-form input:focus,
.ressource-form select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Select */
.ressource-form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    cursor: pointer;
}

/* Bouton de soumission */
.btn-ressource-submit {
    width: 100%;
    padding: 16px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
    margin-top: 10px;
    position: relative;
}

.btn-ressource-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 35px rgba(102, 126, 234, 0.4);
}

.btn-ressource-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Spinner de chargement */
.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    animation: spin 1s linear infinite;
    display: inline-block;
}

.spinner-circle {
    stroke: white;
    stroke-dasharray: 45;
    stroke-dashoffset: 45;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes dash {
    0% { stroke-dashoffset: 45; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -45; }
}

/* États d'erreur */
.form-group.has-error input,
.form-group.has-error select {
    border-color: #e74c3c;
    background-color: #fff5f5;
}

.field-error {
    display: block;
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
    animation: slideDown 0.2s ease;
}

.form-error {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.error-message {
    color: #c00;
    margin: 0;
    font-size: 14px;
}

/* Message de succès */
.ressource-message-succes {
    text-align: center;
    padding: 60px 40px;
    animation: slideInUp 0.5s ease;
}

.succes-icon {
    margin-bottom: 20px;
}

.succes-icon svg {
    color: #4ade80;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.ressource-message-succes h3 {
    color: #2c3e50;
    font-size: 28px;
    margin: 20px 0 15px;
    font-weight: 600;
}

.ressource-message-succes p {
    color: #6c757d;
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.ressource-message-succes strong {
    color: #667eea;
    font-weight: 600;
}

.fallback-download {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-top: 30px;
}

.fallback-download p {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 14px;
}

.btn-download-manual {
    display: inline-block;
    padding: 12px 30px;
    background: #667eea;
    color: white !important;
    text-decoration: none !important;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-download-manual:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Animations */
@keyframes fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Message d'erreur pour ressource non configurée */
.erreur-ressource {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .ressource-formulaire-container {
        padding: 25px;
        margin: 0 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group.half {
        width: 100%;
        display: block;
    }
    
    .ressource-message-succes {
        padding: 40px 20px;
    }
    
    .ressource-message-succes h3 {
        font-size: 24px;
    }
    
    .btn-ressource-submit {
        padding: 14px 25px;
        font-size: 16px;
    }
}

/* Compatibilité avec Divi */
.et_pb_section .ressource-formulaire-container {
    margin-left: auto;
    margin-right: auto;
}

/* Fix pour les conflits potentiels avec Divi */
.ressource-form input[type="text"]:focus,
.ressource-form input[type="email"]:focus,
.ressource-form select:focus {
    outline: none !important;
}

.ressource-form button[type="submit"] {
    line-height: normal !important;
}