/* ===== RPE Calculator — sito marketing + tool ===== */
@font-face { font-family:'Barlow'; font-weight:400; font-display:swap; src:url('../fonts/Barlow-Regular.ttf'); }
@font-face { font-family:'Barlow'; font-weight:600; font-display:swap; src:url('../fonts/Barlow-SemiBold.ttf'); }
@font-face { font-family:'Barlow'; font-weight:700; font-display:swap; src:url('../fonts/Barlow-Bold.ttf'); }

:root {
  --bg:#F8F6F0; --card:#FFFFFF; --card-alt:#EFEBDF; --border:#E2DCCB;
  --accent:#FFB81F; --on-accent:#241A00; --accent-text:#8F6400;
  --text:#23201A; --muted:#7A745F;
  --dark-bg:#0F0E0B; --dark-card:#17150F; --dark-card-alt:#201D14;
  --dark-border:#35301F; --dark-text:#F3F0E7; --dark-muted:#9C9583;
  --dark-accent:#FFC53D;
  --radius:20px; --max:1060px;
  --shadow-lg:0 24px 60px -12px rgba(60,45,10,.18);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:#0F0E0B; --card:#17150F; --card-alt:#201D14; --border:#35301F;
    --accent:#FFC53D; --on-accent:#201700; --accent-text:#FFC53D;
    --text:#F3F0E7; --muted:#9C9583;
    --shadow-lg:0 24px 60px -12px rgba(0,0,0,.6);
  }
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
[id] { scroll-margin-top:84px; }
body {
  font-family:'Barlow', system-ui, sans-serif; background:var(--bg); color:var(--text);
  line-height:1.6; -webkit-font-smoothing:antialiased; overflow-x:hidden;
}
.tab-nums { font-variant-numeric:tabular-nums; }
a { color:var(--accent-text); }
.wrap { max-width:var(--max); margin:0 auto; padding:0 22px; }

/* Glow di sfondo */
.glow { position:relative; }
.glow::before {
  content:''; position:absolute; inset:-120px 0 auto; height:560px; z-index:-1;
  background:radial-gradient(620px 380px at 72% 20%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%),
             radial-gradient(520px 320px at 12% 6%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
  pointer-events:none;
}

/* ---------- Header ---------- */
header {
  position:sticky; top:0; z-index:50;
  background:color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter:blur(12px); border-bottom:1px solid var(--border);
}
.hbar { display:flex; align-items:center; justify-content:space-between; height:64px; }
.logo { display:flex; align-items:center; gap:10px; font-weight:700; font-size:19px; color:var(--text); text-decoration:none; letter-spacing:-.3px; }
.logo .mark { width:32px; height:32px; border-radius:9px; background:var(--accent); color:var(--on-accent);
  display:grid; place-items:center; font-weight:800; font-size:12px; letter-spacing:0; }
.hnav { display:flex; gap:24px; align-items:center; }
.hnav a.nl { color:var(--muted); text-decoration:none; font-weight:600; font-size:15px; }
.hnav a.nl:hover { color:var(--text); }
@media (max-width:760px){ .hnav a.nl { display:none; } }

/* ---------- Bottoni ---------- */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  background:var(--accent); color:var(--on-accent); font-weight:700; text-decoration:none;
  padding:13px 22px; border-radius:14px; border:none; cursor:pointer;
  font-family:inherit; font-size:15.5px; transition:transform .15s ease, box-shadow .15s ease;
  box-shadow:0 10px 26px -8px color-mix(in srgb, var(--accent) 55%, transparent);
}
.btn:hover { transform:translateY(-1px); box-shadow:0 14px 32px -8px color-mix(in srgb, var(--accent) 65%, transparent); }
.btn.small { padding:10px 16px; font-size:14.5px; border-radius:12px; box-shadow:none; }
.btn-ghost {
  display:inline-flex; align-items:center; gap:8px; background:transparent; color:var(--text);
  border:1.5px solid var(--border); padding:12px 20px; border-radius:14px; font-weight:600;
  text-decoration:none; font-size:15.5px;
}
.btn-ghost:hover { border-color:var(--muted); }
.play-glyph { width:0; height:0; border-style:solid; border-width:6px 0 6px 10px;
  border-color:transparent transparent transparent currentColor; display:inline-block; }

/* ---------- Hero "tool-first": titolo compatto, calcolatore subito ---------- */
.hero-tool { padding:26px 0 8px; text-align:center; }
.hero-tool h1 { font-size:clamp(27px,4.2vw,40px); font-weight:700; letter-spacing:-1.2px; line-height:1.1; }
.hero-tool h1 .hl { color:var(--accent-text); }
.hero-tool p.sub { font-size:clamp(15px,1.9vw,17.5px); color:var(--muted); max-width:600px; margin:9px auto 0; }
.hero-tool .trust { justify-content:center; margin-top:12px; gap:14px; }
.hero-tool .trust span { font-size:13.5px; }
@media (max-width:560px){
  .hero-tool { padding:18px 0 6px; }
  .hero-tool p.sub { font-size:15px; }
  .hero-tool .trust { display:none; } /* spazio prezioso: il tool prima di tutto */
}

/* CTA contestuale subito dopo il risultato (massima intenzione) */
.after-cta {
  margin-top:16px; padding:14px 18px; border-radius:16px;
  background:color-mix(in srgb, var(--accent) 9%, transparent);
  border:1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap;
}
.after-cta p { font-size:14.5px; color:var(--text); margin:0; font-weight:600; }
.after-cta p small { display:block; font-weight:400; color:var(--muted); font-size:13px; margin-top:1px; }

/* Vetrina app: mockup + elenco funzioni */
.app-showcase { display:grid; grid-template-columns:300px 1fr; gap:34px; align-items:center; }
@media (max-width:820px){ .app-showcase { grid-template-columns:1fr; } .app-showcase .hero-phone { order:-1; } }

/* ---------- Hero classico (altre pagine) ---------- */
.hero { padding:64px 0 30px; }
.hero-grid { display:grid; grid-template-columns:1.05fr .95fr; gap:30px; align-items:center; }
@media (max-width:860px){ .hero-grid { grid-template-columns:1fr; } .hero-phone { order:-1; } }
.eyebrow { display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:700;
  letter-spacing:2.2px; color:var(--accent-text); text-transform:uppercase; margin-bottom:14px; }
.eyebrow::before { content:''; width:22px; height:2px; background:var(--accent); border-radius:2px; }
.hero h1 { font-size:clamp(38px,5.6vw,58px); font-weight:700; letter-spacing:-1.8px; line-height:1.04; }
.hero h1 .hl { color:var(--accent-text); }
.hero p.sub { font-size:clamp(16px,2.2vw,19px); color:var(--muted); max-width:520px; margin:18px 0 22px; }
.hero-ctas { display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
.hero-note { font-size:13.5px; color:var(--muted); margin-top:12px; }
.trust { display:flex; gap:18px; flex-wrap:wrap; margin-top:26px; }
.trust span { display:inline-flex; align-items:center; gap:7px; font-size:14.5px; font-weight:600; color:var(--muted); }
.trust b { color:var(--accent-text); font-weight:800; }

/* ---------- Mockup telefono (CSS puro) ---------- */
.hero-phone { display:flex; justify-content:center; }
.phone {
  width:288px; aspect-ratio:9/18.6; background:#000; border-radius:42px; padding:9px;
  box-shadow:var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.06);
  transform:rotate(3deg); transition:transform .3s ease;
}
.phone:hover { transform:rotate(1.2deg) scale(1.01); }
.phone .scr {
  width:100%; height:100%; border-radius:34px; overflow:hidden; background:var(--dark-bg);
  display:flex; flex-direction:column; padding:16px 14px 10px; gap:10px;
  font-size:12px; color:var(--dark-text);
}
.p-seg { display:flex; background:var(--dark-card-alt); border-radius:12px; overflow:hidden; }
.p-seg span { flex:1; text-align:center; padding:8px 0; font-weight:600; font-size:11.5px; color:var(--dark-muted); }
.p-seg span.on { background:var(--dark-accent); color:#201700; }
.p-lab { font-size:8.5px; font-weight:700; letter-spacing:1.6px; color:var(--dark-muted); }
.p-field { display:flex; align-items:center; gap:8px; }
.p-field .rnd { width:30px; height:30px; border-radius:50%; background:var(--dark-card-alt); display:grid; place-items:center; color:var(--dark-text); font-size:15px; flex:none; }
.p-field .fv { flex:1; background:var(--dark-card-alt); border-radius:11px; text-align:center; padding:8px 0; font-size:17px; font-weight:700; }
.p-field .fv small { font-size:10px; color:var(--dark-muted); font-weight:600; }
.p-pills { display:flex; gap:5px; }
.p-pills i { font-style:normal; flex:1; text-align:center; padding:6px 0; border-radius:12px; background:var(--dark-card-alt); color:var(--dark-muted); font-weight:600; font-size:11px; }
.p-pills i.on { background:var(--dark-accent); color:#201700; font-weight:700; }
.p-card { border:1px solid var(--dark-border); background:var(--dark-card); border-radius:14px; padding:9px 12px;
  display:flex; align-items:center; justify-content:space-between; }
.p-card .k { font-size:8.5px; font-weight:700; letter-spacing:1.3px; color:var(--dark-muted); }
.p-card .v { font-size:17px; font-weight:700; }
.p-card .v small { font-size:10px; color:var(--dark-muted); }
.p-card.hl { background:color-mix(in srgb, var(--dark-accent) 10%, var(--dark-card));
  border-color:color-mix(in srgb, var(--dark-accent) 50%, transparent); }
.p-card.hl .v { color:var(--dark-accent); font-size:21px; }
.p-nav { margin-top:auto; display:flex; justify-content:space-around; padding-top:8px; border-top:1px solid var(--dark-border); }
.p-nav b { font-size:8.5px; color:var(--dark-muted); font-weight:600; }
.p-nav b.on { color:var(--dark-accent); }

/* ---------- Sezioni ---------- */
section.block { padding:44px 0; }
section.block h2 { font-size:clamp(26px,3.8vw,34px); font-weight:700; letter-spacing:-0.8px; margin-bottom:8px; }
section.block h2 .hl { color:var(--accent-text); }
section.block .lead { color:var(--muted); margin-bottom:24px; max-width:640px; font-size:16.5px; }

/* Card tool */
.card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:24px;
  box-shadow:0 8px 30px -18px rgba(60,45,10,.14); }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
@media (max-width:720px){ .grid2 { grid-template-columns:1fr; } }

label.fld { display:block; font-size:12.5px; font-weight:700; letter-spacing:1px; text-transform:uppercase; color:var(--muted); margin-bottom:8px; }
.wgt { display:flex; align-items:center; gap:10px; }
.wgt input {
  flex:1; width:100%; font-family:inherit; font-size:26px; font-weight:700; text-align:center;
  background:var(--card-alt); color:var(--text); border:none; border-radius:14px; padding:12px;
  font-variant-numeric:tabular-nums; letter-spacing:-.5px;
}
.wgt input:focus { outline:2px solid var(--accent); }
.step { width:48px; height:48px; flex:none; border-radius:50%; border:none; cursor:pointer;
  background:var(--card-alt); color:var(--text); font-size:24px; font-family:inherit; transition:background .15s; }
.step:hover { background:var(--border); }

.pills { display:flex; flex-wrap:wrap; gap:8px; }
.pill { border:none; cursor:pointer; font-family:inherit; font-weight:600; font-size:15px;
  padding:9px 15px; border-radius:20px; background:var(--card-alt); color:var(--muted); transition:all .12s; }
.pill:hover { color:var(--text); }
.pill.sel { background:var(--accent); color:var(--on-accent); font-weight:700; }
.row { margin-top:16px; }

.result { margin-top:18px; padding:18px 20px; border-radius:16px; background:var(--card-alt); }
.result.hl { background:color-mix(in srgb, var(--accent) 11%, transparent);
  border:1.5px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.result .rlabel { font-size:12px; font-weight:700; letter-spacing:1.2px; text-transform:uppercase; color:var(--muted); }
.result .rval { font-size:40px; font-weight:700; letter-spacing:-1.2px; line-height:1.1; margin-top:2px; }
.result.hl .rval { color:var(--accent-text); }
.result .rval small { font-size:18px; font-weight:600; color:var(--muted); }
.result .rsub { font-size:13px; color:var(--muted); margin-top:4px; }
.rsub { font-size:13px; color:var(--muted); }

/* Tabella RPE */
.table-scroll { overflow-x:auto; border:1px solid var(--border); border-radius:var(--radius); background:var(--card); }
table.rpe { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; }
table.rpe th, table.rpe td { padding:12px 14px; text-align:right; white-space:nowrap; }
table.rpe th:first-child, table.rpe td:first-child { text-align:left; position:sticky; left:0; background:var(--card); }
table.rpe thead th { background:var(--card-alt); color:var(--muted); font-weight:600; font-size:14px; }
table.rpe thead th:first-child { background:var(--card-alt); }
table.rpe tbody tr:nth-child(even) td { background:color-mix(in srgb, var(--card-alt) 40%, transparent); }
table.rpe td.first-col { font-weight:700; }

#barbell { width:100%; height:150px; }

/* ---------- Feature dell'app ---------- */
.features { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
@media (max-width:860px){ .features { grid-template-columns:repeat(2,1fr); } }
@media (max-width:560px){ .features { grid-template-columns:1fr; } }
.feat { position:relative; background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:20px; }
.feat .fi { width:42px; height:42px; border-radius:12px; display:grid; place-items:center; font-size:20px;
  background:color-mix(in srgb, var(--accent) 14%, transparent); margin-bottom:12px; }
.feat h3 { font-size:17px; font-weight:700; letter-spacing:-.2px; }
.feat p { font-size:14px; color:var(--muted); margin-top:4px; }
.feat .pro-badge { position:absolute; top:14px; right:14px; background:var(--accent); color:var(--on-accent);
  font-size:11px; font-weight:800; letter-spacing:.8px; padding:3px 9px; border-radius:10px; }

/* Confronto Web vs App */
.compare { border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; background:var(--card); }
.compare table { width:100%; border-collapse:collapse; }
.compare th, .compare td { padding:13px 16px; text-align:center; font-size:15px; }
.compare th { background:var(--card-alt); font-weight:700; }
.compare td:first-child, .compare th:first-child { text-align:left; font-weight:600; }
.compare tr + tr td { border-top:1px solid var(--border); }
.compare .yes { color:var(--accent-text); font-weight:800; }
.compare .no { color:var(--muted); }
.compare .app-col { background:color-mix(in srgb, var(--accent) 7%, transparent); }

/* ---------- CTA finale ---------- */
.cta {
  margin:26px 0; padding:44px 26px; border-radius:28px; text-align:center; position:relative; overflow:hidden;
  background:linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--card)), var(--card));
  border:1px solid color-mix(in srgb, var(--accent) 42%, transparent);
}
.cta h2 { font-size:clamp(26px,4vw,34px); font-weight:700; letter-spacing:-.8px; }
.cta p { color:var(--muted); max-width:540px; margin:12px auto 22px; }
.cta .fine { font-size:13px; color:var(--muted); margin-top:14px; }
.soon-pill { display:inline-flex; align-items:center; gap:8px; background:var(--card); border:1px solid var(--border);
  color:var(--muted); font-weight:700; font-size:14px; padding:10px 18px; border-radius:999px; }
.soon-pill .dot { width:8px; height:8px; border-radius:50%; background:var(--accent); animation:pulse 1.6s infinite; }
@keyframes pulse { 0%,100%{opacity:1; transform:scale(1);} 50%{opacity:.4; transform:scale(.8);} }

/* Stato app live/soon: JS aggiunge .app-live al body quando pubblicata */
body:not(.app-live) .live-only { display:none !important; }
body.app-live .soon-only { display:none !important; }

/* Contenuto/FAQ */
.prose p { margin-bottom:14px; }
.prose h3 { margin:22px 0 8px; font-size:20px; }
details { border-bottom:1px solid var(--border); padding:16px 0; }
details summary { cursor:pointer; font-weight:600; font-size:17px; list-style:none; }
details summary::-webkit-details-marker { display:none; }
details summary::after { content:'+'; float:right; color:var(--accent-text); font-weight:700; }
details[open] summary::after { content:'−'; }
details p { margin-top:10px; color:var(--muted); }

footer { border-top:1px solid var(--border); padding:30px 0 90px; color:var(--muted); font-size:14px; }
footer .frow { display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px; }
footer a { color:var(--muted); text-decoration:none; margin-left:16px; }
footer a:hover { color:var(--text); }
@media (min-width:721px){ footer { padding-bottom:30px; } }

/* Modale QR (desktop): installa dal telefono senza perdere l'utente */
.qr-modal { position:fixed; inset:0; z-index:200; display:grid; place-items:center;
  background:rgba(0,0,0,.55); backdrop-filter:blur(3px); padding:20px; }
.qr-modal[hidden] { display:none; }
.qr-box { background:var(--card); border:1px solid var(--border); border-radius:22px;
  padding:26px 26px 22px; max-width:340px; text-align:center; position:relative;
  box-shadow:var(--shadow-lg); }
.qr-box h3 { font-size:20px; font-weight:700; letter-spacing:-.3px; }
.qr-box p { font-size:14px; color:var(--muted); margin:8px 0 16px; }
.qr-box img { border-radius:12px; background:#fff; padding:8px; display:block; margin:0 auto 16px; }
.qr-close { position:absolute; top:10px; right:14px; background:none; border:none; cursor:pointer;
  font-size:26px; line-height:1; color:var(--muted); font-family:inherit; }
.qr-close:hover { color:var(--text); }

/* Testi che cambiano col dispositivo */
body.is-desktop .desktop-hint { display:inline; }
body:not(.is-desktop) .desktop-hint { display:none; }

/* Barra download fissa su mobile */
.appbar-mobile {
  position:fixed; bottom:0; left:0; right:0; z-index:60; display:none;
  padding:10px 14px calc(10px + env(safe-area-inset-bottom));
  background:color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter:blur(12px);
  border-top:1px solid var(--border);
}
.appbar-mobile .btn { width:100%; }
@media (max-width:720px){ .appbar-mobile { display:block; } }
