/* =====================================================
   alessandrosimone.it — Foglio di stile condiviso
   Modifica i colori qui sotto per cambiare tutto il sito
   ===================================================== */

:root {
  /* Colori brand */
  --primary:        #4f46e5;   /* indaco  */
  --primary-dark:   #4338ca;
  --primary-light:  #eef2ff;
  --accent:         #f59e0b;   /* ambra — area ripetizioni */
  --accent-dark:    #d97706;
  --edu:            #0d9488;   /* verde acqua — area studenti */
  --edu-light:      #f0fdfa;

  /* Neutri */
  --ink:            #1e293b;
  --muted:          #64748b;
  --bg:             #ffffff;
  --bg-soft:        #f8fafc;
  --border:         #e2e8f0;

  /* Misure */
  --radius:         14px;
  --radius-sm:      8px;
  --container:      1120px;
  --shadow:         0 2px 16px rgba(15, 23, 42, .07);
  --shadow-lg:      0 18px 40px rgba(15, 23, 42, .14);
  --transition:     .2s ease;

  --font:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Poppins', var(--font);
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
/* overflow-x:hidden sull'elemento HTML (non su body) evita lo scroll
   orizzontale accidentale su mobile SENZA rompere position:sticky:
   è ciò che teneva nascosto l'header in alcune pagine dei corsi. */
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* doppia rete: clip non crea scroll container, non tocca lo sticky */
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; font-weight: 700; }

/* ---------- Layout ---------- */
.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.section { padding: 5rem 0; }
.section.soft { background: var(--bg-soft); }
.center { text-align: center; }

.eyebrow {
  display: inline-block;
  font-size: .78rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--primary); margin-bottom: .6rem;
}
.section-title { font-size: clamp(1.7rem, 3vw, 2.3rem); color: var(--ink); }
.section-sub { color: var(--muted); margin-top: .6rem; max-width: 620px; }
.center .section-sub { margin-inline: auto; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.6rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .98rem; cursor: pointer;
  border: 2px solid transparent; transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent  { background: var(--accent); color: #1a1a1a; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-edu     { background: var(--edu); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--ink); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost   { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.4); }
.btn-sm { padding: .55rem 1.1rem; font-size: .9rem; }
.btn-lg { padding: 1rem 2.2rem; font-size: 1.05rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; letter-spacing: -.5px; display: inline-flex; align-items: center; gap: .45rem; flex-shrink: 0; }
.brand .brand-logo { height: 34px; width: auto; display: block; }
.brand .brand-name { white-space: nowrap; color: var(--ink); }
.brand .brand-accent { color: var(--primary); }
.nav-menu { display: flex; align-items: center; gap: 1.25rem; margin-left: 2rem; }
.nav-menu a { font-size: .95rem; font-weight: 500; color: var(--muted); transition: color var(--transition); white-space: nowrap; }
.nav-menu a:hover, .nav-menu a.active { color: var(--ink); }
.nav-menu a.btn { color: #1a1a1a; }
.nav-menu a.active:not(.btn) { color: var(--primary); }

/* ---------- Barra dei corsi (solo pagina corsi.html) ---------- */
.course-nav { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 68px; z-index: 999; display: flex; align-items: center; }
.course-nav-inner { display: flex; align-items: center; gap: 1.4rem; height: 52px; overflow-x: auto; flex: 1; scrollbar-width: none; -ms-overflow-style: none; scroll-behavior: smooth; }
.course-nav-inner::-webkit-scrollbar { display: none; }
.course-nav a { font-size: .92rem; font-weight: 600; color: var(--muted); white-space: nowrap; transition: color var(--transition); }
.course-nav a:hover, .course-nav a.active { color: var(--primary); }
.course-nav a.active { font-weight: 700; }
.nav-arrow { flex-shrink: 0; background: #fff; border: none; cursor: pointer; font-size: 1.1rem; color: var(--muted); width: 32px; height: 52px; display: flex; align-items: center; justify-content: center; transition: color var(--transition); z-index: 1; }
.nav-arrow:hover { color: var(--primary); }
.nav-arrow.hidden { visibility: hidden; pointer-events: none; }
/* Su mobile le tabelle larghe scorrono invece di essere tagliate dall'overflow-x:hidden */
@media (max-width: 900px){
  .course-wrap table { display: block; width: 100%; overflow-x: auto; }
}

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: .4rem; }
.nav-toggle span { width: 26px; height: 3px; background: var(--ink); border-radius: 3px; transition: var(--transition); }

@media (max-width: 1024px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: .5rem 1.25rem 1.25rem;
    transform: translateY(-150%); transition: transform .3s ease; box-shadow: var(--shadow);
  }
  .nav-menu.open { transform: translateY(0); }
  .nav-menu a { padding: .8rem 0; border-bottom: 1px solid var(--border); }
  .nav-menu a.btn { margin-top: .8rem; justify-content: center; border: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse at 80% -10%, var(--primary-light), transparent 60%),
    radial-gradient(ellipse at 0% 110%, #fff7ed, transparent 55%);
  padding: 5rem 0 4.5rem;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 4.5vw, 3.3rem); color: var(--ink); }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero p.lead { font-size: 1.15rem; color: var(--muted); margin: 1.2rem 0 2rem; max-width: 520px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.challenge-box { background: linear-gradient(135deg, #eef2ff 0%, #f0fdfa 100%); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 14px; padding: 1.1rem 1.3rem; margin: 1.5rem 0; }
.challenge-box .challenge-label { display: inline-block; font-weight: 700; color: var(--ink); margin-bottom: .35rem; font-size: .95rem; }
.challenge-box p { margin: 0; color: var(--muted); line-height: 1.6; }
.badge-pill {
  display: inline-flex; align-items: center; gap: .5rem;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: .4rem 1rem; border-radius: 99px; font-size: .85rem; font-weight: 600; color: var(--muted);
  margin-bottom: 1.4rem;
}
.badge-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--edu); box-shadow: 0 0 0 4px rgba(13,148,136,.15); }

/* illustrazione hero */
.hero-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 1.6rem; transform: rotate(-1.5deg);
}
.hero-card .code-line { font-family: 'Courier New', monospace; font-size: .9rem; padding: .25rem 0; color: var(--ink); }
.hero-card .code-line .k { color: var(--primary); }
.hero-card .code-line .s { color: var(--edu); }
.hero-card .code-line .c { color: var(--muted); }
.hero-dots { display: flex; gap: .4rem; margin-bottom: 1rem; }
.hero-dots span { width: 12px; height: 12px; border-radius: 50%; }
.hero-dots span:nth-child(1){ background:#ef4444 } .hero-dots span:nth-child(2){ background:#f59e0b } .hero-dots span:nth-child(3){ background:#22c55e }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { display: none; }
}

/* ---------- Bivio due pubblici ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.split-card {
  border-radius: var(--radius); padding: 2.2rem; color: #fff;
  display: flex; flex-direction: column; min-height: 230px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.split-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.split-card.edu { background: linear-gradient(135deg, var(--edu), #0f766e); }
.split-card.rip { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.split-card .ico { font-size: 2.2rem; margin-bottom: .8rem; }
.split-card h3 { font-size: 1.4rem; }
.split-card p { opacity: .9; margin: .6rem 0 1.4rem; font-size: .98rem; }
.split-card .go { margin-top: auto; font-weight: 700; }
@media (max-width: 640px){ .split { grid-template-columns: 1fr; } }

/* ---------- Card generiche ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem; box-shadow: var(--shadow); transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .ico-box {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.5rem; margin-bottom: 1.1rem; background: var(--primary-light); color: var(--primary);
}
.card.edu .ico-box { background: var(--edu-light); color: var(--edu); }
.card h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.card p { color: var(--muted); font-size: .95rem; }
.price { margin-top: 1rem; font-family: var(--font-head); font-weight: 800; font-size: 1.5rem; color: var(--primary); }
.price small { font-size: .8rem; font-weight: 500; color: var(--muted); }

/* ---------- Stat ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 1.5rem; text-align: center; }
.stat .num { font-family: var(--font-head); font-size: 2.6rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat .lbl { color: var(--muted); font-size: .9rem; margin-top: .4rem; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1.5rem; }
.step { text-align: center; }
.step .circle {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 1rem;
  background: var(--primary); color: #fff; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 800; font-size: 1.3rem;
}
.step h4 { margin-bottom: .3rem; }
.step p { color: var(--muted); font-size: .92rem; }

/* ---------- Filtri esercizi ---------- */
.filters { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; margin-bottom: 2rem; }
.chip {
  padding: .45rem 1.1rem; border-radius: 99px; border: 1px solid var(--border);
  background: #fff; color: var(--muted); font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: var(--transition);
}
.chip:hover { border-color: var(--edu); color: var(--edu); }
.chip.active { background: var(--edu); border-color: var(--edu); color: #fff; }

.ex-list { display: grid; gap: 1rem; max-width: 800px; margin: 0 auto; }
.ex-item {
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--edu);
  border-radius: var(--radius-sm); padding: 1.2rem 1.4rem;
}
.ex-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.ex-head h4 { font-size: 1.02rem; }
.ex-meta { display: flex; gap: .5rem; align-items: center; flex-shrink: 0; }
.tag { font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 6px; background: var(--bg-soft); color: var(--muted); white-space: nowrap; }
.tag.base { background:#dcfce7; color:#166534 } .tag.medio { background:#fef9c3; color:#854d0e } .tag.avanzato { background:#fee2e2; color:#991b1b }
.ex-item .descr { color: var(--muted); font-size: .92rem; margin-top: .5rem; }
.solution { margin-top: .8rem; }
.solution summary { cursor: pointer; font-weight: 600; color: var(--edu); font-size: .9rem; }
.solution pre {
  margin-top: .7rem; background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: var(--radius-sm);
  overflow-x: auto; font-size: .85rem; line-height: 1.6;
}
.hidden { display: none !important; }

/* ---------- Blog ---------- */
.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px,1fr)); gap: 1.5rem; }
.post {
  background:#fff; border:1px solid var(--border); border-radius: var(--radius); overflow:hidden;
  box-shadow: var(--shadow); transition: transform var(--transition), box-shadow var(--transition);
}
.post:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post .thumb { height: 150px; display: grid; place-items: center; font-size: 3rem; background: linear-gradient(135deg, var(--primary-light), var(--edu-light)); }
.post .body { padding: 1.4rem; }
.post .cat { font-size: .75rem; font-weight: 700; color: var(--edu); text-transform: uppercase; letter-spacing: .5px; }
.post h3 { font-size: 1.1rem; margin: .4rem 0; }
.post p { color: var(--muted); font-size: .9rem; }
.post .date { color: var(--muted); font-size: .8rem; margin-top: .8rem; }

/* articolo */
.article { max-width: 720px; margin: 0 auto; }
.article h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: .5rem 0 1rem; }
.article p, .article li { color: #334155; margin-bottom: 1.1rem; font-size: 1.05rem; }
.article h2 { margin: 2rem 0 .8rem; font-size: 1.5rem; }
.article ul { padding-left: 1.4rem; }
.article pre { background:#0f172a; color:#e2e8f0; padding:1.2rem; border-radius: var(--radius-sm); overflow-x:auto; margin-bottom: 1.2rem; }
.article code { font-family:'Courier New',monospace; font-size:.92rem; }
.article p a, .article li a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.article p a:hover, .article li a:hover { color: var(--accent); }

/* ---------- Testimonial ---------- */
.testi { background:#fff; border:1px solid var(--border); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); }
.testi .stars { color: var(--accent); margin-bottom: .7rem; }
.testi p { font-style: italic; color: #334155; }
.testi .who { margin-top: 1rem; font-weight: 700; font-size: .9rem; }
.testi .who span { font-weight: 400; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: .8rem; }
.faq details { background:#fff; border:1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.3rem; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details[open] summary { color: var(--primary); margin-bottom: .6rem; }
.faq p { color: var(--muted); font-size: .95rem; }

/* ---------- Form ---------- */
.form { max-width: 560px; margin: 0 auto; display: grid; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 600; font-size: .9rem; }
.field input, .field textarea, .field select {
  padding: .8rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .98rem; transition: var(--transition);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* ---------- Embed prenotazione ---------- */
.embed-box {
  max-width: 800px; margin: 0 auto; border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--bg-soft); padding: 3rem 2rem; text-align: center; color: var(--muted);
}
.embed-box .big { font-size: 2.5rem; margin-bottom: 1rem; }

/* ---------- CTA banner ---------- */
.cta-banner { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color:#fff; border-radius: var(--radius); padding: 3rem 2rem; text-align:center; }
.cta-banner h2 { font-size: 1.9rem; color:#fff; }
.cta-banner p { color:#fff; opacity:1; margin:.6rem auto 1.6rem; max-width: 480px; }
.cta-banner .btn-accent { color:#fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.65); margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; padding: 3.5rem 0 2rem; }
.footer-grid h4 { color:#fff; font-size: 1rem; margin-bottom: 1rem; }
.footer-grid a { display: block; color: rgba(255,255,255,.6); font-size: .9rem; padding: .25rem 0; transition: var(--transition); }
.footer-grid a:hover { color: var(--accent); }
.footer-brand { font-family: var(--font-head); font-weight:800; font-size:1.3rem; color:#fff; display: inline-flex; align-items: center; gap: .45rem; }
.footer-brand .footer-logo { height: 38px; width: auto; display: block; }
.footer-brand .brand-name { white-space: nowrap; color: #fff; }
.footer-brand .brand-accent { color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 1.3rem 0; font-size: .82rem; text-align:center; }
@media (max-width: 640px){ .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; } }

/* ---------- Utility ---------- */
.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}.mb-3{margin-bottom:1.5rem}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:2rem;align-items:center}
@media(max-width:760px){.grid-2{grid-template-columns:1fr}}
