:root {
  --bg:            #f0f4f2;
  --surface:       #ffffff;
  --primary:       #10b981;
  --primary-dark:  #059669;
  --primary-rgb:   16, 185, 129;
  --primary-glow:  rgba(16,185,129,.32);
  --text:          #1f2937;
  --text-2:        #4b5563;
  --text-3:        #9ca3af;
  --line:          #e5e7eb;
  --input-bg:      #ffffff;
  --input-border:  #e5e7eb;
  --shadow:        0 2px 10px rgba(0,0,0,.05);
  --shadow-md:     0 6px 20px rgba(0,0,0,.07);
  --font-body:     'Outfit',sans-serif;
  --font-display:  'Fraunces',serif;
  --ease:          cubic-bezier(.22, 1, .36, 1);
}

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

html { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Atmospheric glows */
.bg-atmo {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  /* Couleur de base sombre : evite le flash clair avant que la photo ne soit chargee. */
  background-color: #1c2620;
}

/* Couche du dessous : la photo de fond (chevaux), isolee pour pouvoir apparaitre en
   fondu une fois decodee au lieu de surgir d'un coup. WebP pour les navigateurs
   modernes, JPEG progressif en repli. */
.bg-atmo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("../img/onboarding-bg.jpg");
  background-image: image-set(
    url("../img/onboarding-bg.webp") type("image/webp"),
    url("../img/onboarding-bg.jpg")  type("image/jpeg")
  );
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  animation: bgReveal .7s var(--ease) both;
}

/* Couche du dessus : voile sombre translucide (texte clair lisible par-dessus)
   + teinte verte de marque. Posee PAR-DESSUS la photo via un z-index superieur. */
.bg-atmo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 900px 600px at 65% -10%, rgba(16,185,129,.18) 0%, transparent 60%),
    radial-gradient(ellipse 650px 800px at -8% 92%,  rgba(16,185,129,.14) 0%, transparent 55%),
    linear-gradient(rgba(0,0,0,.42), rgba(0,0,0,.58));
}

@keyframes bgReveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-atmo::before { animation: none; }
}

/* Dot grid texture */
.bg-dots {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(6,78,59,.05) 1px, transparent 1px);
  background-size: 30px 30px;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* -- Nav -- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 56px);
  opacity: 0;
  animation: rise .5s var(--ease) .05s forwards;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--primary) 0%, #047857 100%);
  box-shadow: 0 4px 18px var(--primary-glow);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-icon svg { width: 22px; height: 22px; }

.login-link {
  font-size: .84rem;
  color: var(--text-2);
  background: var(--surface);
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition: border-color .2s, color .2s, box-shadow .2s;
}
.login-link:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow); }

/* -- Main -- */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px clamp(20px, 5vw, 56px) 20px;
}

.content {
  width: 100%;
  max-width: 468px;
}

/* Desktop (>=900px) : description a gauche, formulaire a droite.
   Mobile-first : en dessous, .content reste une seule colonne
   (description empilee au-dessus du formulaire). */
@media (min-width: 900px) {
  .content {
    max-width: 1040px;
    display: flex;
    align-items: center;
    gap: clamp(40px, 5vw, 72px);
  }
  .content-intro { flex: 1 1 0; max-width: 500px; }
  .content-intro .lead { margin-bottom: 0; }
  .form { flex: 0 0 430px; }
}

/* Gratuit badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px 9px 12px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid rgba(16,185,129,.30);
  font-size: .78rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 28px;
  letter-spacing: .03em;
  opacity: 0;
  animation: rise .6s var(--ease) .1s forwards;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  animation: heartbeat 2.2s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.55); }
  60%       { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
}

/* Heading */
.h1 {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 6vw, 3.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.026em;
  color: #ffffff;
  margin-bottom: 16px;
  text-wrap: balance;
  opacity: 0;
  animation: rise .6s var(--ease) .2s forwards;
}

.h1 .accent { color: var(--primary); }

.lead {
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(255,255,255,.86);
  max-width: 40ch;
  margin-bottom: 38px;
  opacity: 0;
  animation: rise .6s var(--ease) .3s forwards;
}

/* Form */
.form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  animation: rise .6s var(--ease) .4s forwards;
}

.field { margin-bottom: 14px; }

/* Honeypot anti-bot : retire de la vue et du flux sans display:none (certains
   bots ignorent les champs en display:none mais remplissent les autres). */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  height: 56px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 16px;
  padding: 0 20px;
  font-family: var(--font-body);
  font-size: .97rem;
  color: var(--text);
  outline: none;
  transition: border-color .25s, background .25s, box-shadow .25s;
}

.field input::placeholder { color: var(--text-3); }

.field input:focus {
  border-color: var(--primary);
  background: #f6fdfa;
  box-shadow: 0 0 0 4px rgba(16,185,129,.12);
}

.field textarea {
  width: 100%;
  min-height: 100px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 16px;
  padding: 14px 20px;
  font-family: var(--font-body);
  font-size: .97rem;
  color: var(--text);
  outline: none;
  resize: vertical;
  transition: border-color .25s, background .25s, box-shadow .25s;
}

.field textarea::placeholder { color: var(--text-3); }

.field textarea:focus {
  border-color: var(--primary);
  background: #f6fdfa;
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .12);
}

.field-hint {
  margin-top: 8px;
  font-size: .8rem;
  color: var(--text-3);
}

.btn {
  width: 100%;
  height: 58px;
  margin-top: 10px;
  border: none;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1.04rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 26px rgba(16,185,129,.42);
  transition: background .2s, transform .15s var(--ease), box-shadow .25s;
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 34px rgba(16,185,129,.52);
}

.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .7; cursor: not-allowed; transform: none; }

.btn svg {
  width: 18px; height: 18px;
  fill: none; stroke: white;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

.form-note {
  margin-top: 16px;
  text-align: center;
  font-size: .81rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.form-note svg {
  width: 13px; height: 13px;
  stroke: currentColor; fill: none; stroke-width: 2;
  flex-shrink: 0;
}

.offer-note {
  margin-top: 14px;
  text-align: center;
  font-size: .76rem;
  color: #6b7280;
}

.offer-note a {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(75,85,99,.35);
  transition: color .2s;
}

.offer-note a:hover { color: var(--primary-dark); }

/* -- Erreur serveur -- */
.form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: .88rem;
  color: #b91c1c;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-error svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none; stroke-width: 2;
  flex-shrink: 0;
}

/* -- Footer -- */
.foot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap; /* securite mobile : les badges passent a la ligne au lieu de deborder */
  gap: 10px clamp(18px, 4vw, 52px);
  padding: 18px clamp(20px, 5vw, 56px) 26px;
  opacity: 0;
  animation: rise .5s var(--ease) .7s forwards;
}

.trust {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .77rem;
  color: rgba(255,255,255,.88);
  white-space: nowrap;
}

.trust svg {
  width: 13px; height: 13px;
  stroke: currentColor; fill: none; stroke-width: 2;
  flex-shrink: 0;
}

/* -- Spinner (utilise pendant la soumission) -- */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin 1s linear infinite; }

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

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* -- Responsive -- */
@media (max-width: 480px) {
  .trust:nth-child(n+3) { display: none; }
  .login-link { padding: 8px 12px; font-size: .8rem; }
}

/* Marque onboarding alignee sur la page de connexion : badge 44px + nom 1.25rem. */
.brand-icon { width: 44px; height: 44px; border-radius: 12px; }
.brand-icon img { width: 80%; height: 80%; object-fit: contain; }
.brand { font-size: 1.25rem; }
