/* Diagnostico NIS2 - Modale */
.dgn-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 20px; }
.dgn-overlay.dgn-open { display: flex; animation: dgn-fadein .2s ease-out; }
@keyframes dgn-fadein { from { opacity: 0; } to { opacity: 1; } }
.dgn-card { background: #fff; border-radius: 16px; max-width: 640px; width: 100%; max-height: 92vh; overflow-y: auto; box-shadow: 0 25px 50px -12px rgba(0,0,0,.3); animation: dgn-slidein .25s cubic-bezier(.16,1,.3,1); display: flex; flex-direction: column; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; color: #0f172a; }
@keyframes dgn-slidein { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.dgn-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 28px 16px; border-bottom: 1px solid #e2e8f0; }
.dgn-head-title { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #0f172a; font-size: 1rem; }
.dgn-head-icon { font-size: 1.3rem; }
.dgn-close { width: 36px; height: 36px; background: transparent; border: none; border-radius: 8px; cursor: pointer; font-size: 1.6rem; line-height: 1; color: #64748b; display: flex; align-items: center; justify-content: center; font-family: inherit; }
.dgn-close:hover { background: #f1f5f9; color: #0f172a; }
.dgn-progress { padding: 14px 28px 4px; display: flex; align-items: center; gap: 12px; }
.dgn-progress-track { flex: 1; height: 5px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.dgn-progress-fill { height: 100%; background: #1e40af; border-radius: 3px; transition: width .3s ease; }
.dgn-progress-label { font-family: 'JetBrains Mono', monospace; font-size: .72rem; color: #64748b; letter-spacing: .05em; text-transform: uppercase; }
.dgn-body { padding: 14px 28px 28px; }
.dgn-q-title { font-size: 1.2rem; font-weight: 700; color: #0f172a; margin: 6px 0 6px; line-height: 1.3; }
.dgn-q-hint { font-size: .88rem; color: #64748b; margin: 0 0 18px; line-height: 1.5; }
.dgn-opt { display: flex; align-items: flex-start; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 8px; background: #fff; border: 1.5px solid #e2e8f0; border-radius: 12px; cursor: pointer; transition: all .15s; font-family: inherit; color: #0f172a; }
.dgn-opt:hover { border-color: #1e40af; background: #f8fafc; transform: translateY(-1px); }
.dgn-opt-icon { font-size: 1.4rem; line-height: 1; margin-top: 2px; flex-shrink: 0; width: 28px; text-align: center; }
.dgn-opt-text { flex: 1; display: flex; flex-direction: column; }
.dgn-opt-title { font-size: .95rem; font-weight: 700; margin: 0 0 3px; }
.dgn-opt-sub { font-size: .85rem; color: #475569; margin: 0; line-height: 1.45; }
.dgn-back { background: transparent; border: none; color: #64748b; font-size: .85rem; cursor: pointer; padding: 10px 4px 4px; margin-top: 4px; font-family: inherit; font-weight: 500; }
.dgn-back:hover { color: #0f172a; }
.dgn-result { padding: 24px; border-radius: 14px; margin-bottom: 18px; }
.dgn-r-essenziale { background: #fee2e2; } .dgn-r-importante { background: #fef3c7; } .dgn-r-legge90 { background: #dbeafe; } .dgn-r-supply { background: #ede9fe; } .dgn-r-fuori { background: #f1f5f9; }
.dgn-r-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dgn-r-icon { font-size: 1.8rem; }
.dgn-r-badge { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: .7rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; letter-spacing: .05em; text-transform: uppercase; }
.dgn-r-essenziale .dgn-r-title { color: #791F1F; } .dgn-r-importante .dgn-r-title { color: #633806; } .dgn-r-legge90 .dgn-r-title { color: #0C447C; } .dgn-r-supply .dgn-r-title { color: #3C3489; } .dgn-r-fuori .dgn-r-title { color: #1f2937; }
.dgn-r-essenziale .dgn-r-badge { background: rgba(185,28,28,.18); color: #791F1F; } .dgn-r-importante .dgn-r-badge { background: rgba(180,83,9,.18); color: #633806; } .dgn-r-legge90 .dgn-r-badge { background: rgba(29,78,216,.18); color: #0C447C; } .dgn-r-supply .dgn-r-badge { background: rgba(109,40,217,.18); color: #3C3489; } .dgn-r-fuori .dgn-r-badge { background: rgba(71,85,105,.18); color: #1f2937; }
.dgn-r-title { font-size: 1.35rem; font-weight: 800; margin: 0 0 10px; line-height: 1.25; }
.dgn-r-body { font-size: .93rem; line-height: 1.65; margin: 0; color: #0f172a; }
.dgn-r-extra { margin-top: 12px; padding: 12px 14px; background: rgba(255,255,255,.7); border-radius: 8px; font-size: .85rem; line-height: 1.55; color: #0f172a; }
.dgn-r-extra strong { font-weight: 700; }
.dgn-r-norm { font-size: .8rem; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid rgba(0,0,0,.08); line-height: 1.5; color: #475569; }
.dgn-r-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.dgn-r-cta-primary { background: #1e40af; color: #fff; padding: 12px 22px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: .93rem; display: inline-flex; align-items: center; gap: 6px; transition: background .15s; }
.dgn-r-cta-primary:hover { background: #1e3a8a; color: #fff; }
.dgn-r-cta-secondary { background: #fff; color: #1e40af; padding: 10.5px 22px; border-radius: 10px; border: 1.5px solid #1e40af; font-family: inherit; font-size: .93rem; font-weight: 600; cursor: pointer; }
.dgn-r-cta-secondary:hover { background: #eff6ff; }
.dgn-trail { font-family: 'JetBrains Mono', monospace; font-size: .7rem; color: #64748b; margin: 10px 0 0; padding: 8px 12px; background: #f8fafc; border-radius: 6px; line-height: 1.5; word-break: break-word; }
@media (max-width: 720px) { .dgn-head { padding: 18px 20px 14px; } .dgn-progress { padding: 12px 20px 4px; } .dgn-body { padding: 12px 20px 22px; } .dgn-q-title { font-size: 1.05rem; } }

/* Hero: bottone diagnostico grande con pulse animato */
.btn-diagnostico-hero {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #2348D5;
  color: #fff;
  border: none;
  padding: 18px 42px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(35, 72, 213, 0.3);
  animation: dgn-pulse-ring 2s infinite;
  transition: background 0.15s, transform 0.1s;
}
.btn-diagnostico-hero:hover {
  background: #1B3CB8;
  animation-play-state: paused;
  transform: translateY(-1px);
}
.btn-diagnostico-hero:active {
  transform: scale(0.98);
}
.btn-diagnostico-hero i {
  font-size: 1.25rem;
}
@keyframes dgn-pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(35,72,213,0.5), 0 4px 14px rgba(35,72,213,0.3); }
  70% { box-shadow: 0 0 0 18px rgba(35,72,213,0), 0 4px 14px rgba(35,72,213,0.3); }
  100% { box-shadow: 0 0 0 0 rgba(35,72,213,0), 0 4px 14px rgba(35,72,213,0.3); }
}

/* Hero: nota ENISA sotto il titolo */
.hero-enisa-note {
  font-size: 0.9rem;
  color: #64748b;
  text-align: center;
  max-width: 760px;
  margin: -10px auto 30px;
  line-height: 1.5;
  font-style: normal;
}
.hero-enisa-note em {
  color: #475569;
}


/* CAMPO RICERCA OPZIONI (attivo se >=5 opzioni) */
.dgn-search-wrap { margin: 8px 0 16px; }
.dgn-search-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #d0d7de;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #f8f9fa;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
  outline: none;
}
.dgn-search-input:focus {
  border-color: #204E9A;
  background: white;
  box-shadow: 0 0 0 3px rgba(32, 78, 154, 0.08);
}
.dgn-search-input::placeholder { color: #888; }
.dgn-search-empty {
  margin: 16px 4px;
  padding: 14px;
  background: #fff8e6;
  border-left: 3px solid #f5a623;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #5c4400;
  text-align: center;
}
.dgn-opts-list { display: flex; flex-direction: column; gap: 0; }
@media (max-width: 720px) {
  .dgn-search-input { padding: 10px 14px; font-size: 0.9rem; }
}

/* === NIS2 Diagnostico - Form lead capture + Help CTA === */
.dgn-hp { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }
.dgn-leadform-wrap { margin-top: 24px; padding: 20px 22px 22px; background: #f5f7fa; border: 1px solid #e1e7ef; border-radius: 10px; }
.dgn-leadform-title { margin: 0 0 6px; font-size: 1.15rem; font-weight: 700; color: #102a43; }
.dgn-leadform-sub { margin: 0 0 16px; font-size: 0.92rem; color: #486581; line-height: 1.45; }
.dgn-leadform { display: flex; flex-direction: column; gap: 12px; }
.dgn-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .dgn-field-row { grid-template-columns: 1fr; } }
.dgn-field { display: flex; flex-direction: column; gap: 4px; }
.dgn-field label { font-size: 0.85rem; font-weight: 600; color: #243b53; }
.dgn-field input { padding: 9px 11px; font-size: 0.95rem; border: 1px solid #cbd2d9; border-radius: 6px; background: #fff; color: #102a43; transition: border-color 0.15s, box-shadow 0.15s; font-family: inherit; }
.dgn-field input:focus { outline: none; border-color: #2d72d9; box-shadow: 0 0 0 3px rgba(45,114,217,0.15); }
.dgn-field-err { display: block; min-height: 16px; font-size: 0.8rem; color: #b91c1c; font-weight: 500; line-height: 1.3; }
.dgn-field-invalid input, .dgn-field-invalid .dgn-checkbox { border-color: #dc2626 !important; }
.dgn-checkbox-row { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.dgn-checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 0.85rem; line-height: 1.4; color: #334e68; cursor: pointer; }
.dgn-checkbox input { margin-top: 2px; flex-shrink: 0; cursor: pointer; }
.dgn-checkbox a { color: #2d72d9; text-decoration: underline; }
.dgn-leadform-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.dgn-leadform-actions button { flex: 1; min-width: 140px; }
.dgn-leadform-actions button:disabled { opacity: 0.6; cursor: not-allowed; }
.dgn-leadform-mailto { margin: 12px 0 0; font-size: 0.82rem; color: #627d98; text-align: center; }
.dgn-leadform-mailto a { color: #2d72d9; text-decoration: none; font-weight: 500; }
.dgn-leadform-status { margin: 10px 0 0; font-size: 0.88rem; min-height: 1.2em; }
.dgn-leadform-status-err { padding: 8px 12px; background: #fff5f5; border: 1px solid #fecaca; border-radius: 6px; color: #991b1b; }
.dgn-leadform-status-err a { color: #7f1d1d; font-weight: 600; }
.dgn-leadform-success { text-align: center; padding: 20px 12px; }
.dgn-leadform-success-icon { width: 56px; height: 56px; margin: 0 auto 12px; background: #10b981; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 700; }
.dgn-leadform-success h3 { margin: 0 0 10px; font-size: 1.2rem; color: #064e3b; }
.dgn-leadform-success p { margin: 0 0 16px; font-size: 0.92rem; color: #334e68; line-height: 1.5; }
.dgn-leadform-success a { color: #2d72d9; font-weight: 500; }

/* === Help CTA in alto a destra del modal === */
.dgn-help-cta {
  position: absolute; top: 14px; right: 60px;
  font-size: 0.86rem; color: #486581;
  background: rgba(255,255,255,0.9); padding: 6px 12px; border-radius: 20px;
  border: 1px solid #e1e7ef; line-height: 1.2;
  z-index: 10; max-width: calc(100% - 100px);
}
.dgn-help-cta .dgn-help-phone { color: #102a43; font-weight: 700; }
.dgn-help-cta a { color: #2d72d9; text-decoration: none; }
.dgn-help-cta a:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .dgn-help-cta { right: 50px; top: 10px; font-size: 0.78rem; padding: 4px 9px; }
  .dgn-help-cta .dgn-help-label { display: none; }
  .dgn-help-cta .dgn-help-phone:before { content: "\260E "; }
}

/* === Ricerca globale nel diagnostico === */
.dgn-opts-global .dgn-opt-global { border-left: 3px solid #2d72d9; }
.dgn-opt-global-context { color: #627d98; font-style: italic; font-size: 0.82rem; }
.dgn-search-empty { color: #627d98; font-size: 0.88rem; margin: 8px 0 0; }

/* CTA commerciale negli outcome */
.dgn-cta-box {
  margin-top: 18px;
  padding: 14px 16px;
  background: #eef5ff;
  border-left: 4px solid #204E9A;
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #1e3a5f;
}
.dgn-cta-box strong { color: #163a75; }
