/* Import Poppins pour le corps de texte */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* Configuration de la police Ethnocentric locale */
@font-face {
    font-family: 'Ethnocentric';
    src: url('/wp-content/uploads/fonts/Ethnocentric-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Variables NIFRI */
:root {
    --nifri-teal: #4db4b3;
    --nifri-pink: #ff6392;
    --nifri-gold: #c5a059;
    --nifri-cream: #f9f7f2;
    --nifri-dark: #1a1a1a;
    --nifri-gray: #6b7280;
    --nifri-light-gray: #f3f4f6;
}

.nifri-recruitment-container {
    max-width: 900px;
    margin: 60px auto;
    padding: 50px;
    background: linear-gradient(135deg, #ffffff 0%, var(--nifri-cream) 100%);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(77, 180, 179, 0.12),
        0 8px 20px rgba(0, 0, 0, 0.06);
    font-family: 'Poppins', sans-serif;
    color: var(--nifri-dark);
    border: 1px solid rgba(77, 180, 179, 0.1);
    position: relative;
    overflow: hidden;
}

/* Élément décoratif en arrière-plan */
.nifri-recruitment-container::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(77, 180, 179, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.nifri-recruitment-container::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255, 99, 146, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Titre principal avec Ethnocentric */
.nifri-recruitment-container h2 {
    font-family: 'Ethnocentric', Arial, sans-serif;
    margin-bottom: 12px;
    font-weight: normal;
    color: var(--nifri-dark);
    text-align: center;
    font-size: 2rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

/* Sous-titre optionnel */
.nifri-recruitment-container .subtitle {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--nifri-gray);
    text-align: center;
    margin-bottom: 40px;
    line-height: 1.6;
}

/* Ligne décorative sous le titre */
.nifri-recruitment-container h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--nifri-teal), var(--nifri-pink));
    margin: 16px auto 0;
    border-radius: 2px;
}

.form-row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.form-group label {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--nifri-dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Indicateur requis */
.form-group label .required {
    color: var(--nifri-pink);
    font-size: 1.2rem;
    line-height: 1;
}

/* Harmonisation complète des champs de saisie */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select,
.form-group textarea,
.form-group input[type="file"] {
    width: 100%;
    height: 52px;
    padding: 0 18px;
    background-color: #ffffff !important;
    color: var(--nifri-dark) !important;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    display: block;
    line-height: normal;
    margin: 0;
}

/* Centrage vertical pour les inputs de type texte */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"] {
    padding: 12px 18px;
    line-height: normal;
}

.form-group select {
    padding: 13px 40px 13px 18px;
    line-height: normal;
    height: 52px;
}

/* Placeholder styling */
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Hover & Focus states */
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--nifri-teal);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--nifri-teal);
    outline: none;
    box-shadow: 0 0 0 4px rgba(77, 180, 179, 0.12);
    transform: translateY(-1px);
}

/* Cas particulier du textarea */
.form-group textarea {
    height: auto;
    min-height: 120px;
    padding: 14px 18px;
    line-height: 1.6;
    resize: vertical;
}

/* Cas particulier de l'input file */
.form-group input[type="file"] {
    padding-top: 10px;
    line-height: 1;
    cursor: pointer;
}

/* Style spécifique pour les selects (flèche personnalisée) */
.form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234db4b3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Bouton de soumission */
#submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--nifri-teal) 0%, #3d9d9c 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-family: 'Ethnocentric', Arial, sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 32px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(77, 180, 179, 0.3);
}

/* Effet de survol du bouton */
#submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#submit-btn:hover::before {
    left: 100%;
}

#submit-btn:hover {
    background: linear-gradient(135deg, #3d9d9c 0%, var(--nifri-teal) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(77, 180, 179, 0.4);
}

#submit-btn:active {
    transform: translateY(0);
}

#submit-btn:disabled {
    background: var(--nifri-gray);
    cursor: not-allowed;
    box-shadow: none;
}

/* Loader */
#submit-btn .loader {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin-left: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Messages de formulaire */
#form-message {
    padding: 18px 24px;
    margin-bottom: 24px;
    border-radius: 12px;
    display: none;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#form-message.success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #b1dfbb;
    box-shadow: 0 4px 12px rgba(21, 87, 36, 0.1);
}

#form-message.success::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #155724;
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

#form-message.error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #f1aeb5;
    box-shadow: 0 4px 12px rgba(114, 28, 36, 0.1);
}

#form-message.error::before {
    content: '✕';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #721c24;
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

/* Effet de focus amélioré pour l'accessibilité */
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible,
#submit-btn:focus-visible {
    outline: 3px solid var(--nifri-teal);
    outline-offset: 2px;
}

/* Styles pour les champs invalides */
.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
    border-color: var(--nifri-pink);
}

/* Message d'aide optionnel */
.form-group .help-text {
    font-size: 0.85rem;
    color: var(--nifri-gray);
    margin-top: 6px;
    font-style: italic;
}

/* Bouton secondaire optionnel */
.btn-secondary {
    background: white;
    color: var(--nifri-teal);
    border: 2px solid var(--nifri-teal);
}

.btn-secondary:hover {
    background: var(--nifri-teal);
    color: white;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .nifri-recruitment-container {
        padding: 32px 24px;
        margin: 24px 16px;
        border-radius: 20px;
    }

    .nifri-recruitment-container h2 {
        font-size: 1.5rem;
    }

    .nifri-recruitment-container .subtitle {
        font-size: 1rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group {
        margin-bottom: 20px;
    }

    #submit-btn {
        padding: 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .nifri-recruitment-container {
        padding: 24px 16px;
        margin: 16px 12px;
    }

    .nifri-recruitment-container h2 {
        font-size: 1.3rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 0.95rem;
        padding: 12px 14px;
    }
}

/* Animation d'entrée pour le formulaire */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nifri-recruitment-container {
    animation: fadeInUp 0.6s ease-out;
}

/* États de chargement */
.form-group.loading input,
.form-group.loading select,
.form-group.loading textarea {
    background: var(--nifri-light-gray);
    pointer-events: none;
}

/* Photo Upload / FilePond Styles */
#nifri-filepond-wrapper {
    width: 100%;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.filepond--root {
    margin: 0 auto;
    max-width: 300px;
    width: 100%;
}

.filepond--panel-root {
    background-color: #f8fafc;
    border: 2px dashed #e5e7eb;
}

.type-contest .photo-group {
    display: flex;
    flex-direction: column;
    /* Back to column for better stability */
    gap: 15px;
    align-items: flex-start;
}

/* Ensure form rows stay visible */
.type-contest .cv-group {
    display: none !important;
}

@media (max-width: 768px) {
    .type-contest .photo-group {
        width: 100% !important;
    }
}