/* ============================================================
   VARIABLES — modifie ici pour changer les couleurs globalement
   ============================================================ */
:root {
  --bg:        #f2ede4;   /* fond de page */
  --paper:     #faf7f1;   /* fond de la carte */
  --border:    #ddd4c0;   /* bordures */
  --green:     #1eb564;   /* Wenergy (layout plateforme) */
  --green-dk:  #159652;
  --green-lt:  #eaf8f0;   /* fond léger vert (newsletter toggle) */
  --text:      #28231e;   /* texte principal */
  --muted:     #8a7f6e;   /* texte secondaire / labels */
  --error:     #b84040;   /* rouge pour les champs manquants */
  --radius:    10px;      /* arrondi des champs et boutons */
}


/* ============================================================
   RESET + BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  background-color: var(--bg);

  /* Dégradés subtils dans les coins pour un effet organique */
  background-image:
    radial-gradient(ellipse 70% 55% at 5% 0%,   rgba(80,115,70,0.08)  0%, transparent 55%),
    radial-gradient(ellipse 55% 50% at 95% 100%, rgba(170,148,100,0.1) 0%, transparent 50%);

  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* Texture de points discrets sur tout le fond */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(80,60,30,0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}


/* ============================================================
   MISE EN PAGE
   ============================================================ */
.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 490px;
}


/* ============================================================
   LOGO WENERGY (au-dessus de la carte)
   ============================================================ */
.brand-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 22px;
}

.brand-logo__img {
  display: block;
  width: min(220px, 70vw);
  height: auto;
  object-fit: contain;
}


/* ============================================================
   CARTE PRINCIPALE
   ============================================================ */
.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 42px 40px 38px;
  box-shadow:
    0 2px 4px  rgba(0,0,0,0.03),
    0 12px 40px rgba(60,45,20,0.09),
    0 40px 80px rgba(60,45,20,0.04);

  /* Animation d'apparition au chargement */
  animation: rise 0.55s cubic-bezier(.22,1,.36,1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   EN-TÊTE
   ============================================================ */

/* Petite ligne "Prise de contact" avec tirets de chaque côté */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 12px;
}

.eyebrow::before,
.eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(30,181,100,0.22);
}

h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(24px, 5vw, 31px);
  font-weight: 500;
  line-height: 1.22;
  color: var(--text);
  margin-bottom: 8px;
}

h1 em {
  font-style: italic;
  color: var(--green);
}

.subtitle {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 28px;
}

/* Séparateur ✦ entre l'intro et le formulaire */
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  font-size: 14px;
  opacity: 0.35;
}


/* ============================================================
   CHAMPS DU FORMULAIRE
   ============================================================ */
.field {
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

label .req {
  color: var(--green); /* astérisque obligatoire */
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--text);
  font-family: 'Jost', sans-serif;
  font-size: 14.5px;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30,181,100,0.12);
}

/* Champ manquant au moment de la validation */
input.error,
textarea.error {
  border-color: var(--error);
}

input::placeholder,
textarea::placeholder {
  color: #c8bfb0;
}

textarea {
  resize: vertical;
  min-height: 84px;
}


/* ============================================================
   TOGGLE NEWSLETTER
   ============================================================ */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--green-lt);
  border: 1px solid rgba(30,181,100,0.2);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin: 18px 0 26px;
  cursor: pointer;
  user-select: none;
}

/* Cache la vraie checkbox — remplacée par .knob */
.toggle-wrap input {
  display: none;
}

/* Le slider visuel */
.knob {
  width: 36px;
  height: 20px;
  background: #c8bfb0;
  border-radius: 99px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.25s;
}

.knob::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}

/* Quand la checkbox est cochée → fond vert + cercle à droite */
#newsletter:checked ~ .knob              { background: var(--green); }
#newsletter:checked ~ .knob::after      { transform: translateX(16px); }

.toggle-text {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 400;
}

.toggle-text small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}


/* ============================================================
   BOUTON D'ENVOI
   ============================================================ */
button#submitBtn {
  width: 100%;
  background: var(--green);
  color: #fff;
  font-family: 'Jost', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius);
  padding: 15px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s, transform 0.15s;
}

button#submitBtn:hover:not(:disabled) {
  background: var(--green-dk);
  transform: translateY(-1px);
}

button#submitBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-arrow {
  transition: transform 0.2s;
}

button#submitBtn:hover .btn-arrow {
  transform: translateX(4px);
}

/* Mention RGPD sous le bouton */
.mention {
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 16px;
  line-height: 1.5;
}


/* ============================================================
   MESSAGE DE SUCCÈS (affiché après envoi)
   ============================================================ */
#successMsg {
  display: none;
  text-align: center;
  padding: 20px 0 6px;
  animation: rise 0.5s cubic-bezier(.22,1,.36,1) both;
}

.success-circle {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: var(--green-lt);
  border: 1px solid rgba(30,181,100,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 28px;
}

#successMsg h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
}

#successMsg p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}


/* ============================================================
   TOAST (notification d'erreur en bas de page)
   ============================================================ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--text);
  color: #faf7f1;
  padding: 11px 22px;
  border-radius: 99px;
  font-size: 13.5px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 99;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ============================================================
   RESPONSIVE MOBILE
   ============================================================ */
@media (max-width: 480px) {
  .card {
    padding: 30px 20px 26px;
  }
}
