/* Pagina della waitlist (templates/waitlist.html), con lo stile della landing:
   token, tipografia, bottoni, modulo e riquadro CTA presi da
   landing page faitopia/v2/src/assets/main.css (stessi nomi di classe). */

/* ============ TOKENS ============ */
:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F6F7FE;
  --mist: #ECEDFB;
  --mist-soft: #F6F7FE;
  --ink: #0A0D4E;
  --title: #0A0D4E;
  --muted: #6B6F95;
  --soft: #545985;
  --accent: #2E36C9;
  --primary: #6E78F0;
  --primary-deep: #2E36C9;
  --navy: #0A0D4E;
  --line: rgba(10, 13, 78, .1);
  --line-strong: rgba(10, 13, 78, .2);

  --grad: linear-gradient(90deg, #6E78F0 0%, #2E36C9 42%, #0A0D4E 100%);

  --font-display: "Archivo", "Arial Black", system-ui, sans-serif;
  --font-body: "Alexandria", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --header-h: 72px;
  --max: 1360px;
  --gutter: clamp(18px, 3.2vw, 48px);

  --r-lg: 24px;
  --r-pill: 999px;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ============ BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(110, 120, 240, .25); color: var(--navy); }

a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
strong { font-weight: 600; }
h1 { margin: 0; line-height: 1.05; color: var(--title); }
p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Type */
.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.eyebrow { color: var(--accent); }

.h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.2vw, 58px);
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -.01em;
  line-height: 1;
  text-transform: uppercase;
  text-wrap: balance;
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============ BUTTONS ============ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease, color .25s ease, box-shadow .25s ease, transform .25s var(--ease);
}
.btn:hover { background: var(--mist); border-color: transparent; }

.btn-primary {
  border-color: transparent;
  background: var(--primary-deep);
  color: #fff;
  box-shadow: 0 10px 28px -10px rgba(46, 54, 201, .7);
}
.btn-primary:hover {
  background: var(--navy);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px -10px rgba(10, 13, 78, .6);
}

.btn-lg { height: 58px; padding: 0 30px; font-size: 13px; }

.btn svg { width: 16px; height: 16px; transition: transform .2s ease; }
.btn:hover svg { transform: translateX(3px); }

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav {
  height: var(--header-h);
  display: flex;
  align-items: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 19px;
  letter-spacing: .01em;
  text-transform: uppercase;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-mark {
  position: relative;
  overflow: hidden;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  box-shadow: 0 6px 16px -6px rgba(46, 54, 201, .6);
}
.logo-mark img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ============ PAGE ============ */
.wl {
  flex: 1;
  display: grid;
  align-items: center;
  padding-block: clamp(32px, 7vw, 96px);
}

/* ============ FINAL CTA (il riquadro della pagina) ============ */
.cta {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 8vw, 112px) clamp(24px, 6vw, 80px);
  border-radius: 36px;
  background: var(--mist);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px 48px;
  align-items: center;
}
.cta::before {
  content: "";
  position: absolute;
  inset: auto -10% -70% auto;
  width: 70%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(46, 54, 201, .28), transparent 65%);
  pointer-events: none;
}
.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 60% 80% at 85% 100%, #000, transparent 70%);
  opacity: .6;
  pointer-events: none;
}
.cta > * { position: relative; z-index: 1; animation: rise .6s var(--ease) both; }
.cta > *:last-child { animation-delay: .08s; }
.cta .eyebrow { margin-bottom: 18px; }
.cta .h2 { max-width: 18ch; }
.cta > div:first-child > p:not(.eyebrow) { margin: 20px 0 0; color: var(--soft); font-size: 18px; max-width: 52ch; }

.cta-actions { display: grid; gap: 14px; width: min(480px, 100%); }

/* ============ WAITLIST ============ */
.waitlist { display: grid; gap: 12px; width: 100%; margin: 0; }

/* il pulsante di Google (lo disegna Google Identity Services) */
.waitlist-google { display: grid; }
.gsi-target { min-height: 44px; display: flex; justify-content: center; }

.waitlist-or {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.waitlist-or::before,
.waitlist-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.waitlist-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: 0 1px 0 rgba(10, 13, 78, .04), 0 14px 34px rgba(46, 54, 201, .14);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.waitlist-form:focus-within {
  border-color: rgba(46, 54, 201, .45);
  box-shadow: 0 0 0 4px rgba(110, 120, 240, .18), 0 14px 34px rgba(46, 54, 201, .14);
}
.waitlist-form.has-error { border-color: #D92D20; box-shadow: 0 0 0 4px rgba(217, 45, 32, .12); }

.waitlist-form input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 12px 0 18px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  outline: none; /* la pillola intera mostra il focus con :focus-within */
}
.waitlist-form input::placeholder { color: #9A9DBB; }
.waitlist-form .btn { flex: none; height: 48px; }

.waitlist-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 20px;
  margin: 0;
  padding-left: 20px;
  font-size: 12px;
  color: var(--muted);
}
.waitlist-msg.is-error { color: #B42318; font-weight: 500; }

.waitlist-done {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(46, 54, 201, .22);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: 0 18px 40px -20px rgba(10, 13, 78, .3);
}
.waitlist-done .avatar svg { width: 18px; height: 18px; }
.waitlist-done p { font-size: 14px; line-height: 1.5; color: var(--soft); }
.waitlist-done strong { display: block; font-size: 16px; color: var(--ink); }
.waitlist-email { color: var(--ink); font-weight: 500; word-break: break-all; }
.waitlist-change {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  color: var(--primary-deep);
  cursor: pointer;
}
.waitlist-change:hover { text-decoration: underline; text-underline-offset: 3px; }

.wl-google-note {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--primary-deep);
}

.avatar {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--primary-deep);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============ FOOTER ============ */
.site-footer {
  padding-block: 24px 32px;
  color: var(--muted);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  :root { --header-h: 64px; }
  .cta { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .waitlist-form { flex-direction: column; align-items: stretch; padding: 8px; border-radius: var(--r-lg); }
  .waitlist-form input { padding: 0 12px; text-align: center; }
  .cta-actions { width: 100%; }
  .cta .btn { width: 100%; }
  .waitlist-msg { padding-left: 0; justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
