/* ═══════════════════════════════════════════════════════
   StudiApp — Sito pubblico
   Brand: Arancio Drago #FF6B35 · Verde Acqua #4ECDC4 · Oro #FFD700
   Font: Nunito
   ═══════════════════════════════════════════════════════ */

:root {
  --orange: #FF6B35;
  --orange-light: #FF8F5E;
  --orange-dark: #E55A2B;
  --teal: #4ECDC4;
  --teal-light: #7EDDD6;
  --teal-dark: #3BBFB6;
  --gold: #FFD700;
  --success: #6BCB77;
  --bg: #FFF8F0;
  --bg-section: #F5F0EB;
  --card: #FFFFFF;
  --text: #2D3436;
  --text-2: #636E72;
  --text-3: #B2BEC3;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(45, 52, 54, 0.08);
  --shadow-lg: 0 12px 40px rgba(45, 52, 54, 0.14);
  --maxw: 1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-dark); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ─── Header / Nav ─────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 248, 240, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(45, 52, 54, 0.06);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.nav-brand img { width: 38px; height: 38px; border-radius: 10px; }
.nav-brand .brand-studi { color: var(--orange); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
}

.nav-links a {
  color: var(--text-2);
  font-weight: 700;
  font-size: 0.98rem;
  transition: color 0.15s;
}

.nav-links a:hover, .nav-links a.active { color: var(--orange); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.7rem;
  cursor: pointer;
  color: var(--text);
}

/* ─── Bottoni ──────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--orange);
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(255, 107, 53, 0.35);
}
.btn-primary:hover { background: var(--orange-dark); transform: translateY(-2px); }

.btn-secondary {
  background: #fff;
  color: var(--orange) !important;
  border: 2px solid var(--orange);
}
.btn-secondary:hover { background: #FFF1EA; transform: translateY(-2px); }

.btn-teal {
  background: var(--teal);
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(78, 205, 196, 0.35);
}
.btn-teal:hover { background: var(--teal-dark); transform: translateY(-2px); }

.btn-lg { padding: 16px 36px; font-size: 1.1rem; }

/* ─── Hero ─────────────────────────────────────────────── */

.hero {
  position: relative;
  padding: 84px 0 100px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.hero h1 .hl { color: var(--orange); }
.hero h1 .hl-teal { color: var(--teal-dark); }

.hero p.lead {
  margin: 22px 0 32px;
  font-size: 1.18rem;
  color: var(--text-2);
  max-width: 34rem;
}

.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-badges {
  margin-top: 30px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--text-2);
  font-weight: 700;
  font-size: 0.92rem;
}

.hero-visual { position: relative; }

.hero-visual .screenshot-frame { transform: rotate(1.5deg); }

/* Blob decorativi */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}
.blob-orange { width: 420px; height: 420px; background: var(--orange-light); top: -120px; right: -100px; }
.blob-teal { width: 380px; height: 380px; background: var(--teal-light); bottom: -140px; left: -120px; }

/* Drago fluttuante */
.dragon-float {
  font-size: 4.2rem;
  display: inline-block;
  animation: floaty 3.6s ease-in-out infinite;
  filter: drop-shadow(0 12px 16px rgba(45,52,54,0.18));
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-16px) rotate(4deg); }
}

/* ─── Screenshot frame (finto browser) ─────────────────── */

.screenshot-frame {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid rgba(45,52,54,0.08);
}

.screenshot-frame .frame-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-section);
  border-bottom: 1px solid rgba(45,52,54,0.06);
}

.screenshot-frame .frame-bar span {
  width: 10px; height: 10px; border-radius: 50%;
}
.frame-bar span:nth-child(1) { background: #FF6B6B; }
.frame-bar span:nth-child(2) { background: var(--gold); }
.frame-bar span:nth-child(3) { background: var(--success); }

.screenshot-frame img { width: 100%; }

/* Cornice telefono per screenshot app */
.phone-frame {
  width: min(280px, 100%);
  margin: 0 auto;
  background: #2D3436;
  border-radius: 34px;
  padding: 10px;
  box-shadow: var(--shadow-lg);
}
.phone-frame img { border-radius: 26px; }

/* Cornice app: bezel scuro sottile, adatta a qualsiasi proporzione */
.app-frame {
  width: min(420px, 100%);
  margin: 0 auto;
  background: #2D3436;
  border-radius: 26px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
}
.app-frame img { border-radius: 20px; }

/* ─── Sezioni ──────────────────────────────────────────── */

.section { padding: 84px 0; }
.section.alt { background: var(--bg-section); }
.section.dark {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: #fff;
}
.section.dark h2, .section.dark p { color: #fff; }

.section-head { text-align: center; max-width: 44rem; margin: 0 auto 56px; }

.section-head .eyebrow {
  display: inline-block;
  background: rgba(78, 205, 196, 0.18);
  color: var(--teal-dark);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 900;
  line-height: 1.2;
}

.section-head p { margin-top: 14px; color: var(--text-2); font-size: 1.08rem; }

/* ─── Card griglie ─────────────────────────────────────── */

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.card .icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
  border-radius: 16px;
  background: rgba(255, 107, 53, 0.12);
  margin-bottom: 18px;
}
.card .icon.teal { background: rgba(78, 205, 196, 0.16); }
.card .icon.gold { background: rgba(255, 215, 0, 0.2); }

.card h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 8px; }
.card p { color: var(--text-2); font-size: 0.97rem; }

/* ─── Split (testo + screenshot alternati) ─────────────── */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  margin-bottom: 84px;
}
.split:last-child { margin-bottom: 0; }
.split.reverse .split-text { order: 2; }
.split.reverse .split-media { order: 1; }

.split-text .eyebrow {
  color: var(--orange);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.split-text h3 { font-size: 1.65rem; font-weight: 900; margin: 10px 0 14px; line-height: 1.25; }
.split-text p { color: var(--text-2); margin-bottom: 12px; }

.split-text ul { list-style: none; margin-top: 16px; }
.split-text li {
  padding-left: 32px;
  position: relative;
  margin-bottom: 10px;
  color: var(--text-2);
  font-weight: 600;
}
.split-text li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}

/* ─── Stats band ───────────────────────────────────────── */

.stats-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stats-band .num { font-size: 2.4rem; font-weight: 900; }
.stats-band .lbl { font-weight: 700; opacity: 0.9; font-size: 0.95rem; }

/* ─── Homeschooling banner ─────────────────────────────── */

.homeschool {
  background: linear-gradient(135deg, rgba(78,205,196,0.14), rgba(255,215,0,0.12));
  border: 2px dashed var(--teal);
  border-radius: 24px;
  padding: 44px 40px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
}
.homeschool .emoji { font-size: 3.4rem; }
.homeschool h3 { font-size: 1.4rem; font-weight: 900; margin-bottom: 8px; }
.homeschool p { color: var(--text-2); max-width: 46rem; }

/* ─── CTA finale ───────────────────────────────────────── */

.cta-final { text-align: center; }
.cta-final h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 900; margin-bottom: 14px; }
.cta-final p { font-size: 1.12rem; margin-bottom: 30px; opacity: 0.95; }
.cta-final .btn-primary {
  background: #fff;
  color: var(--orange) !important;
  box-shadow: 0 8px 26px rgba(0,0,0,0.18);
}
.cta-final .btn-primary:hover { background: var(--bg); }

/* ─── Form contatti ────────────────────────────────────── */

.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; }

.form-card {
  background: var(--card);
  border-radius: 22px;
  padding: 38px 34px;
  box-shadow: var(--shadow-lg);
}

.form-field { margin-bottom: 20px; }

.form-field label {
  display: block;
  font-weight: 800;
  font-size: 0.92rem;
  margin-bottom: 7px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--bg-section);
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: #FFFDFA;
  transition: border-color 0.15s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--orange);
}

.form-field textarea { resize: vertical; min-height: 130px; }

/* Honeypot: invisibile agli umani */
.hp-field { position: absolute; left: -6000px; opacity: 0; height: 0; overflow: hidden; }

.form-note { font-size: 0.85rem; color: var(--text-3); margin-top: 14px; }

.form-status {
  display: none;
  padding: 14px 18px;
  border-radius: 12px;
  font-weight: 700;
  margin-bottom: 18px;
}
.form-status.ok { display: block; background: rgba(107, 203, 119, 0.15); color: #2E7D32; }
.form-status.err { display: block; background: rgba(255, 107, 107, 0.14); color: #C62828; }

/* ─── Footer ───────────────────────────────────────────── */

.site-footer {
  background: #2D3436;
  color: #B2BEC3;
  padding: 56px 0 32px;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.site-footer a { color: #B2BEC3; display: block; margin-bottom: 8px; font-size: 0.95rem; }
.site-footer a:hover { color: var(--teal-light); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 22px;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ─── Scroll reveal ────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .dragon-float { animation: none; }
}

/* ─── Responsive ───────────────────────────────────────── */

@media (max-width: 900px) {
  .hero-grid, .grid-3, .grid-2, .split, .contact-grid, .footer-grid { grid-template-columns: 1fr; }
  .split.reverse .split-text { order: 1; }
  .split.reverse .split-media { order: 2; }
  .split { gap: 30px; margin-bottom: 60px; }
  .stats-band { grid-template-columns: repeat(2, 1fr); }
  .homeschool { grid-template-columns: 1fr; text-align: center; }
  .homeschool .emoji { margin: 0 auto; }

  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0; right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 22px 24px 26px;
    box-shadow: var(--shadow-lg);
    gap: 18px;
  }
  .nav-links.open { display: flex; }

  .hero { padding: 48px 0 64px; }
  .section { padding: 60px 0; }
}
