/* Formulaire d'inscription à la newsletter (js/newsletter.js), posé sur
   l'accueil, la landing Halo et la page compte.

   Les pages du site n'ont pas les mêmes variables de thème : css/base.css
   déclare --surface / --text / --muted / --border, la landing Halo a les
   siennes. Les valeurs de repli ci-dessous (var(--x, …)) font que le
   formulaire reste lisible partout, y compris sur une page qui n'aurait
   aucune de ces variables. */

.nl-form {
  --nl-text: var(--text, #18181b);
  --nl-muted: var(--muted, #71717a);
  --nl-border: var(--border, #e4e4e7);
  --nl-surface: var(--surface, #ffffff);
  --nl-accent: var(--accent, #18181b);
  --nl-accent-text: var(--accent-text, #ffffff);
  --nl-radius: var(--radius-sm, 8px);
  color: var(--nl-muted);
  max-width: 420px;
}

.nl-title {
  margin: 0 0 6px;
  color: var(--nl-text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.nl-text { margin: 0 0 12px; font-size: 13px; line-height: 1.6; }

.nl-row { display: flex; gap: 8px; flex-wrap: wrap; }

.nl-input {
  flex: 1 1 180px;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  color: var(--nl-text);
  background: var(--nl-surface);
  border: 1px solid var(--nl-border);
  border-radius: var(--nl-radius);
  padding: 10px 12px;
  transition: border-color .2s ease;
}

.nl-input::placeholder { color: var(--nl-muted); opacity: .8; }

.nl-input:focus {
  outline: 2px solid var(--focus, #3b82f6);
  outline-offset: -1px;
  border-color: transparent;
}

.nl-input:disabled { opacity: .6; }

.nl-btn {
  flex: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--nl-accent-text);
  background: var(--nl-accent);
  border: 1px solid transparent;
  border-radius: var(--nl-radius);
  padding: 10px 18px;
  cursor: pointer;
  transition: transform .12s ease, filter .2s ease, opacity .2s ease;
}

.nl-btn:hover:not(:disabled) { filter: brightness(.88); }

.nl-btn:active:not(:disabled) { transform: scale(.97); }

.nl-btn:disabled { opacity: .5; cursor: default; }

.nl-msg {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  animation: nl-rise .25s ease both;
}

.nl-msg[data-kind="error"] { color: var(--danger, #dc2626); }

.nl-msg[data-kind="ok"] { color: var(--nl-text); font-weight: 500; }

.nl-legal { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; opacity: .85; }

.nl-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Pot de miel : hors de l'écran, mais pas display:none, que certains robots
   savent repérer. */
.nl-honey {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.nl-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes nl-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nl-msg { animation-duration: .01ms; }
}

/* Dans le pied de page de l'accueil : la colonne de marque est déjà étroite,
   le formulaire passe sous le texte sans déborder. */
.h-footer .nl-form { max-width: 320px; margin-top: 20px; }

/* Dans le pied de page de la landing Halo, qui a son propre jeu de variables
   (--color-*, voir css/halo.css) : on les branche ici plutôt que de recopier
   des valeurs, et le bouton prend l'orange de Halo. */
.site-footer .nl-form {
  --nl-text: var(--color-text);
  --nl-muted: var(--color-text-muted);
  --nl-surface: var(--color-glass);
  --nl-border: var(--color-border-strong);
  --nl-accent: var(--color-accent);
  --nl-accent-text: var(--color-on-accent);
  --nl-radius: var(--radius-small);
  font-family: var(--font-body);
  margin-top: 4px;
}
