/* ============================================================
   Réclamation — contraste et lisibilité
   La Ferme de Bouskoura

   Scoped to body.cg-rec-page so catalogue, product and home
   pages are untouched. Keeps the site fonts and cream / ink /
   green palette; only strengthens text, borders and focus so
   the form meets WCAG AA (4.5:1 body text, 3:1 UI borders).
   ============================================================ */

html:has(body.cg-rec-page),
body.cg-rec-page {
  color-scheme: light;
  background: #f5f2ec;
  color: #1c1c1a;
}

body.cg-rec-page,
body.cg-rec-page .cg-rec__panel,
body.cg-rec-page .cg-form,
body.cg-rec-page input,
body.cg-rec-page select,
body.cg-rec-page textarea,
body.cg-rec-page button {
  color-scheme: light;
}

/* Solid paper panel, clearly separated from the cream page */
body.cg-rec-page .cg-rec__panel {
  background: #fff;
  color: #1c1c1a;
  border: 1px solid #c8c4bb;
  box-shadow: 0 1px 0 rgba(28, 28, 26, .04);
}

/* ---- Muted text: labels, kickers, hints, footer headings ---- */
/* Was #77746c (4.18:1 on #f5f2ec, 4.47:1 on #fbfaf7) and
   hints #8a867c (3.48:1). #5c594f is 6.3:1+ on both. */
body.cg-rec-page .cg-kicker,
body.cg-rec-page .cg-label,
body.cg-rec-page .cg-field label,
body.cg-rec-page .cg-flabel,
body.cg-rec-page .cg-rec__alt,
body.cg-rec-page .cg-rec__alt a,
body.cg-rec-page .cg-hint,
body.cg-rec-page .cg-drop small,
body.cg-rec-page .cg-thumb__f,
body.cg-rec-page .cg-done__small,
body.cg-rec-page .cg-footer__h,
body.cg-rec-page .cg-footer__brand p:not(.cg-footer__logo),
body.cg-rec-page .cg-opt-l {
  color: #5c594f;
}

body.cg-rec-page .cg-opt-l {
  opacity: 1;
}

/* ---- Fields ---- */
body.cg-rec-page .cg-field input,
body.cg-rec-page .cg-field select,
body.cg-rec-page .cg-field textarea {
  color: #1c1c1a;
  background: #fff;
  border: 1px solid #6b675e;
  color-scheme: light;
}

body.cg-rec-page .cg-field--opt input,
body.cg-rec-page .cg-field--opt select,
body.cg-rec-page .cg-field--opt textarea {
  background: #fff;
  border-style: dashed;
  border-color: #6b675e;
}

body.cg-rec-page .cg-field input::placeholder,
body.cg-rec-page .cg-field textarea::placeholder,
body.cg-rec-page .cg-field select::placeholder {
  color: #5c594f;
  opacity: 1;
}

body.cg-rec-page .cg-field input:focus,
body.cg-rec-page .cg-field select:focus,
body.cg-rec-page .cg-field textarea:focus,
body.cg-rec-page .cg-field--opt input:focus,
body.cg-rec-page .cg-field--opt select:focus,
body.cg-rec-page .cg-field--opt textarea:focus {
  outline: none;
  background: #fff;
  border-style: solid;
  border-color: #1c1c1a;
  box-shadow: 0 0 0 3px rgba(95, 127, 74, .4);
}

body.cg-rec-page .has-err input,
body.cg-rec-page .has-err select,
body.cg-rec-page .has-err textarea {
  border-color: #a0442d;
  border-style: solid;
}

body.cg-rec-page .cg-field select option {
  background: #fff;
  color: #1c1c1a;
}

body.cg-rec-page .cg-field input:-webkit-autofill,
body.cg-rec-page .cg-field input:-webkit-autofill:hover,
body.cg-rec-page .cg-field input:-webkit-autofill:focus,
body.cg-rec-page .cg-field textarea:-webkit-autofill,
body.cg-rec-page .cg-field select:-webkit-autofill {
  -webkit-text-fill-color: #1c1c1a;
  caret-color: #1c1c1a;
  box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 9999s ease-out;
}

/* ---- Pills (Oui/Non, type de problème) ---- */
/* Inherited the muted label colour and a 1.45:1 border. */
body.cg-rec-page .cg-pill span {
  color: #1c1c1a;
  background: #fff;
  border-color: #6b675e;
}

body.cg-rec-page .cg-pill input:checked + span {
  background: #1c1c1a;
  color: #f5f2ec;
  border-color: #1c1c1a;
}

body.cg-rec-page .cg-pill input:focus-visible + span {
  outline: 2px solid #5f7f4a;
  outline-offset: 2px;
}

/* ---- Photo drop zone ---- */
body.cg-rec-page .cg-drop {
  background: #fff;
  border-color: #6b675e;
}

body.cg-rec-page .cg-drop span {
  color: #1c1c1a;
}

body.cg-rec-page .cg-drop:hover {
  border-color: #1c1c1a;
  background: #f7f4ee;
}

body.cg-rec-page .cg-drop:focus-within {
  border-color: #1c1c1a;
  box-shadow: 0 0 0 3px rgba(95, 127, 74, .4);
}

/* ---- Checkbox, errors, success, button (already passing; keep explicit) ---- */
body.cg-rec-page .cg-check {
  color: #3a3935;
}

body.cg-rec-page .cg-check input {
  accent-color: #1c1c1a;
}

body.cg-rec-page .cg-form__err {
  background: #f3e3dc;
  color: #7a3220;
}

body.cg-rec-page .cg-field__e {
  color: #a0442d;
}

body.cg-rec-page .cg-done {
  color: #1c1c1a;
}

body.cg-rec-page .cg-done p {
  color: #3a3935;
}

body.cg-rec-page .cg-btn {
  background: #1c1c1a;
  color: #f5f2ec !important;
  border-color: #1c1c1a;
}

body.cg-rec-page .cg-btn:hover {
  background: #5f7f4a;
  border-color: #5f7f4a;
  color: #fff !important;
}

body.cg-rec-page .cg-btn:focus-visible,
body.cg-rec-page .cg-btn--ghost:focus-visible {
  outline: 2px solid #5f7f4a;
  outline-offset: 3px;
}

body.cg-rec-page .cg-btn--ghost {
  background: transparent;
  color: #1c1c1a !important;
  border-color: #1c1c1a;
}

body.cg-rec-page .cg-btn--ghost:hover {
  background: #1c1c1a;
  color: #f5f2ec !important;
}
