/* =====================================================================
   Formulaire de contact TBNETSYS — feuille de style
   Aucune police externe, aucun CDN. Mobile-first, accessible (WCAG 2.1 AA).

   Choix : thème clair UNIQUEMENT, indépendant de la préférence OS.
   - color-scheme: light  → indique au navigateur d'utiliser ses
     contrôles natifs (autocomplete dropdown, scrollbar) en variante
     claire, même si l'OS est en dark mode.
   - Aucun bloc @media (prefers-color-scheme: dark) → notre CSS reste
     identique partout.
   Conséquence : un visiteur en dark mode OS verra un formulaire blanc
   sur sa page. Choix assumé pour cohérence visuelle.
   ===================================================================== */

:root {
    color-scheme: light;
}

.tb-form-wrap {
    max-width: 720px;
    margin: 2rem auto;
    padding: 1.5rem;
    font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #1c2733;
}

.tb-form-wrap h1 {
    margin: 0 0 0.5rem;
    font-size: 1.6rem;
    font-weight: 600;
    border-bottom: 2px solid #d8dee4;
    padding-bottom: 0.4rem;
}

/* ---- Phrase d'intro sous le H1 ----------------------------------- */
.tb-form-intro {
    margin: 0.25rem 0 1rem;
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* ---- Bandeau de statut ------------------------------------------- */
.tb-status {
    padding: 0.85rem 1rem;
    border-radius: 4px;
    margin: 1rem 0;
    border-left: 4px solid currentColor;
    font-weight: 500;
}
.tb-status.tb-ok    { background: #ecfdf5; color: #065f46; }
.tb-status.tb-error { background: #fef2f2; color: #991b1b; }

/* Duplicata du bandeau d'erreur juste au-dessus du bouton Envoyer.
   Permet au visiteur (qui a souvent déjà scrollé jusqu'en bas pour
   atteindre le bouton) de voir l'erreur sans avoir à remonter. */
.tb-status-bottom {
    margin-top: 1.25rem;
    margin-bottom: 0;
}

/* ---- Honeypot — invisible à l'œil mais accessible aux bots ------- */
.tb-honeypot {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---- Mise en page en grille -------------------------------------- */
.tb-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 1rem;
}
.tb-grid > p { margin: 0.5rem 0; }
.tb-full     { grid-column: 1 / -1; }

@media (max-width: 560px) {
    .tb-grid { grid-template-columns: 1fr; }
}

/* ---- Étiquettes et champs ---------------------------------------- */
.tb-form-wrap label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #2c3e50;
}
.tb-form-wrap input[type="text"],
.tb-form-wrap input[type="email"],
.tb-form-wrap input[type="tel"],
.tb-form-wrap select,
.tb-form-wrap textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 0.65rem;
    border: 1px solid #b8c0c9;
    border-radius: 4px;
    background: #fff;
    color: #1c2733;
    font: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tb-form-wrap select {
    /* Hauteur cohérente avec les inputs (les selects natifs varient
       selon les OS) ; on garde l'apparence native du chevron. */
    appearance: auto;
    cursor: pointer;
}
.tb-form-wrap input:focus,
.tb-form-wrap select:focus,
.tb-form-wrap textarea:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.18);
}
.tb-form-wrap textarea {
    resize: vertical;
    min-height: 8rem;
}
.tb-form-wrap .req {
    color: #b91c1c;
    font-weight: bold;
}

/* ---- Bloc de vérification humaine -------------------------------- */
.tb-question {
    display: block;
    background: #f1f5f9;
    border-left: 4px solid #2c3e50;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0 0.5rem;
    font-style: italic;
    color: #334155;
    border-radius: 2px;
}

/* ---- Consentement ------------------------------------------------ */
.tb-consent label {
    font-weight: 400;
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    line-height: 1.4;
}
.tb-consent input[type="checkbox"] {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

/* ---- Bouton d'envoi ---------------------------------------------- */
.tb-submit {
    margin-top: 1.5rem;
}
.tb-submit button {
    background: #2c3e50;
    color: #fff;
    border: 0;
    padding: 0.7rem 1.4rem;
    font: inherit;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}
.tb-submit button:hover,
.tb-submit button:focus {
    background: #1f2d3d;
    outline: none;
}

.tb-required-note {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 1rem;
}

/* ---- Page de récapitulatif (étape 1 → étape 2 du submit) --------- */
.tb-recap-intro {
    background: #fff7ed;
    border-left: 4px solid #f59e0b;
    padding: 0.85rem 1rem;
    margin: 1rem 0 1.5rem;
    color: #78350f;
    border-radius: 4px;
    line-height: 1.45;
}
.tb-recap-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.5rem 1.25rem;
    margin: 0 0 1.5rem;
}
.tb-recap-list dt {
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    align-self: start;
}
.tb-recap-list dd {
    margin: 0;
    color: #1c2733;
    word-break: break-word;
}
.tb-recap-message {
    white-space: pre-wrap;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.6rem 0.75rem;
}
/* Mise en relief de l'adresse e-mail (champ le plus exposé aux typos) */
.tb-recap-email-label {
    color: #b45309 !important;
}
.tb-recap-email-callout {
    display: block;
    font-weight: 400;
    font-size: 0.85rem;
    color: #92400e;
    margin-top: 0.15rem;
}
.tb-recap-email-value {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 4px;
    padding: 0.4rem 0.65rem;
    font-weight: 600;
    color: #78350f;
}
.tb-recap-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.tb-recap-form-modify,
.tb-recap-form-confirm { margin: 0; }
.tb-btn-primary,
.tb-btn-secondary {
    border: 0;
    padding: 0.7rem 1.4rem;
    font: inherit;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.tb-btn-primary {
    background: #2c3e50;
    color: #fff;
}
.tb-btn-primary:hover,
.tb-btn-primary:focus {
    background: #1f2d3d;
    outline: none;
}
.tb-btn-secondary {
    background: #fff;
    color: #2c3e50;
    border: 1px solid #2c3e50;
}
.tb-btn-secondary:hover,
.tb-btn-secondary:focus {
    background: #2c3e50;
    color: #fff;
    outline: none;
}
@media (max-width: 560px) {
    .tb-recap-list { grid-template-columns: 1fr; gap: 0.15rem 0; }
    .tb-recap-list dd { margin-bottom: 0.5rem; }
    .tb-recap-actions { flex-direction: column-reverse; }
    .tb-btn-primary, .tb-btn-secondary { width: 100%; }
}

/* ---- Animation réduite (préférence d'accessibilité) -------------- */
@media (prefers-reduced-motion: reduce) {
    .tb-form-wrap input,
    .tb-form-wrap textarea,
    .tb-submit button { transition: none; }
}

/* Note : pas de bloc @media (prefers-color-scheme: dark).
   Le formulaire reste en thème clair sur tous les appareils, OS dark
   ou light. Voir l'en-tête de fichier (color-scheme: light). */
