/*
 * forms.css — système de formulaires éditoriaux réutilisable
 *
 * Chargé dans base.html, après global.css. Centralise tout ce qui touche
 * aux formulaires du site (contact, register, login, newsletter, etc.) pour
 * éviter la duplication par template.
 *
 * Contenu :
 *   - Champs éditoriaux : .input-editorial / .textarea-editorial / .select-editorial / .label-editorial
 *     (border-bottom only, focus bordeaux, look "papier d'imprimeur")
 *   - .required-mark : astérisque hot (#e04a2a) pour les champs obligatoires
 *   - .form-editorial : container vertical d'un form complet
 *   - .form-row : wrapper d'un champ (label + input + erreur)
 *   - .form-grid-2 : grid 2 colonnes responsive (ex. nom + email côte à côte)
 *   - .form-banner / .form-banner-error / .form-banner-success : bannières d'état globales
 *   - .form-error-msg : message d'erreur sous un champ (mono, hot)
 *   - .form-actions : ligne du bouton submit + mention legal
 *   - .form-aside : colonne metadata mono à droite d'un form (dl)
 *   - .recaptcha-legal (override) : mention Google style éditorial
 *
 * Tokens utilisés (référencés depuis tailwind.config.js) :
 *   primary-700  #5a1224 (bordeaux)
 *   primary-50   #fdf2f5 (bordeaux clair)
 *   primary-800  #4a0e1d
 *   secondary-900 #13234f (marine)
 *   accent-600   #556954 (sauge foncée)
 *   accent-50    #f5f7f5
 *   cream-100    #f5efe0 (paper)
 *   cream-200    #ece5d6
 *   ink-950      #0c0f1a (texte sombre)
 *   ink-800      #1b1e2a
 *   muted-600    #6b6557 (gris chaud)
 *   hot          #e04a2a (signalétique erreur)
 */


/* ============================================================
 * CHAMPS ÉDITORIAUX — inputs avec border-bottom only
 * Migrés depuis global.css le 2026-05-22 (regroupement form)
 * ============================================================ */
.input-editorial,
.textarea-editorial,
.select-editorial {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(12, 15, 26, 0.32);
    padding: 12px 0 10px;
    font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
    font-size: 15px;
    color: #0c0f1a;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    border-radius: 0;
    line-height: 1.4;
}

.input-editorial:focus,
.textarea-editorial:focus,
.select-editorial:focus {
    outline: none;
    border-bottom-color: #5a1224;
    box-shadow: 0 1px 0 0 #5a1224;
}

.input-editorial::placeholder,
.textarea-editorial::placeholder {
    color: rgba(107, 101, 87, 0.5);
}

.textarea-editorial {
    min-height: 140px;
    resize: vertical;
}

.select-editorial {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #6b6557 50%),
                      linear-gradient(135deg, #6b6557 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
    background-size: 6px 6px;
    background-repeat: no-repeat;
    padding-right: 30px;
    cursor: pointer;
}

.label-editorial {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b6557;
    display: block;
    margin-bottom: 8px;
}

/* État erreur sur un champ : bordure hot + label hot */
.form-row.has-error .input-editorial,
.form-row.has-error .textarea-editorial,
.form-row.has-error .select-editorial {
    border-bottom-color: #e04a2a;
}

.form-row.has-error .label-editorial {
    color: #e04a2a;
}


/* ============================================================
 * REQUIRED MARK — astérisque pour champ obligatoire
 * ============================================================ */
.required-mark {
    color: #e04a2a;
    font-family: "Fraunces", Georgia, serif;
    font-style: italic;
    font-size: 1.1em;
    margin-left: 2px;
}


/* ============================================================
 * FORM-EDITORIAL — container vertical d'un formulaire complet
 * ============================================================ */
.form-editorial {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.form-row {
    display: flex;
    flex-direction: column;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}

@media (min-width: 640px) {
    .form-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}


/* ============================================================
 * FORM-ERROR-MSG — message d'erreur sous un champ
 * ============================================================ */
.form-error-msg {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: #e04a2a;
    margin-top: 8px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.form-error-msg::before {
    content: "▸";
    color: #e04a2a;
    flex: none;
    line-height: 1.5;
}


/* ============================================================
 * FORM-BANNER — bannières d'état globales (top du form)
 * ============================================================ */
.form-banner {
    position: relative;
    padding: 18px 22px 18px 26px;
    border: 1px solid;
    border-radius: 14px;
    font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.form-banner::before {
    font-family: "Fraunces", Georgia, serif;
    font-style: italic;
    font-size: 28px;
    line-height: 0.8;
    flex: none;
    margin-top: 2px;
}

.form-banner-error {
    background: #fdf2f5;
    border-color: rgba(90, 18, 36, 0.22);
    color: #4a0e1d;
}

.form-banner-error::before {
    content: "!";
    color: #e04a2a;
}

.form-banner-success {
    background: #f5f7f5;
    border-color: rgba(85, 105, 84, 0.28);
    color: #313b31;
}

.form-banner-success::before {
    content: "✓";
    color: #556954;
    font-style: normal;
    font-weight: 600;
}

.form-banner ul {
    margin: 0;
    padding-left: 18px;
    list-style: "—  ";
}

.form-banner ul li {
    padding-left: 4px;
}


/* ============================================================
 * FORM-ACTIONS — ligne du submit + mention légale en dessous
 * ============================================================ */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
}

.form-actions-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}


/* ============================================================
 * FORM-ASIDE — colonne metadata mono à droite d'un form
 * Reprend le pattern dl du CTA final home (Email/Téléphone/etc.)
 * ============================================================ */
.form-aside {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.form-aside-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 640px) {
    .form-aside-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.form-aside dt {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b6557;
    margin-bottom: 6px;
}

.form-aside dd {
    font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
    font-size: 14px;
    color: #0c0f1a;
    line-height: 1.5;
    margin: 0;
}

.form-aside dd a {
    color: inherit;
    text-decoration: none;
}

.form-aside-note {
    font-family: "Fraunces", Georgia, serif;
    font-style: italic;
    font-size: 18px;
    line-height: 1.4;
    color: #1b1e2a;
    padding-top: 24px;
    border-top: 1px solid rgba(12, 15, 26, 0.15);
    max-width: 36ch;
}

.form-aside-note strong {
    color: #5a1224;
    font-weight: 500;
}


/* ============================================================
 * RECAPTCHA — override style éditorial de la mention légale
 * (la classe .recaptcha-legal est définie dans recaptcha_badge.css)
 * ============================================================ */
.form-editorial .recaptcha-legal {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 10px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #6b6557;
    margin-top: 0;
}

.form-editorial .recaptcha-legal a {
    color: #5a1224;
    text-decoration: none;
    border-bottom: 1px solid rgba(90, 18, 36, 0.3);
    transition: border-color 0.2s ease;
}

.form-editorial .recaptcha-legal a:hover {
    border-bottom-color: #5a1224;
}
