/**
 * HiveProtect Forms - Styles Frontend
 * Styles pour l'affichage des formulaires côté public
 * @package HiveProtect
 * @since 3.2.0
 */

/* Container principal du formulaire */
.hiveprotect-form-container {
    margin: 40px auto;
    padding: 0 15px;
}

.hiveprotect-form-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.hiveprotect-form {
    width: 100%;
    max-width: 800px;
    padding: 30px;
    background: var(--wp--preset--color--base, #fff);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

/* Champs de formulaire */
.hiveprotect-field {
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.hiveprotect-field.focused {
    transform: translateX(2px);
}

.hiveprotect-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--wp--preset--color--contrast, #333);
}

.hiveprotect-field .required {
    color: #dc3545;
    margin-left: 3px;
}

/* Inputs et textareas */
.hiveprotect-input,
.hiveprotect-textarea,
.hiveprotect-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--hp-border, #dcdcde);
    border-radius: 4px;
    font-family: inherit;
    font-size: inherit;
    transition: all 0.3s ease;
    background: #fff;
}

.hiveprotect-input:focus,
.hiveprotect-textarea:focus,
.hiveprotect-select:focus {
    outline: none;
    border-color: var(--hp-primary, var(--wp--preset--color--primary, #2196F3));
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
    background: #fafafa;
}

.hiveprotect-textarea {
    min-height: 120px;
    resize: vertical;
}

/* États d'erreur */
.hiveprotect-field.has-error .hiveprotect-input,
.hiveprotect-field.has-error .hiveprotect-textarea {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.error-message {
    display: block;
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
    font-style: italic;
}

/* Bouton submit */
.hiveprotect-submit {
    background: var(--hp-primary, var(--wp--preset--color--primary, #2196F3));
    color: white;
    border: none;
    padding: 14px 35px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.hiveprotect-submit:hover {
    background: var(--hp-primary-dark, #1976D2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.hiveprotect-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.hiveprotect-submit .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Description des champs */
.field-description {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Radio et checkbox */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px;
    transition: background 0.2s;
}

.radio-label:hover,
.checkbox-label:hover {
    background: #f8f9fa;
}

.radio-label input,
.checkbox-label input {
    margin: 0;
    cursor: pointer;
}

/* Champ de consentement */
.consent-field {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e2e4e7;
    margin-top: 20px;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.consent-label input {
    margin-top: 3px;
}

/* Champ de notation */
.rating-field {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.rating-field .star {
    cursor: pointer;
    font-size: 24px;
    color: #ddd;
    transition: color 0.2s;
}

.rating-field .star:hover,
.rating-field .star.selected {
    color: #ffc107;
}

/* Contenu HTML */
.html-content {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Section de formulaire */
.section-field {
    margin: 30px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e4e7;
}

.section-field h3 {
    margin: 0 0 10px;
    color: var(--wp--preset--color--contrast, #333);
}

.section-field p {
    margin: 0;
    color: #666;
}

/* Champ quiz */
.quiz-field {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #e2e4e7;
}

.quiz-question {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--wp--preset--color--contrast, #333);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-option:hover {
    border-color: var(--hp-primary, #2196F3);
    background: #e3f2fd;
}

.quiz-option input {
    margin: 0;
}

/* Honeypots - TOUJOURS cachés */
.gfcs-honeypot-field,
[name="gfcs_email"],
[name="gfcs_website"],
[name="gfcs_phone"],
[name="gfcs_company"] {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Animation de rotation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Messages de succès/erreur */
.hiveprotect-message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hiveprotect-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.hiveprotect-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.hiveprotect-message .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .hiveprotect-form {
        padding: 20px;
    }
    
    .hiveprotect-field {
        margin-bottom: 20px;
    }
    
    .radio-group,
    .checkbox-group {
        gap: 15px;
    }
    
    .hiveprotect-submit {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hiveprotect-form {
        padding: 15px;
        border-radius: 0;
        box-shadow: none;
    }
    
    .hiveprotect-form-container {
        margin: 20px 0;
        padding: 0;
    }
}