/* Retour visuel des formulaires (envoi, erreurs, succès) */

.gf-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px; height: 1px;
    opacity: 0; pointer-events: none;
}

/* Champ en erreur */
.gf-invalid input,
.gf-invalid select,
.gf-invalid textarea {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15) !important;
}
.gf-invalid.form-check-v2 span { color: #c0392b; }

.gf-error-msg {
    display: flex; align-items: center; gap: 6px;
    margin-top: 6px;
    font-size: 12.5px; font-weight: 500; line-height: 1.3;
    color: #c0392b;
    animation: gf-fade-in .25s ease;
}
.gf-error-msg::before {
    content: "!";
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #c0392b; color: #fff;
    font-size: 11px; font-weight: 700;
}
.gf-shake { animation: gf-shake .4s ease; }

/* Bandeau de statut (succès / erreur) */
.gf-status {
    display: flex; align-items: flex-start; gap: 12px;
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px; line-height: 1.5; font-weight: 500;
    animation: gf-fade-in .3s ease;
}
.gf-status[hidden] { display: none; }
.gf-status-icon {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    color: #fff; font-size: 14px; font-weight: 700;
}
.gf-status.is-success { background: #e8f4e8; color: #1e451e; border: 1px solid #b7dcb7; }
.gf-status.is-success .gf-status-icon { background: #377937; }
.gf-status.is-error { background: #fdecea; color: #7a1f14; border: 1px solid #f1b7b0; }
.gf-status.is-error .gf-status-icon { background: #c0392b; }

/* Bouton pendant l'envoi / après envoi */
form button[type="submit"] { position: relative; }
form button[type="submit"].is-loading {
    cursor: progress;
    opacity: .85;
    pointer-events: none;
    transform: none !important;
}
form button[type="submit"].is-success {
    background: #377937 !important;
    pointer-events: none;
}
.gf-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    margin-right: 10px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -3px;
    animation: gf-spin .7s linear infinite;
}

form[aria-busy="true"] input,
form[aria-busy="true"] select,
form[aria-busy="true"] textarea { opacity: .7; }

@keyframes gf-spin { to { transform: rotate(360deg); } }
@keyframes gf-fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes gf-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@media (prefers-reduced-motion: reduce) {
    .gf-spinner { animation-duration: 1.6s; }
    .gf-shake, .gf-status, .gf-error-msg { animation: none; }
}
