/* ================================================================
   Recrutement ENERGICAL — Formulaire de candidature
   Cible : #rh-form  (templates/form-candidature.php)
================================================================ */

.rh-form-wrap *,
.rh-form-wrap *::before,
.rh-form-wrap *::after { box-sizing: border-box; }

.rh-form-wrap { width: 100%; }

/* ── Notices ─────────────────────────────────────────────────── */
.rh-notice {
    padding: 14px 18px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
}
.rh-notice--success { background:#d4edda; color:#155724; border:1px solid #c3e6cb; }
.rh-notice--error   { background:#f8d7da; color:#721c24; border:1px solid #f5c6cb; }

/* ── Grille 3 colonnes : label-fr | champ | label-ar ─────────── */
.rh-field {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 0 16px;
    margin-bottom: 12px;
}
.rh-field--textarea { align-items: flex-start; }
.rh-field--textarea .rh-label { padding-top: 10px; }
.rh-field--file     { align-items: flex-start; }
.rh-field--captcha  { align-items: flex-start; margin-top: 6px; grid-template-columns: 1fr; }
.rh-field--submit   {
    grid-template-columns: 1fr;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* ── Labels ──────────────────────────────────────────────────── */
.rh-label { font-size: 14px; color: #222; line-height: 1.4; }
.rh-label--fr { text-align: left; font-weight: 600; color: #18274D; font-family: 'Nunito Sans', sans-serif; }
.rh-label--ar { text-align: right; direction: rtl; font-family: 'Cairo', sans-serif; font-weight: 500; color: #18274D; }
.rh-req { color: #FF4D10; }

/* ── Inputs & selects ────────────────────────────────────────── */
#rh-form input[type="text"],
#rh-form input[type="email"],
#rh-form input[type="tel"],
#rh-form select,
#rh-form textarea {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    outline: none;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}
#rh-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23FF4D10' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 14px) center;
    padding-right: 36px;
    cursor: pointer;
}
#rh-form textarea {
    height: 120px;
    padding: 12px 14px;
    resize: vertical;
}

/* Détection RTL/LTR via JS */
#rh-form input.rh-rtl,
#rh-form textarea.rh-rtl { direction: rtl; font-family: 'Cairo', sans-serif; }

/* ── Upload CV ───────────────────────────────────────────────── */
.rh-file-wrap { display: flex; flex-direction: column; gap: 8px; }

#rh-cv { display: none; }

.rh-file-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    transition: background 0.15s;
    padding: 0 16px;
    width: 100%;
}
.rh-file-btn:hover { background: #e4e4e4; }
.rh-file-btn svg { flex-shrink: 0; color: #FF4D10; }

.rh-file-name {
    font-size: 12px;
    color: #999;
    padding-left: 4px;
}
.rh-file-name.rh-file-selected { color: #27ae60; font-weight: 600; }

/* ── reCAPTCHA ───────────────────────────────────────────────── */
.rh-field--captcha .g-recaptcha { display: flex; justify-content: center; }

/* ── Loader ──────────────────────────────────────────────────── */
.rh-loading { display: none; align-items: center; gap: 8px; }
.rh-loading.is-visible { display: flex; }
.rh-spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 3px solid #ddd;
    border-top-color: #FF4D10;
    border-radius: 50%;
    animation: rh-spin 0.7s linear infinite;
}
@keyframes rh-spin { to { transform: rotate(360deg); } }

/* ── Message de validation ───────────────────────────────────── */
.rh-validation-msg { color: #e74c3c; font-size: 15px; font-weight: 600; text-align: center; }

/* ── Bouton envoyer ──────────────────────────────────────────── */
.rh-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    padding: 12px 36px;
    background: #FF4D10;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}
.rh-submit-btn:hover { background: #e03d00; }
.rh-submit-btn__ar { font-family: 'Cairo', sans-serif; font-size: 15px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 680px) {
    .rh-field {
        grid-template-columns: 1fr;
        gap: 4px;
        margin-bottom: 14px;
    }
    .rh-label--ar { text-align: left; direction: ltr; }
    .rh-field--submit { align-items: stretch; }
    .rh-submit-btn { justify-content: center; }
}
