/* ==========================================================================
   Chambres d'Agriculture du Bénin — page de maintenance
   ========================================================================== */

:root {
  --green-50:  #f1f8f2;
  --green-100: #dcefdf;
  --green-200: #b7ddbe;
  --green-500: #2e8b57;
  --green-600: #1f6f45;
  --green-700: #164f31;
  --green-900: #0d3320;

  --sand:      #f6f4ee;
  --ink:       #1b241f;
  --muted:     #5c6b62;
  --line:      #e3e7e2;
  --white:     #ffffff;
  --danger:    #c0392b;

  --radius:    18px;
  --radius-sm: 12px;
  --shadow:    0 1px 2px rgba(13, 51, 32, .06), 0 14px 34px -12px rgba(13, 51, 32, .18);
  --shadow-lg: 0 2px 4px rgba(13, 51, 32, .07), 0 26px 60px -22px rgba(13, 51, 32, .28);
  --wrap:      1120px;
  --font:      "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--sand);
  background-image:
    radial-gradient(900px 420px at 8% -8%, var(--green-100), transparent 62%),
    radial-gradient(760px 380px at 104% 4%, #e8f1e2, transparent 60%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a { color: var(--green-600); text-decoration: none; }
a:hover { color: var(--green-700); }

h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.015em; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 22px;
}

/* Accessibilité ---------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--green-700);
  color: #fff;
  padding: 12px 18px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

:focus-visible {
  outline: 3px solid var(--green-500);
  outline-offset: 2px;
  border-radius: 6px;
}

/* En-tête ---------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
}

.brand { display: flex; align-items: center; }

.brand-logo {
  width: auto;
  height: 46px;
  border-radius: 8px;
  display: block;
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: .84rem;
  font-weight: 600;
  color: var(--green-700);
  background: var(--green-50);
  border: 1px solid var(--green-200);
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  color: var(--green-500);
  box-shadow: 0 0 0 0 rgba(46, 139, 87, .55);
  animation: pulse 2.4s ease-out infinite;
  flex: none;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 139, 87, .5); }
  70%  { box-shadow: 0 0 0 9px rgba(46, 139, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 139, 87, 0); }
}

/* Bandeau maintenance ---------------------------------------------------- */

.hero { padding: 62px 0 26px; }

.hero-inner { max-width: 780px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--green-700);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.35rem);
  font-weight: 800;
  margin: 0 0 18px;
}

.hl {
  color: var(--green-600);
  background: linear-gradient(180deg, transparent 62%, var(--green-100) 62%);
  padding-inline: 4px;
}

.lead {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: var(--muted);
  margin: 0 0 26px;
  max-width: 62ch;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0 0 30px;
  padding: 0;
}
.chips li {
  font-size: .86rem;
  font-weight: 600;
  color: var(--green-700);
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: 999px;
  padding: 7px 14px;
}

.progress {
  position: relative;
  height: 9px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  overflow: hidden;
  max-width: 520px;
}
.progress-bar {
  display: block;
  height: 100%;
  width: 70%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-500), var(--green-600));
  animation: load 1.6s cubic-bezier(.22, .9, .24, 1) both;
}
@keyframes load { from { width: 6%; } to { width: 70%; } }

/* Section contact -------------------------------------------------------- */

.contact { padding: 42px 0 72px; scroll-margin-top: 92px; }

.section-head { max-width: 660px; margin-bottom: 30px; }
.section-head h2 { font-size: clamp(1.45rem, 2.8vw, 2rem); font-weight: 800; margin-bottom: 10px; }
.section-head p { margin: 0; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 26px;
  align-items: start;
}
.grid-single { grid-template-columns: minmax(0, 640px); }

/* Cartes ----------------------------------------------------------------- */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}

.form-card { box-shadow: var(--shadow-lg); }

.card-title { font-size: 1.18rem; font-weight: 700; margin-bottom: 6px; }
.card-sub { margin: 0 0 22px; font-size: .87rem; color: var(--muted); }

/* Formulaire ------------------------------------------------------------- */

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field { margin-bottom: 16px; display: flex; flex-direction: column; }

.field label {
  font-size: .87rem;
  font-weight: 600;
  color: var(--green-900);
  margin-bottom: 7px;
}
.field label span { color: var(--green-500); }

.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: var(--green-50);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.field textarea { resize: vertical; min-height: 118px; }

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c6b62' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

.field input::placeholder,
.field textarea::placeholder { color: #9aa79f; }

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--green-200); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  background: var(--white);
  border-color: var(--green-500);
  box-shadow: 0 0 0 4px rgba(46, 139, 87, .14);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { outline: none; }

/* État d'erreur (renvoyé par la validation côté serveur) */
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
  background: #fdf3f2;
}
.field.has-error input:focus,
.field.has-error select:focus,
.field.has-error textarea:focus { box-shadow: 0 0 0 4px rgba(192, 57, 43, .14); }

.error {
  margin: 7px 0 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--danger);
}

/* Champ leurre : hors écran, jamais affiché */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Bouton ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
  padding: 14px 24px;
  font: inherit;
  font-size: .97rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(150deg, var(--green-600), var(--green-700));
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 12px 24px -12px rgba(22, 79, 49, .7);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.btn svg { width: 20px; height: 20px; transition: transform .16s ease; }
.btn:hover { filter: brightness(1.06); box-shadow: 0 16px 30px -12px rgba(22, 79, 49, .78); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .65; cursor: progress; }

.form-note { margin: 14px 0 0; font-size: .8rem; color: var(--muted); text-align: center; }

/* Messages serveur ------------------------------------------------------- */

.alert {
  margin: 0 0 18px;
  padding: 14px 16px;
  font-size: .92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  animation: fade .35s ease both;
}

.alert-success {
  color: var(--green-700);
  background: var(--green-50);
  border: 1px solid var(--green-200);
}

@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* Coordonnées ------------------------------------------------------------ */

.info-card { position: relative; overflow: hidden; }
.info-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--green-500), var(--green-700));
}

.info {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 15px 16px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--green-50);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
a.info:hover {
  border-color: var(--green-200);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.info .ico { color: var(--green-600); flex: none; width: 22px; margin-top: 3px; }
.info .ico svg { width: 22px; height: 22px; }

.info-text { display: flex; flex-direction: column; min-width: 0; }
.info-text small {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.info-text strong { font-size: 1.02rem; color: var(--ink); }
.info-text em { font-style: normal; font-size: .85rem; color: var(--muted); }

/* Le téléphone mis en avant */
.info.phone {
  background: linear-gradient(150deg, var(--green-600), var(--green-700));
  border-color: transparent;
  color: #fff;
}
.info.phone .ico { color: #bff0cf; }
.info.phone .info-text small { color: #a9dcbd; }
.info.phone .info-text strong { color: #fff; font-size: 1.22rem; letter-spacing: .01em; }
a.info.phone:hover { filter: brightness(1.07); }

.urgence {
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: .88rem;
  color: var(--muted);
}
.urgence strong { color: var(--green-700); }
.urgence a { font-weight: 700; white-space: nowrap; }

/* Pied de page ----------------------------------------------------------- */

.site-footer {
  background: var(--green-900);
  color: #cfe6d8;
  padding: 26px 0;
  font-size: .85rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}
.footer-inner p { margin: 0; }

/* Responsive ------------------------------------------------------------- */

@media (max-width: 940px) {
  .grid { grid-template-columns: 1fr; }
  .hero { padding-top: 46px; }
}

@media (max-width: 560px) {
  .header-inner { flex-wrap: wrap; padding-block: 12px; min-height: 0; }
  .header-status { order: 3; }
  .hero { padding: 34px 0 18px; }
  .card { padding: 22px; border-radius: 16px; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .contact { padding-bottom: 52px; }
}

/* Animations douces ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* Thème sombre ----------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root {
    --sand:  #0e1512;
    --ink:   #e8efe9;
    --muted: #9fb0a6;
    --line:  #24322b;
    --white: #161f1b;
    --green-50: #18241d;
    --green-100: #1d3226;
    --green-200: #2b4a37;
    --green-900: #0a120e;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 14px 34px -12px rgba(0,0,0,.55);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.45), 0 26px 60px -22px rgba(0,0,0,.7);
  }
  body {
    background-image:
      radial-gradient(900px 420px at 8% -8%, #16261c, transparent 62%),
      radial-gradient(760px 380px at 104% 4%, #14211a, transparent 60%);
  }
  .site-header { background: rgba(14, 21, 18, .88); }
  .field input, .field select, .field textarea { color: var(--ink); }
  .field input:focus, .field select:focus, .field textarea:focus { background: #1b2620; }
  .field.has-error input, .field.has-error select, .field.has-error textarea { background: #2a1a18; }
  .field label { color: #cfe6d8; }
  .field input::placeholder,
  .field textarea::placeholder { color: #7d8f85; }
  .field select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239fb0a6' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }
  .info.phone .info-text strong { color: #fff; }
}
