/* Bussola Compliance – layout PA/ACN, assessment multi-modulo professionale */
:root {
  --bg: #f2f7fc;
  --white: #fff;
  --navy: #011832;
  --blue: #0066cc;
  --blue-dark: #0052a3;
  --sky: #94c4f5;
  --muted: #5c6f82;
  --border: #c5c7c9;
  --soft: #dee2e6;
  --green: #008055;
  --yellow: #cc7a00;
  --red: #d21638;
  --font: Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  --max: 780px;
  --shadow: 0 2px 14px rgba(1, 24, 50, 0.08);
  --radius: 4px;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--navy);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: var(--blue); }
[hidden] { display: none !important; }

.app { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 1.4rem 1.1rem 3rem; }
.main:focus { outline: none; }

.topbar { position: sticky; top: 0; z-index: 40; background: var(--navy); box-shadow: 0 2px 8px rgba(1,24,50,.15); }
.topbar::after {
  content: ""; display: block; height: 4px;
  background: linear-gradient(90deg, var(--green) 0 33.33%, #fff 33.33% 66.66%, var(--red) 66.66%);
}
.topbar__inner {
  max-width: var(--max); margin: 0 auto; padding: .85rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: #fff; }
.brand__mark { color: var(--sky); display: flex; }
.brand__text strong { font-weight: 700; }

.lang-toggle {
  display: inline-flex; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25);
  border-radius: 4px; padding: 2px;
}
.lang-toggle__btn {
  border: 0; background: transparent; color: rgba(255,255,255,.75);
  padding: .35rem .7rem; border-radius: 3px; font-size: .78rem; font-weight: 700; cursor: pointer;
}
.lang-toggle__btn[aria-pressed="true"] { background: #fff; color: var(--navy); }

.progress-wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.1rem .8rem; background: var(--navy); }
.progress-bar { height: 6px; background: rgba(255,255,255,.15); border-radius: 2px; overflow: hidden; }
.progress-bar__fill { height: 100%; width: 0; background: #fff; transition: width .3s ease; }
.progress-label { margin: .35rem 0 0; font-size: .75rem; font-weight: 600; color: rgba(255,255,255,.72); text-align: right; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid transparent; border-radius: 4px; padding: .7rem 1.15rem;
  font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none; background: transparent;
}
.btn--primary { background: var(--blue); border-color: var(--blue); color: #fff !important; }
.btn--primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn--secondary { background: #fff; border-color: var(--blue); color: var(--blue) !important; }
.btn--ghost { border-color: var(--border); color: var(--navy) !important; }
.btn--ghost:hover { border-color: var(--blue); color: var(--blue) !important; background: #e7f1fa; }
.btn--xl { width: 100%; max-width: 360px; padding: .95rem 1.4rem; font-size: 1.05rem; }
.btn--lg { padding: .85rem 1.4rem; }
.btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.panel {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel__head {
  padding: 1.35rem 1.25rem 1.1rem; border-bottom: 1px solid var(--soft); background: #fff;
}
.panel__head::before {
  content: ""; display: block; height: 4px; margin: -1.35rem -1.25rem 1rem;
  background: linear-gradient(90deg, var(--green) 0 33.33%, #fff 33.33% 66.66%, var(--red) 66.66%);
}
.panel__body { padding: 1.25rem; }
.panel--feedback { border-left: 4px solid var(--blue); }

.eyebrow {
  display: inline-block; margin: 0 0 .65rem; padding: .3rem .7rem;
  font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--blue-dark); background: #e7f1fa; border: 1px solid var(--sky); border-radius: 2px;
}
.panel__head h1, .panel__head h2, .step-header h2 {
  margin: 0 0 .55rem; font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 800; letter-spacing: -.02em;
}
.lead { margin: 0; color: var(--muted); font-weight: 500; font-size: 1rem; line-height: 1.55; max-width: 54ch; }
.note { margin: 1rem 0 0; font-size: .85rem; color: var(--muted); font-weight: 500; }

.feature-list {
  list-style: none; margin: 0 0 1.4rem; padding: 0; display: flex; flex-direction: column; gap: .55rem;
}
.feature-list li {
  padding: .75rem .9rem .75rem 2.1rem; position: relative;
  background: var(--bg); border: 1px solid var(--soft); border-radius: 4px;
  font-size: .94rem; font-weight: 500; color: var(--muted); line-height: 1.45;
}
.feature-list li::before {
  content: "▸"; position: absolute; left: .75rem; top: .75rem; color: var(--blue); font-weight: 800;
}

.step-header { margin-bottom: 1rem; }
.step-badge {
  display: inline-block; margin-bottom: .35rem; font-size: .72rem; font-weight: 800;
  letter-spacing: .07em; text-transform: uppercase; color: var(--blue);
}
.step-header p { margin: 0; color: var(--muted); font-weight: 500; }
.section-tag {
  margin: 0 0 .4rem !important; font-size: .85rem !important; font-weight: 700 !important; color: var(--blue-dark) !important;
}

.module-grid { display: grid; gap: .65rem; margin-bottom: .5rem; }
.mod-card {
  display: grid; grid-template-columns: 5px 1fr; gap: 0 .9rem; align-items: start;
  padding: 1rem 1rem 1rem .85rem; border: 2px solid var(--border); border-radius: 4px;
  background: #fff; cursor: pointer; position: relative;
}
.mod-card input { position: absolute; opacity: 0; pointer-events: none; }
.mod-card__bar { grid-row: 1 / span 2; width: 5px; border-radius: 2px; min-height: 100%; align-self: stretch; }
.mod-card strong { display: block; font-size: 1.05rem; margin-bottom: .2rem; }
.mod-card small { display: block; font-size: .86rem; color: var(--muted); font-weight: 500; line-height: 1.4; }
.mod-card.is-on, .mod-card:has(input:checked) {
  border-color: var(--blue); background: #e7f1fa; box-shadow: inset 0 0 0 1px var(--blue);
}

.section-toc {
  margin: 0 0 1.2rem; padding-left: 1.2rem; color: var(--muted); font-weight: 500; line-height: 1.6;
}
.section-toc li { margin-bottom: .35rem; }

.help-box {
  background: var(--bg); border: 1px solid var(--soft); border-left: 4px solid var(--blue);
  border-radius: 4px; padding: .85rem 1rem; margin-bottom: .75rem;
}
.help-box--example { border-left-color: var(--navy); }
.help-box strong {
  display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--blue); margin-bottom: .35rem;
}
.help-box--example strong { color: var(--navy); }
.help-box p { margin: 0; font-size: .94rem; color: var(--muted); font-weight: 500; line-height: 1.5; }

.q-options { display: flex; flex-direction: column; gap: .55rem; margin: 1rem 0 .5rem; }
.opt-btn, .yn {
  width: 100%;
}
.yn { display: grid; gap: .55rem; }
.yn--3 { grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .yn:not(.yn--3) { grid-template-columns: 1fr 1fr; }
  .yn--3 { grid-template-columns: 1fr; }
}
.opt-group-title {
  margin: 1.1rem 0 .35rem;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy);
  border-bottom: 2px solid var(--blue);
  padding-bottom: .3rem;
}
.opt-group-title:first-child { margin-top: .25rem; }
.opt-group-hint {
  margin: 0 0 .55rem;
  font-size: .86rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.45;
}
.opt-btn {
  text-align: left; padding: .9rem 1rem; border-radius: 4px; border: 2px solid var(--border);
  background: #fff; font-weight: 600; font-size: .95rem; line-height: 1.4; cursor: pointer; color: var(--navy);
  width: 100%;
}
.opt-btn--stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .25rem;
}
.opt-btn--stack strong { font-size: .98rem; font-weight: 800; color: var(--navy); }
.opt-btn--stack span {
  font-size: .84rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
}
.opt-btn:hover { border-color: var(--sky); background: var(--bg); }
.opt-btn.is-on { border-color: var(--blue); background: #e7f1fa; box-shadow: inset 0 0 0 1px var(--blue); }

.toc-primer {
  list-style: none;
  margin: 0 0 .85rem -1.2rem;
  padding: .85rem 1rem;
  background: #e7f1fa;
  border: 1px solid var(--sky);
  border-left: 4px solid var(--blue);
  border-radius: 4px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--navy);
  line-height: 1.5;
}

.form-actions {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .65rem; margin-top: 1.25rem;
}
.form-actions--center { justify-content: center; }

.fb-kicker {
  margin: 0 0 .4rem; font-size: .72rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--blue);
}
.fb-body {
  margin: 0 0 1.25rem; font-size: 1.05rem; font-weight: 600; line-height: 1.55; color: var(--navy);
}

.encourage { margin: .4rem 0 1.1rem; color: var(--muted); font-weight: 600; line-height: 1.45; }
.score-row { display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: center; }
.score-box {
  width: 108px; height: 108px; border: 3px solid var(--border); border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg);
}
.score-box.is-green { border-color: var(--green); background: #e6f4ee; }
.score-box.is-yellow { border-color: var(--yellow); background: #fff4e0; }
.score-box.is-red { border-color: var(--red); background: #fce8ec; }
.score-box__n { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.score-box__u { font-size: .85rem; font-weight: 700; color: var(--muted); }
.score-label { margin: 0 0 .25rem; font-weight: 800; }
.score-note { margin: 0; font-size: .88rem; color: var(--muted); font-weight: 500; max-width: 22rem; }

.block { margin: 1.35rem 0; }
.block h3 {
  margin: 0 0 .75rem; font-size: 1rem; font-weight: 800;
  border-bottom: 2px solid var(--blue); padding-bottom: .35rem;
}

.class-badge {
  display: inline-block; padding: .75rem 1.2rem; font-weight: 800; font-size: 1.1rem;
  border: 2px solid var(--border); border-radius: 4px; margin-bottom: .65rem;
}
.class-badge--essenziale { background: #fce8ec; border-color: var(--red); color: #7a1f2e; }
.class-badge--importante { background: #e7f1fa; border-color: var(--blue); color: var(--blue-dark); }
.class-badge--fuori { background: #f0f2f4; border-color: var(--border); color: var(--muted); }
.class-why { margin: 0 0 .35rem; font-weight: 600; color: var(--navy); line-height: 1.45; }
.class-conf { margin: 0; font-size: .88rem; color: var(--muted); font-weight: 600; }

.sec-bars { display: flex; flex-direction: column; gap: .75rem; }
.sec-bar__meta { display: flex; justify-content: space-between; gap: .75rem; margin-bottom: .3rem; font-size: .88rem; }
.sec-bar__meta strong { font-weight: 700; }
.sec-bar__meta span { color: var(--muted); font-weight: 600; white-space: nowrap; }
.sec-bar__track { height: 10px; background: var(--soft); border-radius: 2px; overflow: hidden; }
.sec-bar__fill { height: 100%; border-radius: 2px; background: var(--blue); }
.sec-bar__fill.is-green { background: var(--green); }
.sec-bar__fill.is-yellow { background: var(--yellow); }
.sec-bar__fill.is-red { background: var(--red); }

.actions-grid {
  display: grid; gap: .65rem;
}
@media (min-width: 700px) { .actions-grid { grid-template-columns: repeat(3, 1fr); } }
.actions-grid > div {
  background: var(--bg); border: 1px solid var(--soft); border-radius: 4px; padding: .9rem;
}
.actions-grid h4 {
  margin: 0 0 .55rem; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 800; color: var(--blue-dark);
}
.actions-grid ul { margin: 0; padding: 0; list-style: none; }
.actions-grid li {
  position: relative; padding: 0 0 .5rem .9rem; font-size: .88rem; font-weight: 500; color: var(--navy); line-height: 1.4;
}
.actions-grid li::before {
  content: ""; position: absolute; left: 0; top: .45em; width: 6px; height: 6px; background: var(--blue); border-radius: 1px;
}

.neai-box {
  margin: 1.4rem 0; padding: 1.35rem 1.15rem; text-align: center;
  border: 1px solid var(--border); border-radius: 4px; background: #fff; position: relative; overflow: hidden;
}
.neai-box::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--green) 0 33.33%, #fff 33.33% 66.66%, var(--red) 66.66%);
}
.neai-box h3 { margin: .2rem 0 .85rem; font-size: 1.05rem; font-weight: 800; }
.neai-box ul {
  list-style: none; margin: 0 auto 1rem; padding: 0; max-width: 22rem; text-align: left;
  display: grid; gap: .4rem;
}
.neai-box li {
  padding: .55rem .75rem; background: var(--bg); border: 1px solid var(--soft); border-radius: 4px;
  font-weight: 600; font-size: .9rem;
}

.disclaimer { margin: 1rem 0; font-size: .78rem; color: var(--muted); line-height: 1.5; }

.site-footer {
  padding: 1.1rem; text-align: center; border-top: 1px solid var(--border); background: #fff;
  font-size: .78rem; color: var(--muted);
}
.site-footer__brand { margin: 0 0 .2rem; font-weight: 700; color: var(--navy); }
.site-footer__note { margin: 0; }

.screen--welcome { min-height: calc(100vh - 150px); display: flex; align-items: center; }

.toast {
  position: fixed; bottom: 1.3rem; left: 50%; transform: translateX(-50%) translateY(120%);
  background: #fff; border: 1px solid var(--red); color: #7a1f2e; padding: .7rem 1.1rem;
  border-radius: 4px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); z-index: 100;
  transition: transform .3s ease; max-width: 90vw;
}
.toast.is-visible { transform: translateX(-50%) translateY(0); }

@media print {
  .topbar, .site-footer, .form-actions { display: none !important; }
}
