/* ════════════════════════════════════════════════════
   FORMULAIRES AFLA — classe partagée .afla-form
   Usage : <div class="afla-form" style="--form-dark:#X;--form-light:#Y">
   Polices & bleus via variables du thème :
     --afla-fu   (Barlow, body)
     --afla-fh   (Barlow Condensed, titres)
     --afla-bleu-1  #8FC4DC  clair
     --afla-bleu-2  #5BA0C0  moyen
     --afla-bleu-3  #145F7A  foncé
   ════════════════════════════════════════════════════ */

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

.afla-form {
    max-width: 560px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    font-family: var(--afla-fu, 'Barlow', Arial, sans-serif);
    color: var(--form-dark, var(--afla-bleu-3, #145F7A));
}

/* ── Titre ── */
.afla-form h2 {
    font-family: var(--afla-fh, 'Barlow Condensed', 'Arial Narrow', sans-serif);
    font-size: 2rem; font-weight: 700; line-height: 1.15;
    color: var(--form-dark, var(--afla-bleu-3, #145F7A));
    margin: 0 0 8px;
}
.afla-form-title-line {
    width: 40px; height: 3px; border-radius: 2px;
    background: var(--form-dark, var(--afla-bleu-2, #5BA0C0));
    margin-bottom: 20px;
}

/* ── Intro ── */
.afla-form-intro {
    font-size: .95rem;
    color: #636e72;
    font-style: italic;
    margin-bottom: 28px;
}

/* ── Messages status ── */
.afla-form-msg {
    padding: 10px 16px;
    font-size: .85rem; font-weight: 500;
    border-radius: 10px;
    margin-bottom: 16px;
}
.afla-form-msg.err  { background: #fdf3f2; border-left: 3px solid #c0392b; color: #c0392b; }
.afla-form-msg.ok   { background: #edf7e9; border-left: 3px solid #2a6a2a; color: #2a6a2a; }
.afla-form-msg.info {
    background: var(--form-light, #e8f4fa);
    border-left: 3px solid var(--form-dark, var(--afla-bleu-2, #5BA0C0));
    color: var(--form-dark, var(--afla-bleu-3, #145F7A));
}

/* ── Sections ── */
.afla-form-section {
    margin-bottom: 16px;
    padding: 18px 20px;
    background: #fff;
    border: 1.5px solid var(--form-light, #e2e8f0);
    border-radius: 16px;
}
.afla-form-section-title {
    font-size: .7rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--form-dark, var(--afla-bleu-3, #145F7A));
    margin-bottom: 14px; display: block;
}

/* ── Grille ── */
.afla-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.afla-form-group { display: flex; flex-direction: column; gap: 6px; }
.afla-form-group.full { grid-column: 1 / -1; }

/* ── Labels ── */
.afla-form-label {
    font-size: .75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em;
    color: var(--form-dark, var(--afla-bleu-3, #145F7A));
    display: flex; align-items: center; gap: 4px;
}
.afla-form-req   { color: var(--form-dark, var(--afla-bleu-2, #5BA0C0)); }
.afla-form-hint  { font-size: .75rem; color: #a0a7b5; font-style: italic; }

/* ── Inputs & textarea ── */
.afla-form-inp,
.afla-form-ta {
    font-family: var(--afla-fu, 'Barlow', Arial, sans-serif);
    font-size: 1rem; font-weight: 400;
    color: #1e1e2e;
    background: #fff;
    border: 2px solid #d6e4ee;
    border-radius: 100px;
    padding: 13px 20px;
    width: 100%; outline: none;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none; appearance: none;
}
.afla-form-ta {
    border-radius: 18px;
    resize: vertical;
    min-height: 100px;
}
.afla-form-inp::placeholder,
.afla-form-ta::placeholder { color: #b4bec8; }

.afla-form-inp:focus,
.afla-form-ta:focus {
    border-color: var(--form-dark, var(--afla-bleu-2, #5BA0C0));
    box-shadow: 0 0 0 3px rgba(91, 160, 192, .15);
    outline: none;
}

/* ── Upload photo ── */
.afla-form-upload {
    position: relative;
    border: 2px dashed var(--form-light, #d6e4ee);
    background: #fafcfe;
    border-radius: 18px;
    min-height: 100px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    cursor: pointer; overflow: hidden;
    transition: border-color .15s, background .15s;
}
.afla-form-upload:hover {
    border-color: var(--form-dark, var(--afla-bleu-2, #5BA0C0));
    background: #f4fafd;
}
.afla-form-upload input[type=file] {
    position: absolute; inset: 0;
    opacity: 0; cursor: pointer; z-index: 2;
}
.afla-form-upload-lbl {
    font-family: var(--afla-fu, 'Barlow', Arial, sans-serif);
    font-size: .9rem;
    color: var(--form-dark, var(--afla-bleu-2, #5BA0C0));
    text-align: center; padding: 18px;
    pointer-events: none; line-height: 1.5;
}
.afla-form-upload-prev { display: none; position: absolute; inset: 0; }
.afla-form-upload-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.afla-form-upload.has-img .afla-form-upload-lbl  { display: none; }
.afla-form-upload.has-img .afla-form-upload-prev { display: block; }

/* ── Bouton ── */
.afla-form-submit {
    font-family: var(--afla-fu, 'Barlow', Arial, sans-serif);
    font-size: 1rem; font-weight: 700;
    letter-spacing: .02em;
    background: var(--form-dark, var(--afla-bleu-2, #5BA0C0));
    color: #fff;
    border: none; border-radius: 100px;
    padding: 14px 32px;
    cursor: pointer; margin-top: 8px;
    transition: opacity .2s, transform .12s;
    display: inline-block;
}
.afla-form-submit:hover:not(:disabled)  { opacity: .85; transform: translateY(-1px); }
.afla-form-submit:active                { transform: translateY(0); }
.afla-form-submit:disabled              { opacity: .45; cursor: not-allowed; transform: none; }

/* ── Responsive ── */
@media (max-width: 560px) {
    .afla-form-grid { grid-template-columns: 1fr; }
    .afla-form h2   { font-size: 1.6rem; }
    .afla-form-submit { width: 100%; text-align: center; }
}
