/* ── NIS2 Compliance – Custom Styles ─────────────────────── */

:root {
  --nis2-dark:   #1a1a2e;
  --nis2-blue:   #4361ee;
  --nis2-light:  #f0f4f8;
}

/* Navbar */
.bg-nis2 { background: var(--nis2-dark) !important; }

/* Hero */
.hero-section {
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  color: #fff;
  padding-bottom: 3rem;
}
.hero-icon {
  font-size: 4rem;
  color: #4361ee;
  text-shadow: 0 0 30px rgba(67,97,238,.6);
}
.hero-icon i { filter: drop-shadow(0 0 12px rgba(67,97,238,.8)); }
.hero-section h1 { color: #fff; }
.hero-section p  { color: rgba(255,255,255,.75); }

/* Type cards */
.tipo-card { border-width: 2px !important; transition: transform .2s, box-shadow .2s; }
.tipo-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,.12) !important; }

/* Step icons */
.step-icon {
  width: 40px; height: 40px;
  line-height: 40px; font-weight: bold; font-size: 1rem;
}

/* Sidebar */
.sidebar {
  background: #fff;
  border-right: 1px solid #e9ecef;
  min-height: calc(100vh - 60px);
  position: sticky;
  top: 56px;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
}
.sidebar-link {
  color: #1a1a2e;
  font-size: .875rem;
  transition: background .15s;
}
.sidebar-link:hover { background: rgba(67,97,238,.06) !important; }
.sidebar-link.active { color: #1a1a2e; font-weight: 600; }

/* Function header */
.funzione-header { box-shadow: 0 4px 16px rgba(0,0,0,.15); }

/* Categoria header */
.categoria-header {
  background: #f8f9ff;
  font-size: .95rem;
  padding: .75rem 1rem;
}

/* Codice group */
.codice-group { border-bottom: 1px solid #f0f0f0; }
.codice-group:last-child { border-bottom: none; }
.codice-header { font-size: .85rem; }

/* Question item */
.domanda-item {
  background: #fafbff;
  border: 1px solid #e8ecf8;
  transition: border-color .2s;
}
.domanda-item:hover { border-color: #aab8f5; }

.requisito-text { font-size: .9rem; line-height: 1.5; }

/* Answer badges (labels acting as buttons) */
.badge-risposta {
  cursor: pointer;
  border-radius: 20px;
  padding: .3em .9em;
  font-size: .85rem;
  font-weight: 600;
  transition: opacity .15s, transform .1s;
  border: 2px solid transparent;
}
.badge-risposta:hover { opacity: .85; transform: scale(1.05); }

.form-check-input:checked + .badge-success  { background: #2dc653; color: #fff; border-color: #2dc653; }
.form-check-input:checked + .badge-danger   { background: #e63946; color: #fff; border-color: #e63946; }
.form-check-input:checked + .badge-secondary{ background: #6c757d; color: #fff; border-color: #6c757d; }

.badge-success   { background: rgba(45,198,83,.1);  color: #2dc653; border-color: #2dc653; }
.badge-danger    { background: rgba(230,57,70,.1);  color: #e63946; border-color: #e63946; }
.badge-secondary { background: rgba(108,117,125,.1); color: #6c757d; border-color: #6c757d; }

/* Hide radio inputs visually but keep accessible */
.form-check-input.risposta-radio {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.form-check.form-check-inline { margin-right: 0; }

/* Comment box */
.commento-box {
  border-left: 3px solid #2dc653;
  padding-left: .75rem;
  margin-top: .5rem;
}

/* Global score circle */
.global-score { display: inline-block; }
.score-circle {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: conic-gradient(
    var(--color) calc(var(--pct) * 1%),
    #e8ecf8 0
  );
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  position: relative;
}
.score-circle::before {
  content: '';
  position: absolute;
  width: 72px; height: 72px;
  background: #fff;
  border-radius: 50%;
}
.score-value {
  position: relative; z-index: 1;
  font-size: 1.4rem; font-weight: 900;
  color: var(--color);
}

/* Badge funzione */
.badge-funzione { font-size: .75rem; }

/* Report accordion */
.accordion-button:not(.collapsed) { color: #4361ee; background: #f0f4ff; box-shadow: none; }
.accordion-button:focus { box-shadow: none; }

/* Table improvements */
.table-hover tbody tr:hover { background: #f0f4ff; }

/* Info alert */
.alert { font-size: .9rem; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { position: relative; min-height: auto; top: 0; border-right: none; border-bottom: 1px solid #e9ecef; }
  .hero-icon { font-size: 2.5rem; }
}
