:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #eef3f7;
  --ink: #17202a;
  --muted: #64707d;
  --line: #d7dde4;
  --accent: #2458a7;
  --accent-strong: #173d78;
  --green: #18764a;
  --green-soft: #def4e8;
  --amber: #a76712;
  --amber-soft: #fff0d1;
  --shadow: 0 18px 55px rgba(30, 42, 58, 0.08);
  --radius: 18px;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Anchor targets must clear the sticky header. */
  scroll-padding-top: 88px;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(
      180deg,
      rgba(36, 88, 167, 0.09),
      rgba(36, 88, 167, 0) 420px
    ),
    var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

a {
  color: var(--accent-strong);
}

.wrap {
  width: min(1080px, 100% - clamp(32px, 8vw, 96px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(215, 221, 228, 0.85);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding-block: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}

.brand .mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.brand img.mark {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}

.brand-name {
  display: block;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand-tag {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.btn.primary {
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 12px 30px rgba(36, 88, 167, 0.28);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(36, 88, 167, 0.32);
}

.btn.ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.btn.ghost:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.btn.small {
  padding: 9px 16px;
  font-size: 14px;
}

/* ---------- sections ---------- */

section {
  padding-block: clamp(48px, 7vw, 88px);
}

section + section {
  border-top: 1px solid rgba(215, 221, 228, 0.6);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 5.4vw, 56px);
}

h2 {
  margin: 0 0 16px;
  font-size: clamp(26px, 3.4vw, 36px);
}

h3 {
  margin: 0 0 10px;
  font-size: 19px;
}

p {
  margin: 0 0 16px;
}

.lead {
  max-width: 62ch;
  font-size: clamp(17px, 1.5vw, 20px);
  color: #33404d;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 14px;
}

.promo-banner {
  padding-block: 24px;
  background: var(--amber-soft);
  border-bottom: 1px solid #e5c88f;
}

.promo-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.promo-label {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  background: #8a4c08;
  font-size: 12px;
  font-weight: 700;
}

.promo-title {
  margin: 8px 0 4px;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.promo-description {
  margin: 0;
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(56px, 9vw, 104px);
}

.hero h1 {
  max-width: 20ch;
  font-size: clamp(31px, 4.6vw, 48px);
}

.hero-punch {
  max-width: 22ch;
  margin: 0 0 20px;
  font-size: clamp(21px, 2.9vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--accent-strong);
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-note {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}

.promise {
  margin-top: 40px;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid rgba(36, 88, 167, 0.18);
  border-radius: var(--radius);
  background: linear-gradient(
    140deg,
    rgba(36, 88, 167, 0.07),
    rgba(255, 255, 255, 0.6)
  );
}

.promise p {
  max-width: 60ch;
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  text-wrap: balance;
}

.promise .small {
  margin-top: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* ---------- cards ---------- */

.grid {
  display: grid;
  gap: 20px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card {
  padding: clamp(20px, 2.6vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card p:last-child {
  margin-bottom: 0;
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding-inline: 8px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 700;
}

.card-link {
  display: inline-block;
  margin-top: 6px;
  font-weight: 600;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
}

/* ---------- method steps ---------- */

.steps {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.steps li {
  padding: clamp(20px, 2.6vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.steps strong {
  display: block;
  margin-bottom: 4px;
  font-size: 17px;
}

.steps p {
  margin: 0;
  color: var(--muted);
}

/* ---------- fact list ---------- */

.facts {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.facts div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding: 14px 20px;
}

.facts div + div {
  border-top: 1px solid var(--line);
}

.facts dt {
  min-width: 190px;
  font-weight: 600;
}

.facts dd {
  margin: 0;
  color: var(--muted);
  flex: 1 1 260px;
}

/* ---------- materials ---------- */

.materials-empty {
  display: grid;
  gap: 10px;
  place-items: start;
  padding: clamp(26px, 4vw, 44px);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
}

.materials-empty .badge {
  background: var(--amber-soft);
  color: var(--amber);
}

/* ---------- faq ---------- */

.faq {
  display: grid;
  gap: 12px;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.faq summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  float: right;
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "–";
}

.faq details p {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--muted);
}

/* ---------- cta band ---------- */

.cta-band {
  margin-block: clamp(48px, 7vw, 80px);
  padding: clamp(30px, 5vw, 54px);
  border-radius: 26px;
  background: linear-gradient(140deg, var(--accent-strong), var(--accent));
  color: #fff;
  text-align: center;
}

.cta-band h2 {
  color: #fff;
}

.cta-band p {
  max-width: 52ch;
  margin-inline: auto;
  color: rgba(255, 255, 255, 0.86);
}

.cta-band .btn.ghost {
  border-color: rgba(255, 255, 255, 0.55);
  background: transparent;
  color: #fff;
}

.cta-band .btn.primary {
  background: #fff;
  color: var(--accent-strong);
  box-shadow: none;
}

/* ---------- breadcrumb + prose ---------- */

.breadcrumb {
  padding-top: 28px;
  font-size: 14px;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
}

.prose h2 {
  margin-top: 40px;
}

.prose ul {
  margin: 0 0 18px;
  padding-left: 22px;
  color: #33404d;
}

.prose li {
  margin-bottom: 8px;
}

.prose p {
  max-width: 72ch;
}

/* ---------- footer ---------- */

.site-footer {
  padding-block: 36px 48px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.independence-note,
.legal-notice {
  max-width: 78ch;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: var(--surface);
  font-size: 15px;
  color: var(--ink);
}

.legal-notice {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.footer-identity {
  flex-basis: 100%;
}

.footer-identity p {
  margin: 0 0 8px;
}

.legal-page {
  padding-bottom: 56px;
}

.legal-page h1 {
  font-size: clamp(30px, 5vw, 48px);
  overflow-wrap: anywhere;
}

.legal-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 24px 0 32px;
}

.legal-prose {
  max-width: 900px;
}

.legal-prose h2 {
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.3;
}

.legal-prose blockquote,
.withdrawal-template {
  margin: 20px 0;
  padding: 18px 22px;
  border-left: 4px solid var(--accent);
  background: var(--surface-soft);
  border-radius: 0 12px 12px 0;
}

.withdrawal-template h3 {
  margin-top: 0;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.legal-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 15px;
}

.legal-table th,
.legal-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.legal-table th {
  background: var(--surface-soft);
}

.legal-table code {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.legal-table tr:last-child td {
  border-bottom: 0;
}

.legal-navigation a:focus-visible,
.site-footer a:focus-visible,
.table-scroll:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.ai-feature {
  background: var(--surface-soft);
  border-block: 1px solid var(--line);
}

.ai-feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
}

.ai-feature-guide ol {
  padding-left: 22px;
}

.ai-feature-guide li + li {
  margin-top: 12px;
}

.ai-example {
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--surface-soft);
}

.ai-feature .hero-actions {
  align-items: center;
  margin-bottom: 18px;
}

/* ---------- narrow screens ---------- */

@media (min-width: 901px) {
  .hero-home h1,
  .hero-home .lead,
  .hero-home .independence-note,
  .legal-prose,
  .legal-prose p {
    max-width: none;
  }
}

/* Below this width the nav wraps onto a second row, which makes a sticky
   header tall enough to sit on top of the page heading. Let it scroll away. */
@media (max-width: 900px) {
  .ai-feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  html {
    scroll-padding-top: 16px;
  }

  .site-header {
    position: static;
  }

  .site-header .wrap {
    justify-content: flex-start;
    gap: 10px 18px;
  }

  .site-nav {
    gap: 8px 16px;
    font-size: 14px;
  }

  .site-nav a {
    font-size: 14px;
  }

  .hero {
    padding-top: clamp(32px, 6vw, 56px);
  }

  .facts dt {
    min-width: 100%;
  }

  .steps.grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer .wrap {
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .steps.grid.three {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Public course materials follow the same build-time flag as the app. */
body:not([data-show-manual="true"]) #materiale,
body:not([data-show-manual="true"]) .site-nav a[href="#materiale"] {
  display: none;
}
