/* =====================================================
   WiiWhistle — CSS generale (design system "Apple-style")
   =====================================================
   Prototipo nato da come-funziona.php. Da riusare così com'è
   su ogni nuova pagina che adotta il nuovo stile: basta
   linkare questo file, non serve copiare CSS nella pagina.

   USO:
   <link rel="stylesheet" href="/css/ww-apple-style.css">
   (mettilo nell'head della pagina, DOPO aver richiesto head.php,
   così le nostre regole possono sovrascrivere quelle vecchie
   quando serve — es. sfondo bianco invece di crema)
===================================================== */

:root{
  --ww-white:    #FFFFFF;
  --ww-offwhite: #F5F5F7;
  --ww-ink:      #1D1D1F;
  --ww-gray:     #6E6E73;
  --ww-red:      #7A0C0C;
  --ww-red-06:   rgba(122,12,12,0.06);
  --ww-radius:   20px;
}

*{ box-sizing: border-box; }

html{
  overflow-x: hidden;
  width: 100%;
}

body{
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  background: var(--ww-white) !important;
  color: var(--ww-ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 180px; /* spazio per il CTA fisso in basso */
}

/* ===== Fix elementi fissi di head.php (logo, ricerca, lang switcher) ===== */

/* evita il flash quando il JS di head.php li inietta dopo il load */
#ww-logo-link, #ww-floating-button{
  opacity: 0;
  animation: ww-fade-in 0.25s ease-out 0.05s forwards;
}

@keyframes ww-fade-in{
  from{ opacity: 0; }
  to{ opacity: 1; }
}

@media (prefers-reduced-motion: reduce){
  #ww-logo-link, #ww-floating-button{ opacity: 1; animation: none; }
}

/* head.php lo definisce 'position:absolute' (scorre con la pagina).
   Lo rendiamo 'fixed' come logo e ricerca, per coerenza. */
#ww-lang-switcher{
  position: fixed !important;
  top: 18px !important;
  right: 100px !important;
}

@media (max-width: 480px){
  #ww-lang-switcher{
    top: 95px !important;
    right: 10px !important;
  }
}

/* ===== Layout generico a sezioni ===== */

section{
  padding: clamp(64px, 10vw, 120px) 24px;
}

.section-inner{
  max-width: 980px;
  margin: 0 auto;
}

/* ===== Hero ===== */

.hero{
  text-align: center;
  padding-top: clamp(90px, 14vw, 140px);
}

.hero h1{
  font-size: clamp(44px, 7vw, 84px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 20px;
  color: var(--ww-ink);
}

.hero p{
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 400;
  color: var(--ww-gray);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.5;
}

/* icona/animazione "tap" — pensata per l'hero, riusabile ovunque serva
   richiamare il gesto del tocco NFC */
.tap-icon{
  width: 84px;
  height: 84px;
  margin: 40px auto 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tap-icon .ring{
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--ww-red);
  opacity: 0;
  animation: tapPulse 2.6s ease-out infinite;
}
.tap-icon .ring.r2{ animation-delay: 0.9s; }

@keyframes tapPulse{
  0%   { transform: scale(0.55); opacity: 0.55; }
  80%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

.tap-icon svg{ position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce){
  .tap-icon .ring{ animation: none; display: none; }
}

/* ===== Sezioni a step (numerati o meno) ===== */

.step-section{
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.step-section.alt{
  background: var(--ww-offwhite);
}

.step-eyebrow{
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ww-red);
  margin-bottom: 14px;
}

.step-grid{
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 28px;
  align-items: start;
}

.step-icon{
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--ww-red-06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ww-red);
}

.step-content h2{
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--ww-ink);
}

.step-content p{
  font-size: clamp(17px, 1.9vw, 19px);
  line-height: 1.55;
  color: var(--ww-gray);
  margin: 0;
  max-width: 560px;
}

@media (max-width: 560px){
  .step-grid{ grid-template-columns: 48px 1fr; gap: 18px; }
  .step-icon{ width: 44px; height: 44px; border-radius: 12px; }
  .step-icon svg{ width: 22px; height: 22px; }
}

/* ===== Banner pieno (es. messaggio B2B, CTA forte) ===== */

.b2b-band{
  background: var(--ww-red);
  color: #ffffff;
  text-align: center;
}

.b2b-band h2{
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

.b2b-band p{
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
  opacity: 0.92;
  max-width: 640px;
  margin: 0 auto 32px;
}

/* ===== Bottoni ===== */

.pill-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: var(--ww-red);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 999px;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.pill-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0,0,0,.24);
}

/* CTA fisso in basso, stile pillola nera Apple */
.btn--cta-apple{
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 10000;
  width: min(92vw, 420px);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ww-ink);
  color: #ffffff;
  font-family: inherit;
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn--cta-apple:hover{
  transform: translateX(-50%) translateY(-2px);
  background: #000000;
}
.btn--cta-apple:active{
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px){
  .btn--cta-apple{
    left: 12px; right: 12px; width: auto;
    transform: none;
  }
  .btn--cta-apple:hover, .btn--cta-apple:active{ transform: translateY(-1px); }
}
