/* Newsletter signup (20/11/2026; redesigned the same day: Leo, «questa sezione è orribile, ridisegnala con lo stile del
   sito e metti badge ufficiali»; moved the same day from the footer to the hero, right after the download control: Leo,
   «mettilo in alto, dopo Download, e mettilo in tutte le pagine»).
   Linked, after the page's last stylesheet, by every page that carries <form class="newsletter">: the block must not
   depend on shared.css, site.css or theme.css, so every colour has a light-dark() fallback.
   The form ships with `hidden` and newsletter.js reveals it, so without JavaScript nothing is shown.
   The Apple and Google buttons follow the brands' guidelines for custom buttons (Apple HIG «Sign in with Apple»,
   Google «Sign in with Google» branding, Microsoft «Sign in with Microsoft» branding): their logos are inline SVG in
   the page, their colours are fixed below. */

.newsletter {
  --nl-ink: var(--ink, light-dark(oklch(0.2 0.01 90), oklch(0.96 0.004 90)));
  --nl-body: var(--body, light-dark(oklch(0.42 0.01 90), oklch(0.8 0.008 90)));
  --nl-muted: var(--muted, light-dark(oklch(0.5 0.01 90), oklch(0.7 0.008 90)));
  --nl-line: var(--line, light-dark(oklch(0.9 0.005 90), oklch(0.32 0.006 90)));
  --nl-surface: var(--surface, light-dark(oklch(0.99 0.004 90), oklch(0.215 0.006 90)));
  --nl-bg: var(--bg, light-dark(oklch(0.965 0.004 90), oklch(0.17 0.006 90)));
  --nl-accent: var(--accent, light-dark(oklch(0.45 0.12 155), oklch(0.8 0.13 155)));
  --nl-error: light-dark(oklch(0.5 0.18 27), oklch(0.75 0.14 27));
  position: relative;
  box-sizing: border-box;
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 640px;
  /* In the hero's text column, under the download buttons: never wider than the column, never stretched past 640px.
     Left-aligned heroes keep it at the left edge; centred ones (flex columns with align-items: center) centre it. */
  min-width: 0;
  margin: 24px 0 0;
  padding: 24px 26px;
  border: 1px solid var(--nl-line);
  border-radius: 18px;
  background: var(--nl-surface);
  font-family: "Hanken Grotesk", sans-serif;
  text-align: left;
}
/* The homepage hero column (.hero-copy.cascade) and download.html's header (.guide-hero) already space their children with a gap. */
.hero-copy.cascade > .newsletter, .guide-hero > .newsletter { margin-top: 0; }
.newsletter *, .newsletter *::before, .newsletter *::after { box-sizing: border-box; }
.newsletter[hidden], .newsletter [hidden] { display: none !important; }

.newsletter .newsletter-title { display: block; margin: 0; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 21px; line-height: 1.2; letter-spacing: -0.01em; color: var(--nl-ink); }
.newsletter .newsletter-note { margin: -6px 0 0; max-width: none; font-size: 15px; line-height: 1.55; color: var(--nl-body); text-wrap: pretty; }
.newsletter-note a, .newsletter-note a:hover { color: inherit; text-decoration: underline; text-decoration-color: var(--nl-muted); text-underline-offset: 3px; }
.newsletter-note a:hover { color: var(--nl-ink); text-decoration-color: currentColor; }

.newsletter-row { display: flex; gap: 10px; align-items: stretch; }
.newsletter input[type="email"] {
  flex: 1 1 auto; min-width: 0; height: 48px; margin: 0; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--nl-line); background: var(--nl-bg); color: var(--nl-ink);
  font-family: "Hanken Grotesk", sans-serif; font-size: 16px; line-height: normal;
  transition: border-color 0.2s ease;
}
.newsletter input[type="email"]::placeholder { color: var(--nl-muted); opacity: 1; }
.newsletter input[type="email"]:hover { border-color: var(--nl-muted); }
.newsletter input[type="email"]:focus-visible { outline: 2px solid var(--nl-accent); outline-offset: 2px; border-color: var(--nl-muted); }
.newsletter input[aria-invalid="true"] { border-color: var(--nl-error); }

.newsletter button { margin: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }
.newsletter button:disabled { opacity: 0.6; cursor: progress; }
.newsletter button:focus-visible { outline: 2px solid var(--nl-accent); outline-offset: 3px; border-radius: 999px; }

/* «Sign up»: the site's primary pill (.btn.primary), self-contained. */
.newsletter .newsletter-submit {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 26px;
  border-radius: 999px; border: 1px solid var(--nl-ink); background: var(--nl-ink); color: var(--nl-bg);
  font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 16px; white-space: nowrap;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.newsletter .newsletter-submit:hover:not(:disabled) { transform: translateY(-1px); }

/* The sign-in buttons, under a hairline. */
.newsletter-alt { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 14px; border-top: 1px solid var(--nl-line); }

/* Sign in with Apple (HIG, custom button): black with white text in light mode, white with black text in dark mode;
   the Apple logo at the left, «Continue with Apple», system font. */
.newsletter .newsletter-apple {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
  border-radius: 999px; border: 0; background: light-dark(#000, #fff); color: light-dark(#fff, #000);
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 600; font-size: 15px;
  letter-spacing: -0.01em; white-space: nowrap;
}
.newsletter .newsletter-apple svg { display: block; flex: 0 0 auto; width: 17px; height: 17px; margin-top: -2px; fill: currentColor; }

/* Sign in with Google (branding guidelines, custom button): light theme #fff / #747775 / #1F1F1F, dark theme
   #131314 / #8E918F / #E3E3E3; the four-colour «G» at the left, «Continue with Google», Roboto Medium 14px. */
.newsletter .newsletter-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid light-dark(#747775, #8E918F); background: light-dark(#fff, #131314); color: light-dark(#1F1F1F, #E3E3E3);
  font-family: Roboto, "Hanken Grotesk", Arial, sans-serif; font-weight: 500; font-size: 14px; letter-spacing: 0.25px; white-space: nowrap;
}
.newsletter .newsletter-google svg { display: block; flex: 0 0 auto; width: 20px; height: 20px; }
/* Sign in with Microsoft (branding guidelines, 21/11/2026): light theme #FFFFFF / 1px #8C8C8C / #5E5E5E, dark theme
   #2F2F2F with no border / #FFFFFF; the four-square logo at the left, «Sign in with Microsoft», Segoe UI 15px semibold. */
.newsletter .newsletter-microsoft {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid light-dark(#8C8C8C, #2F2F2F); background: light-dark(#FFFFFF, #2F2F2F); color: light-dark(#5E5E5E, #FFFFFF);
  font-family: "Segoe UI", "Hanken Grotesk", sans-serif; font-weight: 600; font-size: 15px; white-space: nowrap;
}
.newsletter .newsletter-microsoft svg { display: block; flex: 0 0 auto; width: 19px; height: 19px; }
.newsletter .newsletter-apple:hover:not(:disabled), .newsletter .newsletter-google:hover:not(:disabled), .newsletter .newsletter-microsoft:hover:not(:disabled) { filter: brightness(0.94); }
.newsletter-gsi { min-height: 44px; display: flex; align-items: center; }

.newsletter-trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.newsletter .newsletter-status { margin: 0; max-width: none; font-size: 14.5px; line-height: 1.5; color: var(--nl-body); }
.newsletter-status:empty { display: block; height: 0; margin-top: -14px; overflow: hidden; }
.newsletter-status[data-state="error"] { color: var(--nl-error); }

@media (max-width: 767px) {
  .newsletter { margin-top: 20px; padding: 22px 20px; gap: 12px; }
  .newsletter .newsletter-title { font-size: 19px; }
  .newsletter-row { flex-direction: column; }
  .newsletter input[type="email"], .newsletter .newsletter-submit { width: 100%; }
  .newsletter-alt { flex-direction: column; align-items: stretch; }
  .newsletter .newsletter-apple, .newsletter .newsletter-google, .newsletter .newsletter-microsoft { width: 100%; }
  .newsletter-gsi { justify-content: center; }
  .newsletter-status:empty { margin-top: -12px; }
}
