/* =====================================================
   FORM_BTN.CSS — Styles partagés formulaires + boutons
   Design "Aplats" — utilisé sur tout le site
   Dépend de : main2.css (:root)
   ===================================================== */


/* =====================================================
   LABELS
   ===================================================== */
label,
.form-label,
form label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--bs-gray-dark);
  margin-top: 0;
  margin-bottom: 4px;
}

/* Icône SVG générique */
label::before,
.form-label::before,
form label::before {
  content: '';
  width: 14px; height: 14px;
  flex-shrink: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.38;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2323432E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'%3E%3C/path%3E%3Cpolyline points='14 2 14 8 20 8'%3E%3C/polyline%3E%3C/svg%3E");
}
/* Icônes contextuelles */
label[for*="date"]::before,
.info-date::before,.article-compte .info-viste::before,
.article-compte .info:not([class*="info-"])::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2323432E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
}

label[for="ecole"]::before,
.article-compte .info-ecole::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2323432E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'%3E%3C/path%3E%3Cpolyline points='9 22 9 12 15 12 15 22'%3E%3C/polyline%3E%3C/svg%3E");
}

label[for="adresse_ecole"]::before,
.article-compte .info-adresse::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2323432E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3'%3E%3C/circle%3E%3C/svg%3E");
}

label[for*="enseignant"]::before,
label[for*="directeur"]::before,
label[for*="accompagnant"]::before,
label[for*="enfant"]::before,
.info-enseignant::before,
.info-directeur::before,
.info-accompagnant::before,
.info-enfant::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2323432E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E");
}

label[for*="mail"]::before,
label[for*="email"]::before,
.info-mail::before,
.info-email::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2323432E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'%3E%3C/path%3E%3Cpolyline points='22,6 12,13 2,6'%3E%3C/polyline%3E%3C/svg%3E");
}

label[for*="tel"]::before,
.info-tel::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2323432E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'%3E%3C/path%3E%3C/svg%3E");
}

label[for*="age"]::before,
.info-age::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2323432E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
}

label[for="classe"]::before,
.article-compte .info-classe::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2323432E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'%3E%3C/rect%3E%3Cline x1='9' y1='9' x2='15' y2='9'%3E%3C/line%3E%3Cline x1='9' y1='13' x2='15' y2='13'%3E%3C/line%3E%3C/svg%3E");
}

/* =====================================================
   INPUTS / SELECTS / TEXTAREAS
   Fond : --lin (chaud, reposant)
   Focus : --sand + border forêt franche
   Readonly : quasi-transparent + dashed + italic
   ===================================================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="search"],
input[type="file"],
select,
textarea,
.form-control {
  display: block;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-dark);
  background: var(--bs-gray-200);
  border: none;
  border-bottom: 2px solid rgba(35,67,46,0.20);
  border-radius: 0;
  box-shadow: none;
  outline: none;
  font-family: inherit;
  margin-bottom: var(--space-sm);
  transition: background var(--transition), border-color var(--transition);
  -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus {
  background: var(--gray-300);
  border-bottom-color: var(--forest);
  outline: none;
  box-shadow: none;
}

input:hover:not([readonly]):not(:disabled):not(:focus),
select:hover:not(:disabled):not(:focus),
textarea:hover:not([readonly]):not(:disabled):not(:focus) {
  border-bottom-color: rgba(35,67,46,0.45);
}

textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.65;
}

/* Select — flèche custom */
select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2323432E' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right var(--space-sm) center;
  background-size: 12px;
  padding-right: calc(var(--space-lg) + 4px);
}

/* Readonly */
input[readonly],
textarea[readonly] {
  background: rgba(35,67,46,0.04);
  border-bottom: 2px dashed rgba(35,67,46,0.14);
  color: rgba(35,67,46,0.38);
  cursor: not-allowed;
  font-style: italic;
  font-weight: 400;
}
input[readonly]:hover,
textarea[readonly]:hover {
  border-bottom-color: rgba(35,67,46,0.14);
}

/* Disabled */
input:disabled,
select:disabled,
textarea:disabled {
  background: rgba(35,67,46,0.03);
  border-bottom-color: rgba(35,67,46,0.08);
  color: rgba(35,67,46,0.28);
  cursor: not-allowed;
}

/* Placeholder */
input::placeholder,
textarea::placeholder {
  color: rgba(35,67,46,0.25);
  font-style: italic;
  font-weight: 300;
}

/* File input */
input[type="file"] {
  padding: var(--space-sm) 0;
  font-size: 0.80rem;
  color: rgba(35,67,46,0.50);
  background: transparent;
  border-bottom-color: rgba(35,67,46,0.12);
  cursor: pointer;
}


/* =====================================================
   FORM GROUP
   ===================================================== */
.form-group,
.mb-3 {
  position: relative;
}


/* =====================================================
   BOUTONS — système unifié Aplats
   Base commune → variantes par classe
   ===================================================== */
.button,
.btn,
button[type="submit"],
button[type="button"],
input[type="submit"],
a.button,
.wp-core-ui .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  height: 44px;
  padding: 0 var(--space-md);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: inherit;
  border: none;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    opacity var(--transition);
  -webkit-appearance: none;
}

/* ── Primaire — forêt × layette ── */
.button-primary,
.btn-primary,
button[type="submit"].button-primary,
input[type="submit"],
.wp-core-ui .button-primary {
  background: var(--forest);
  color: var(--pink);
  border: none;
}
.button-primary:hover,
.btn-primary:hover,
.wp-core-ui .button-primary:hover {
  background: var(--forest-mid);
  color: var(--pink);
  opacity: 1;
  text-decoration: none;
}
.button-primary:focus,
.btn-primary:focus {
  background: var(--forest-mid);
  color: var(--pink);
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

/* ── Secondaire — ghost forêt ── */
.button-secondary,
.btn-secondary,
.wp-core-ui .button:not(.button-primary) {
  background: transparent;
  color: rgba(35,67,46,0.60);
  border: 1.5px solid rgba(35,67,46,0.22);
}
.button-secondary:hover,
.btn-secondary:hover {
  background: var(--forest);
  color: var(--pink);
  border-color: var(--forest);
  opacity: 1;
  text-decoration: none;
}
.button-secondary:focus,
.btn-secondary:focus {
  background: var(--forest);
  color: var(--pink);
  border-color: var(--forest);
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}

/* ── Danger — terracotta ── */
.button-danger,
.btn-danger {
  background: var(--terracotta);
  color: var(--white);
  border: none;
}
.button-danger:hover,
.btn-danger:hover {
  background: #d4784d;
  color: var(--white);
  opacity: 1;
}
.button-danger:focus,
.btn-danger:focus {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

/* ── Texte — lien discret ── */
.btn-text {
  background: none;
  color: rgba(35,67,46,0.55);
  height: auto;
  padding: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: underline;
  text-underline-offset: 3px;
  border: none;
}
.btn-text:hover { color: var(--forest); opacity: 1; }

/* ── Submit avec icône SVG (flex natif, pas position absolute) ── */
.btn-submit {
  height: auto;
  padding: var(--space-md) var(--space-lg);
  background: var(--forest);
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  gap: 14px;
  transition: background var(--transition), transform var(--transition);
}
.btn-submit::before {
  content: '';
  display: block;
  flex-shrink: 0;
  width: 20px; height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z'%3E%3C/path%3E%3Cpolyline points='17 21 17 13 7 13 7 21'%3E%3C/polyline%3E%3Cpolyline points='7 3 7 8 15 8'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.80;
}
.btn-submit:hover { background: var(--black); transform: translateY(-2px); }

/* ── IA Search — rose layette → terracotta, flèche animée ── */
.hp-search__btn {
  height: auto;
  padding: 14px 28px;
  background: var(--pink);
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  gap: 10px;
  flex-shrink: 0;
  transition: background 0.22s, transform 0.18s;
}
.hp-search__btn::after {
  content: '→';
  font-size: 1em;
  transition: transform 0.2s;
}
.hp-search__btn:hover { background: var(--terracotta); transform: translateX(2px); }
.hp-search__btn:hover::after { transform: translateX(4px); }

/* ── IA Mistral ✨ — ghost rose sur fond sombre, barre tricolore ── */
.btn-mistral-correct {
    position: relative;
    height: auto;
    padding: var(--space-xs) var(--space-md) !important;
    background: rgba(249, 200, 208, 0.05);
    color: rgba(249, 200, 208, 0.60);
    border: 1px solid rgba(249, 200, 208, 0.15) !important;
    gap: 8px !important;
    overflow: hidden;
    transition: background var(--transition), border-color var(--transition), color var(--transition) !important;
}
.btn-mistral-correct::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--pink)       0%   33%,
    var(--terracotta) 33%  66%,
    var(--violet)     66%  100%
  );
  opacity: 0;
  transition: opacity var(--transition);
}
.btn-mistral-correct:hover:not(:disabled) {
  background: rgba(249,200,208,0.10);
  border-color: rgba(249,200,208,0.35);
  color: var(--pink);
}
.btn-mistral-correct:hover:not(:disabled)::before { opacity: 1; }
.btn-mistral-correct:disabled { opacity: 0.40; cursor: wait; }
.mistral-icon { font-size: 0.85rem; opacity: 0.80; }

/* ── Désactivé ── */
.button:disabled,
.btn:disabled,
button:disabled,
input[type="submit"]:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Loading spinner ── */
button.loading::after {
  content: '';
  display: inline-block;
  width: 11px; height: 11px;
  border: 2px solid transparent;
  border-radius: 50%;
  border-top-color: currentColor;
  animation: btn-spin 0.8s linear infinite;
  margin-left: 6px;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }


/* =====================================================
   LIENS — avec flèche animée
   ===================================================== */
.link-arrow {
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--forest);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(35,67,46,0.25);
  padding-bottom: 2px;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.link-arrow::after {
  content: '→';
  transition: transform 0.2s;
}
.link-arrow:hover {
  color: var(--terracotta);
  border-color: var(--terracotta);
  text-decoration: none;
  opacity: 1;
}
.link-arrow:hover::after { transform: translateX(4px); }


/* =====================================================
   BOUTONS ICÔNES — actions sur liste
   Cercles 44×44px, SVG blanc centré
   ===================================================== */
.liste_cr, .exporter, .modifier, .supprimer {
    width: 44px;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50% !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: transform var(--transition), background-color var(--transition), opacity var(--transition) !important;
    background-size: 18px 18px;
    background-position: center;
    background-repeat: no-repeat;
    font-size: 0;
    text-indent: -9999px;
    overflow: hidden;
    letter-spacing: 0;
    text-transform: none;
}

.supprimer {
  background-color: var(--terracotta);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'%3E%3C/polyline%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'%3E%3C/path%3E%3Cline x1='10' y1='11' x2='10' y2='17'%3E%3C/line%3E%3Cline x1='14' y1='11' x2='14' y2='17'%3E%3C/line%3E%3C/svg%3E");
}
.supprimer:hover { background-color: #d4784d; transform: scale(1.06); }

.modifier {
  background-color: var(--forest);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'%3E%3C/path%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'%3E%3C/path%3E%3C/svg%3E");
}
.modifier:hover { background-color: var(--forest-mid); transform: scale(1.06); }

.exporter {
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2323432E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'%3E%3C/path%3E%3Cpolyline points='7 10 12 15 17 10'%3E%3C/polyline%3E%3Cline x1='12' y1='15' x2='12' y2='3'%3E%3C/line%3E%3C/svg%3E");
  border: 1.5px solid rgba(35,67,46,0.25) !important;
}
.exporter:hover {
  background-color: var(--forest);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'%3E%3C/path%3E%3Cpolyline points='7 10 12 15 17 10'%3E%3C/polyline%3E%3Cline x1='12' y1='15' x2='12' y2='3'%3E%3C/line%3E%3C/svg%3E");
  border-color: var(--forest) !important;
  transform: scale(1.06);
  opacity: 1;
}


/* =====================================================
   ALERTES
   ===================================================== */
.alert,
.message,
#form-message {
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  font-size: 0.875rem;
  border-left: 3px solid var(--terracotta);
  background: rgba(232,149,106,0.08);
  color: var(--forest);
  animation: alert-in 0.3s ease;
}
.alert-success,
.message.success,
#form-message.success {
  border-left-color: var(--forest);
  background: rgba(35,67,46,0.06);
}
.alert-danger,
.alert-error,
.message.error,
#form-message.error {
  border-left-color: var(--terracotta);
  background: rgba(232,149,106,0.08);
}
.alert-warning { border-left-color: var(--honey);  background: rgba(212,168,71,0.08); }
.alert-info    { border-left-color: var(--violet); background: rgba(155,126,184,0.08); }

@keyframes alert-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* =====================================================
   AUTOCOMPLETE
   ===================================================== */
.autocomplete-dropdown,
#ecole-autocomplete-dropdown {
  position: absolute;
  top: 100%; left: 0; right: 0;
  z-index: 9999;
  background: var(--white);
  border-top: 1px solid rgba(35,67,46,0.08);
  list-style: none;
  margin: 0; padding: 0;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(35,67,46,0.12);
  display: none;
}
.autocomplete-dropdown.show { display: block; }

.autocomplete-dropdown li {
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  border-bottom: 1px solid rgba(35,67,46,0.05);
  font-size: 0.875rem;
  color: var(--forest);
  transition: background var(--transition);
}
.autocomplete-dropdown li:hover,
.autocomplete-dropdown li.active  { background: var(--lin); }
.autocomplete-dropdown li.no-results {
  color: rgba(35,67,46,0.35);
  font-style: italic;
  cursor: default;
  background: transparent;
}
.autocomplete-item .item-name    { font-weight: 600; }
.autocomplete-item .item-address { font-size: 0.80em; opacity: 0.55; }
.autocomplete-item strong        { color: var(--terracotta); }


/* =====================================================
   TinyMCE — palette Aplats
   ===================================================== */
.wp-editor-wrap  { margin-bottom: var(--space-lg); }
.wp-editor-tabs  { display: none; }

.wp-switch-editor {
  background: transparent;
  border: none;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.70rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(35,67,46,0.38);
  cursor: pointer;
  transition: color var(--transition);
}
.wp-switch-editor:hover,
.wp-switch-editor[aria-pressed="true"] {
  color: var(--forest);
  border-bottom: 2px solid var(--forest);
}

.mce-tinymce  { border-radius: 0 !important; box-shadow: none !important; border: 1px solid rgba(35,67,46,0.12) !important; }
.mce-panel    { background: var(--white) !important; box-shadow: none !important; }
.mce-toolbar,
.mce-toolbar-grp { background: var(--lin) !important; padding: 6px !important; box-shadow: none !important; }
.mce-toolbar .mce-btn              { background: transparent !important; border: none !important; border-radius: 0 !important; color: var(--forest) !important; transition: background var(--transition) !important; }
.mce-toolbar .mce-btn:hover        { background: rgba(35,67,46,0.10) !important; }
.mce-toolbar .mce-btn.mce-active   { background: var(--forest) !important; color: var(--pink) !important; }
.mce-toolbar .mce-ico              { color: inherit !important; }
.mce-window              { border-radius: 0 !important; box-shadow: 0 8px 32px rgba(0,0,0,0.15) !important; border: 1px solid rgba(35,67,46,0.15) !important; }
.mce-window-head         { background: var(--lin) !important; border-bottom: 1px solid rgba(35,67,46,0.10) !important; }
.mce-window-head .mce-title       { color: var(--forest) !important; text-transform: uppercase !important; letter-spacing: 0.10em !important; font-weight: 400 !important; }
.mce-window-head .mce-close       { color: var(--forest) !important; opacity: 0.5 !important; }
.mce-window-head .mce-close:hover { opacity: 1 !important; }
.mce-window .mce-btn.mce-primary              { background: var(--forest) !important; border-color: var(--forest) !important; }
.mce-window .mce-btn.mce-primary button       { color: var(--pink) !important; }
.mce-window .mce-btn:not(.mce-primary)        { background: transparent !important; border: 1.5px solid rgba(35,67,46,0.15) !important; }
.mce-window .mce-btn:not(.mce-primary):hover  { background: var(--lin) !important; }
.mce-textbox,
.mce-container input[type="text"] { background: var(--lin) !important; border: none !important; border-radius: 0 !important; color: var(--forest) !important; }
.mce-fade,
.mce-backdrop { background: rgba(0,0,0,0.55) !important; backdrop-filter: blur(2px) !important; }
.mce-window *, .mce-panel *, .mce-btn *, .mce-textbox { box-shadow: none !important; }


/* =====================================================
   WP CORE UI
   ===================================================== */
.wp-core-ui .button-primary       { background: var(--forest); color: var(--pink); border-color: var(--forest); }
.wp-core-ui .button-primary:hover { background: var(--forest-mid); border-color: var(--forest-mid); color: var(--pink); }


/* =====================================================
   ACCESSIBILITÉ
   ===================================================== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
  *, input, select, textarea, button {
    animation: none !important;
    transition: none !important;
  }
}


/* =====================================================
   RESPONSIVE — évite le zoom iOS sur focus
   ===================================================== */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="date"],
  input[type="tel"],
  select,
  textarea { font-size: 1rem; }
}
/* =====================================================
   AUTOCOMPLETE ÉCOLES — dropdown
   Dépend de : main2.css (:root) + form_btn.css
   ===================================================== */

/* ── Wrapper positionné ── */
.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

/* ── Dropdown ── */
#ecole-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 9999;

  background: var(--white);
  border: none;
  border-left: 3px solid var(--forest);
  border-bottom: 2px solid rgba(35,67,46,0.12);
  box-shadow:
    0 8px 24px rgba(35,67,46,0.10),
    0 2px 6px rgba(35,67,46,0.06);

  list-style: none;
  margin: 0;
  padding: 0;

  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;

  display: none;

  /* Animation entrée */
  animation: dropdown-in 0.18s ease;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scrollbar discrète */
#ecole-autocomplete-dropdown::-webkit-scrollbar {
  width: 4px;
}
#ecole-autocomplete-dropdown::-webkit-scrollbar-track {
  background: var(--lin);
}
#ecole-autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: rgba(35,67,46,0.20);
}
#ecole-autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--forest-mid);
}

/* ── Item ── */
#ecole-autocomplete-dropdown li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  border-bottom: 1px solid rgba(35,67,46,0.05);
  transition: background var(--transition), border-left-color var(--transition);
  position: relative;
}

#ecole-autocomplete-dropdown li:last-child {
  border-bottom: none;
}

/* Hover */
#ecole-autocomplete-dropdown li:hover {
  background: var(--lin);
}

/* Focus clavier */
#ecole-autocomplete-dropdown li:focus,
#ecole-autocomplete-dropdown li.active {
  background: rgba(245,236,215,0.70);
  outline: none;
}
#ecole-autocomplete-dropdown li.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--forest);
}

/* ── Nom de l'école ── */
#ecole-autocomplete-dropdown li .item-name,
#ecole-autocomplete-dropdown li:not(:has(.item-name)) {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--forest);
  line-height: 1.3;
}

/* ── Adresse ── */
#ecole-autocomplete-dropdown li .item-address {
  font-size: 0.72rem;
  font-weight: 400;
  color: rgba(35,67,46,0.45);
  font-style: italic;
  line-height: 1.3;
}

/* ── Highlight du terme recherché ── */
#ecole-autocomplete-dropdown li strong,
#ecole-autocomplete-dropdown li mark {
  font-weight: 800;
  color: var(--terracotta);
  background: none;
  padding: 0;
}

/* ── Aucun résultat ── */
#ecole-autocomplete-dropdown li.no-results {
  font-size: 0.78rem;
  font-weight: 400;
  color: rgba(35,67,46,0.35);
  font-style: italic;
  cursor: default;
  background: transparent;
  padding: var(--space-md);
  text-align: center;
}
#ecole-autocomplete-dropdown li.no-results::before {
  display: none;
}

/* ── Compteur en bas — optionnel ── */
#ecole-autocomplete-dropdown::after {
  content: attr(data-count);
  display: block;
  padding: 6px var(--space-md);
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(35,67,46,0.25);
  background: var(--gray-light);
  border-top: 1px solid rgba(35,67,46,0.06);
  position: sticky;
  bottom: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #ecole-autocomplete-dropdown {
    max-height: 220px;
  }
  #ecole-autocomplete-dropdown li {
    padding: var(--space-sm);
  }
}