/* ============================================================
   NIS2 Readiness Assessment — Castaldo Solutions
   Lean, on-brand stylesheet (light). Embedded via iframe.
   ============================================================ */

:root {
  --c-primary: #0057B7;
  --c-primary-dark: #004494;
  --c-primary-darker: #003371;
  --c-ink: #0f1b2d;
  --c-text: #1f2937;
  --c-muted: #5b6b7f;
  --c-bg: #FAFAFA;
  --c-surface: #ffffff;
  --c-border: #e2e8f0;
  --c-border-strong: #cbd5e1;
  --c-primary-soft: #eef4fc;

  --sem-green: #16a34a;
  --sem-green-bg: #f0fdf4;
  --sem-yellow: #d97706;
  --sem-yellow-bg: #fffbeb;
  --sem-red: #dc2626;
  --sem-red-bg: #fef2f2;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(15, 27, 45, 0.06);
  --shadow-md: 0 6px 18px rgba(15, 27, 45, 0.08);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--c-text); }

body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; color: var(--c-ink); line-height: 1.25; font-weight: 700; }
p { margin: 0 0 1rem 0; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---- Section management ---- */
.section { display: none; padding: 40px 0; }
.section.active { display: block; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius); border: 1px solid transparent;
  font-size: 1rem; font-weight: 600; font-family: inherit; cursor: pointer;
  text-decoration: none; transition: all .2s ease; line-height: 1.2;
}
.btn--primary { background: var(--c-primary); color: #fff; box-shadow: 0 4px 12px rgba(0, 87, 183, .25); }
.btn--primary:hover { background: var(--c-primary-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 87, 183, .35); }
.btn--outline { background: transparent; color: var(--c-primary); border-color: var(--c-border-strong); }
.btn--outline:hover { background: var(--c-primary-soft); border-color: var(--c-primary); }
.btn--ghost { background: transparent; color: var(--c-muted); }
.btn--ghost:hover { color: var(--c-primary); }
.btn--lg { padding: 14px 28px; font-size: 1.0625rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---- Homepage / Hero ---- */
.main-header { text-align: center; max-width: 760px; margin: 0 auto 40px; }
.eyebrow {
  display: inline-block; background: var(--c-primary-soft); color: var(--c-primary);
  font-size: .8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 6px 14px; border-radius: var(--radius-full); margin-bottom: 16px;
}
.main-header h1 { font-size: 2.25rem; color: var(--c-primary); margin-bottom: 14px; }
.subtitle { font-size: 1.125rem; color: var(--c-muted); }

.intro-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; max-width: 920px; margin: 0 auto 36px;
}
.intro-card {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.intro-card .ic-icon { font-size: 1.5rem; margin-bottom: 8px; }
.intro-card h3 { font-size: 1.0625rem; margin-bottom: 6px; }
.intro-card p { font-size: .9375rem; color: var(--c-muted); margin: 0; }

.pillars-preview {
  max-width: 920px; margin: 0 auto 36px; background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 28px;
}
.pillars-preview h2 { font-size: 1.375rem; text-align: center; margin-bottom: 6px; }
.pillars-preview .pp-intro { text-align: center; color: var(--c-muted); margin-bottom: 22px; font-size: .9375rem; }
.pillars-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 28px; }
.pillar-chip { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: .9375rem; }
.pillar-chip:nth-last-child(-n+2) { border-bottom: none; }
.pillar-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: var(--radius-full);
  background: var(--c-primary-soft); color: var(--c-primary); font-weight: 700; font-size: .875rem;
  display: flex; align-items: center; justify-content: center;
}
.start-assessment { text-align: center; }
.start-note { font-size: .875rem; color: var(--c-muted); margin-top: 12px; }

/* ---- Profile / Perimetro step ---- */
.profile-wrap { max-width: 640px; margin: 0 auto; }
.profile-card {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-sm);
}
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: 8px; color: var(--c-ink); }
.form-control {
  display: block; width: 100%; padding: 12px 14px; font-size: 1rem; font-family: inherit;
  color: var(--c-text); background: var(--c-surface); border: 1px solid var(--c-border-strong);
  border-radius: var(--radius); transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6b7f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}
.form-control:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(0, 87, 183, .15); }
.form-hint { font-size: .8125rem; color: var(--c-muted); margin: 6px 0 0; }

/* ---- Survey ---- */
.survey-header { margin-bottom: 36px; }
.progress-container { max-width: 640px; margin: 0 auto; text-align: center; }
.progress-bar { width: 100%; height: 8px; background: #e8edf3; border-radius: var(--radius-full); overflow: hidden; margin-bottom: 10px; }
.progress-fill { height: 100%; background: var(--c-primary); border-radius: var(--radius-full); transition: width .3s ease; width: 0; }
.progress-text { font-size: .875rem; color: var(--c-muted); font-weight: 600; }
.area-badge {
  display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: var(--radius-full);
  background: var(--c-primary-soft); color: var(--c-primary); font-size: .75rem; font-weight: 700;
}

.survey-content { max-width: 760px; margin: 0 auto 36px; }
.survey-step { display: none; }
.survey-step.active { display: block; }
.survey-step .step-eyebrow { color: var(--c-primary); font-weight: 700; font-size: .8125rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.survey-step h2 { color: var(--c-ink); font-size: 1.5rem; margin-bottom: 10px; }
.step-description { color: var(--c-muted); margin-bottom: 28px; font-size: 1.0625rem; }

.questions-container { display: flex; flex-direction: column; gap: 24px; }
.question { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 22px; }
.question-text { font-size: 1.0625rem; font-weight: 600; margin-bottom: 16px; color: var(--c-ink); }
.options { display: flex; flex-direction: column; gap: 8px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--c-border); border-radius: var(--radius); cursor: pointer; transition: all .15s;
}
.option:hover { background: var(--c-primary-soft); border-color: #c7dbf3; }
.option input[type="radio"] { margin-top: 3px; accent-color: var(--c-primary); width: 16px; height: 16px; flex-shrink: 0; }
.option-text { font-size: .9375rem; color: var(--c-text); line-height: 1.45; }
.option:has(input:checked) { background: var(--c-primary-soft); border-color: var(--c-primary); }

.survey-navigation { display: flex; justify-content: space-between; max-width: 760px; margin: 0 auto; gap: 16px; }

/* ---- Results ---- */
.results-header { text-align: center; margin-bottom: 36px; }
.results-header h2 { font-size: 2rem; color: var(--c-primary); margin-bottom: 6px; }
.results-subtitle { font-size: 1.0625rem; color: var(--c-muted); }
.results-content { max-width: 940px; margin: 0 auto; }

.score-section {
  display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: center;
  margin-bottom: 36px; padding: 32px; background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.gauge-container { position: relative; width: 240px; height: 240px; margin: 0 auto; }
.gauge-fill {
  width: 100%; height: 100%; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--c-primary) 0deg, #e8edf3 0deg);
  transition: background .8s ease-out;
}
.gauge-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 180px; height: 180px; border-radius: 50%; background: var(--c-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid var(--c-border);
}
.score-value { font-size: 3.25rem; font-weight: 800; color: var(--c-primary); line-height: 1; }
.score-label { font-size: 1rem; color: var(--c-muted); }
.score-interpretation h3 { font-size: 1.625rem; margin-bottom: 10px; }
.score-interpretation p { color: var(--c-muted); }

/* Classification badge (perimetro) */
.classification-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--radius-full);
  font-weight: 700; font-size: .9375rem; margin-bottom: 14px;
}
.cl-essenziale { background: #fde8e8; color: #b91c1c; }
.cl-importante { background: #fef3c7; color: #b45309; }
.cl-fornitore { background: #e0ecfb; color: var(--c-primary-dark); }
.cl-fuori { background: #e8f6ee; color: #15803d; }
.cl-pubblico { background: #e8eafd; color: #4338ca; }
.classification-note { font-size: .9375rem; color: var(--c-muted); }

/* Section headings inside results */
.results-block { margin-bottom: 36px; }
.results-block > h3 { font-size: 1.375rem; margin-bottom: 18px; color: var(--c-ink); }

/* Breakdown with semaphore */
.breakdown-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.breakdown-item { background: var(--c-surface); border: 1px solid var(--c-border); border-left-width: 4px; border-radius: var(--radius); padding: 16px 18px; }
.breakdown-item.sem-green { border-left-color: var(--sem-green); }
.breakdown-item.sem-yellow { border-left-color: var(--sem-yellow); }
.breakdown-item.sem-red { border-left-color: var(--sem-red); }
.breakdown-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.breakdown-title { font-size: .9375rem; font-weight: 600; color: var(--c-ink); }
.breakdown-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sem-dot { width: 12px; height: 12px; border-radius: 50%; }
.sem-green .sem-dot, .dot-green { background: var(--sem-green); }
.sem-yellow .sem-dot, .dot-yellow { background: var(--sem-yellow); }
.sem-red .sem-dot, .dot-red { background: var(--sem-red); }
.breakdown-score { font-size: 1.0625rem; font-weight: 700; color: var(--c-ink); }
.breakdown-bar { width: 100%; height: 7px; background: #e8edf3; border-radius: var(--radius-full); overflow: hidden; }
.breakdown-fill { height: 100%; border-radius: var(--radius-full); transition: width .8s ease-out; }
.sem-green .breakdown-fill { background: var(--sem-green); }
.sem-yellow .breakdown-fill { background: var(--sem-yellow); }
.sem-red .breakdown-fill { background: var(--sem-red); }

/* Risk panel */
.risk-banner {
  display: flex; gap: 16px; align-items: flex-start; padding: 22px 24px; border-radius: var(--radius-lg);
  border: 1px solid; margin-bottom: 18px;
}
.risk-banner .rb-icon { font-size: 1.75rem; line-height: 1; }
.risk-banner h4 { font-size: 1.25rem; margin-bottom: 6px; }
.risk-banner p { margin: 0; font-size: .9375rem; }
.risk-critico { background: var(--sem-red-bg); border-color: #fecaca; color: #7f1d1d; }
.risk-alto { background: #fff4ed; border-color: #fed7aa; color: #9a3412; }
.risk-medio { background: var(--sem-yellow-bg); border-color: #fde68a; color: #92400e; }
.risk-basso { background: var(--sem-green-bg); border-color: #bbf7d0; color: #166534; }
.sanctions-note {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 16px 18px; font-size: .9375rem; color: var(--c-muted);
}
.sanctions-note strong { color: var(--c-ink); }

/* Criticità cards */
.criticality { background: var(--c-surface); border: 1px solid var(--c-border); border-left: 4px solid var(--sem-red); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.criticality.sev-yellow { border-left-color: var(--sem-yellow); }
.criticality-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.criticality-title { font-weight: 700; color: var(--c-ink); font-size: 1rem; }
.criticality-text { color: var(--c-muted); font-size: .9375rem; margin: 0; }
.criticality-actions { list-style: none; padding: 0; margin: 8px 0 0; }
.criticality-actions li { position: relative; padding: 3px 0 3px 22px; font-size: .9375rem; color: var(--c-text); line-height: 1.4; }
.criticality-actions li::before { content: "→"; position: absolute; left: 2px; color: var(--c-primary); font-weight: 700; }
.no-criticality { background: var(--sem-green-bg); border: 1px solid #bbf7d0; border-radius: var(--radius); padding: 16px 18px; color: #166534; }

/* Roadmap */
.roadmap-phases { display: grid; gap: 18px; }
.roadmap-phase { padding: 22px; background: var(--c-surface); border: 1px solid var(--c-border); border-left: 4px solid var(--c-primary); border-radius: var(--radius); }
.phase-header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.phase-icon { font-size: 1.625rem; }
.phase-title { font-size: 1.125rem; font-weight: 700; color: var(--c-ink); margin-bottom: 2px; }
.phase-duration { font-size: .8125rem; color: var(--c-muted); font-weight: 600; }
.phase-actions { list-style: none; padding: 0; margin: 0; }
.phase-actions li { padding: 6px 0 6px 24px; position: relative; font-size: .9375rem; color: var(--c-text); }
.phase-actions li::before { content: "→"; position: absolute; left: 0; color: var(--c-primary); font-weight: 700; }

/* CTA */
.results-cta {
  margin-top: 8px; padding: 32px; text-align: center; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-darker) 100%); color: #fff;
}
.results-cta h3 { color: #fff; font-size: 1.5rem; margin-bottom: 10px; }
.results-cta p { color: rgba(255, 255, 255, .9); margin-bottom: 22px; max-width: 560px; margin-left: auto; margin-right: auto; }
.results-cta .btn--primary { background: #fff; color: var(--c-primary); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.results-cta .btn--primary:hover { background: #f1f5f9; }
.results-cta .btn--outline { color: #fff; border-color: rgba(255,255,255,.6); }
.results-cta .btn--outline:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.cta-grid { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.results-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

.disclaimer { max-width: 760px; margin: 28px auto 0; text-align: center; font-size: .8125rem; color: var(--c-muted); font-style: italic; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .main-header h1 { font-size: 1.75rem; }
  .pillars-list { grid-template-columns: 1fr; }
  .pillar-chip:nth-last-child(-n+2) { border-bottom: 1px solid #f1f5f9; }
  .pillar-chip:last-child { border-bottom: none; }
  .score-section { grid-template-columns: 1fr; text-align: center; gap: 24px; }
  .classification-badge { margin-left: auto; margin-right: auto; }
  .survey-navigation { flex-direction: column-reverse; }
  .survey-navigation .btn { width: 100%; }
  .gauge-container { width: 210px; height: 210px; }
  .gauge-center { width: 158px; height: 158px; }
  .score-value { font-size: 2.5rem; }
}
