/* ==========================================================================
   nis2.css - styles for nis2.html only (NIS2 self-assessment).
   Shared tokens/header/footer are in site.css. No new brand colours: navy,
   steel blue and neutrals from site.css; the three status colours (red,
   amber, green) are used only for readiness levels and priorities.
   ========================================================================== */

.n2-app {
  --n2-red: #a3221a;   --n2-red-bg: #fbeceb;
  --n2-amber: #7a4f00; --n2-amber-bg: #fdf3dc;
  --n2-green: #1f6b45; --n2-green-bg: #e7f4ec;
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
}

/* ── Title band (like the hub page) ───────────────────────────────────── */
.n2-hero { background: var(--navy-dark); padding: 8rem 2rem 3.5rem; }
.n2-hero h1,
.n2-hero p,
.n2-lang-notice { max-width: 760px; margin-left: auto; margin-right: auto; }
.n2-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--white);
}
.n2-hero p { margin-top: 1rem; font-size: 1.02rem; line-height: 1.7; color: var(--light-blue); }
.n2-hero .n2-hero-note { margin-top: .6rem; font-size: .88rem; color: rgba(255, 255, 255, .6); }  /* "self-assessment, not legal advice" line */
.n2-lang-notice {
  margin-top: 1rem;
  padding: .6rem 1.25rem;
  background: rgba(111, 146, 188, .15);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  color: rgba(255, 255, 255, .75);
  font-size: .82rem;
}

/* ── Progress ─────────────────────────────────────────────────────────── */
.n2-stepper { list-style: none; display: flex; gap: .5rem; margin-bottom: 2.25rem; }
.n2-stepper li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-top: .6rem;
  border-top: 3px solid var(--line);
  font-size: .8rem;
  color: var(--slate);
}
.n2-stepper li.done { border-top-color: var(--accent); }
.n2-stepper li.current { border-top-color: var(--navy); color: var(--navy-dark); font-weight: 600; }
.n2-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.5rem; height: 1.5rem;
  border-radius: 50%;
  background: var(--off-white);
  border: 1px solid var(--line);
  font-size: .72rem;
}
.n2-stepper li.current .n2-step-num { background: var(--navy); border-color: var(--navy); color: var(--white); }
.n2-stepper li.done .n2-step-num { background: var(--accent); border-color: var(--accent); color: var(--white); }

/* ── Pages and questions ──────────────────────────────────────────────── */
.n2-page-head { margin-bottom: 1.75rem; }
.n2-page-head h2,
.n2-r-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--navy-dark);
}
.n2-page-head p { margin-top: .5rem; max-width: 720px; font-size: .98rem; line-height: 1.7; color: var(--text-body); }

.n2-section { margin-bottom: 2rem; }
.n2-section h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--accent);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--navy-dark);
}
.n2-art { font-family: var(--font-sans); font-size: .78rem; font-weight: 500; color: var(--slate); white-space: nowrap; }

.n2-q {
  border: 0;
  margin: 0 0 1.4rem;
  padding: 0;
  min-width: 0;
}
.n2-q-text { display: block; margin-bottom: .55rem; font-size: .98rem; font-weight: 500; line-height: 1.5; color: var(--navy-dark); }
.n2-q-help { margin: -.3rem 0 .5rem; font-size: .82rem; color: var(--slate); }
.n2-q { position: relative; }
.n2-q-head { display: flex; align-items: baseline; }
.n2-q-head .n2-q-text { display: inline; }

/* "i" button and its "Why we ask" tip: opens above the question line on hover (CSS :hover and the JS class
   .is-hover, so every browser behaves the same), focus or tap; below the line (.is-below, set by nis2.js)
   when the space above is hidden by the fixed menu */
.n2-q legend, .n2-q-head { position: relative; }
.n2-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem; height: 1.15rem;
  margin-left: .45rem;
  padding: 0;
  vertical-align: .05em;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: var(--white);
  color: var(--accent-ink);
  font: italic 700 .7rem/1 var(--font-serif);
  cursor: help;
}
.n2-info:hover, .n2-info.is-hover, .n2-info[aria-expanded="true"] { background: var(--accent); color: var(--white); }
.n2-info:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.n2-tip {
  display: none;
  position: absolute;
  left: 0;
  bottom: 100%;
  z-index: 20;
  width: max-content;
  max-width: min(420px, calc(100vw - 2.5rem));
  margin-bottom: .3rem;
  padding: .7rem .9rem;
  background: var(--navy-dark);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(7, 26, 56, .18);
  font-size: .8rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--light-blue);
  text-align: left;
}
.n2-tip strong { display: block; margin-bottom: .2rem; font-weight: 600; color: var(--white); }
.n2-info:hover + .n2-tip,
.n2-info.is-hover + .n2-tip,
.n2-info:focus-visible + .n2-tip,
.n2-info[aria-expanded="true"] + .n2-tip { display: block; }
.n2-tip.is-below { bottom: auto; top: 100%; margin: .3rem 0 0; }
.n2-q.n2-missing .n2-q-text { color: var(--n2-red); }
.n2-q.n2-missing .n2-choices,
.n2-q.n2-missing .n2-seg,
.n2-q.n2-missing .n2-select { outline: 2px solid var(--n2-red); outline-offset: 4px; border-radius: 6px; }

/* Options: real radio/checkbox inputs, label styled as a button */
.n2-choices { display: flex; flex-direction: column; gap: .45rem; }
.n2-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.n2-seg { display: flex; flex-wrap: wrap; gap: .45rem; }
.n2-opt { position: relative; display: block; cursor: pointer; }
.n2-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.n2-opt span {
  display: block;
  padding: .6rem .9rem;
  background: var(--white);
  border: 1px solid #cfdae7;
  border-radius: 6px;
  font-size: .9rem;
  line-height: 1.4;
  color: var(--text-body);
  transition: background var(--transition), border-color var(--transition);
}
.n2-seg .n2-opt span { min-width: 6.5rem; text-align: center; }
.n2-grid .n2-opt span { padding: .5rem .65rem .5rem 1.95rem; font-size: .85rem; }
.n2-grid .n2-opt-check span::before { left: .6rem; }
.n2-opt:hover span { border-color: var(--accent); }
.n2-opt input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--white); }
.n2-opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.n2-opt-check span { padding-left: 2.1rem; }
.n2-opt-check span::before {
  content: '';
  position: absolute;
  left: .75rem; top: 50%;
  width: .85rem; height: .85rem;
  transform: translateY(-50%);
  border: 1.5px solid #9fb2c8;
  border-radius: 3px;
  background: var(--white);
}
.n2-opt-check input:checked + span::before {
  border-color: var(--white);
  background: var(--white);
  box-shadow: inset 0 0 0 3px var(--navy);
}

.n2-select,
.n2-input {
  width: 100%;
  max-width: 480px;
  padding: .65rem .8rem;
  font: inherit;
  font-size: .92rem;
  color: var(--text-body);
  background: var(--off-white);
  border: 1px solid #cfdae7;
  border-radius: 6px;
}
.n2-select:focus,
.n2-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.n2-note {
  margin: .6rem 0 1rem;
  padding: .7rem 1rem;
  background: var(--off-white);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-size: .88rem;
  line-height: 1.6;
  color: var(--text-body);
}
.n2-note-q { margin-top: -.8rem; }

/* Page 1: "Your data stays with you" notice */
.n2-privacy {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  margin: -.5rem 0 2rem;
  padding: 1rem 1.2rem;
  background: var(--off-white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: 0 8px 8px 0;
}
.n2-privacy-icon {
  flex: 0 0 auto;
  width: 1.5rem; height: 1.5rem;
  margin-top: .1rem;
  fill: none;
  stroke: var(--navy);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.n2-privacy strong { display: block; margin-bottom: .2rem; font-size: .95rem; color: var(--navy-dark); }
.n2-privacy p { font-size: .9rem; line-height: 1.6; color: var(--text-body); }

/* Page 2: country cards and preliminary result */
.n2-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .75rem;
  margin-bottom: 1.5rem;
  padding: .9rem 1.2rem;
  background: var(--off-white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: 0 8px 8px 0;
}
.n2-preview-label { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.n2-preview strong { color: var(--navy-dark); }
.n2-country {
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.4rem .4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.n2-country h3 { font-family: var(--font-serif); font-size: 1.15rem; color: var(--navy-dark); margin-bottom: .6rem; }
.n2-country dl { display: grid; grid-template-columns: 8rem 1fr; gap: .3rem 1rem; margin-bottom: 1rem; font-size: .88rem; }
.n2-country dt { color: var(--slate); }
.n2-country dd { color: var(--text-body); }

/* ── Buttons and navigation ───────────────────────────────────────────── */
.n2-nav { display: flex; align-items: center; gap: 1rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.n2-nav #n2-next { margin-left: auto; }
.n2-error { flex: 1; font-size: .88rem; color: var(--n2-red); }
.n2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .7rem 1.6rem;
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  color: var(--white);
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition);
}
.n2-btn:hover { background: var(--navy-dark); }
.n2-btn:disabled { opacity: .6; cursor: default; }
.n2-btn-ghost { color: var(--navy); background: var(--white); border-color: #cfdae7; }
.n2-btn-ghost:hover { background: var(--off-white); }

/* ── Report ───────────────────────────────────────────────────────────── */
/* The result view is wider so the plan tables fit; long text keeps max-width 760px (rule 12). */
.n2-app.is-result { max-width: 1120px; }
.n2-report { max-width: 100%; }
.n2-r-head { margin-bottom: 2rem; }
.n2-r-title { font-size: 2.1rem; }
.n2-r-meta { margin-top: .35rem; font-size: .9rem; color: var(--slate); }
.n2-r-mode { margin-top: .2rem; font-size: .84rem; color: var(--slate); }
.n2-r-mode.is-amended { display: inline-block; margin-top: .5rem; padding: .25rem .6rem; background: var(--n2-amber-bg); color: var(--n2-amber); border-radius: 4px; font-weight: 500; }
.n2-compare { display: block; margin-top: .2rem; font-size: .8rem; color: var(--slate); }
.n2-source-title { display: block; color: var(--navy-dark); }
.n2-r-sec { margin-bottom: 2.75rem; }
.n2-r-sec h3 {
  display: inline-block;
  margin-bottom: 1rem;
  padding-bottom: .45rem;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy-dark);
  border-bottom: 2px solid var(--accent);
}
.n2-r-sec h4 { margin: 1.75rem 0 .7rem; font-size: 1.02rem; font-weight: 600; color: var(--navy-dark); }
.n2-r-sec p { max-width: 760px; font-size: .95rem; line-height: 1.7; color: var(--text-body); }
.n2-r-score { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 700; line-height: 1.3; }
.n2-r-pct { font-size: 2.6rem; }
.n2-r-score.n2-red { color: var(--n2-red); }
.n2-r-score.n2-amber { color: var(--n2-amber); }
.n2-r-score.n2-green { color: var(--n2-green); }
.n2-r-lead { margin-top: 1rem; }
.n2-small { margin-top: .6rem; font-size: .84rem !important; color: var(--slate) !important; }

.n2-bar { position: relative; height: 12px; margin-top: 1rem; max-width: 760px; background: var(--off-white); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.n2-bar-fill { height: 100%; }
.n2-bar-fill.n2-red { background: var(--n2-red); }
.n2-bar-fill.n2-amber { background: #c08a1b; }
.n2-bar-fill.n2-green { background: var(--n2-green); }
/* Ticks under the bar, positioned at the level boundaries 0 / 40 / 70 / 90 */
.n2-bar-ticks { display: grid; grid-template-columns: 40fr 30fr 20fr 10fr; max-width: 760px; margin-top: .35rem; font-size: .72rem; color: var(--slate); }
.n2-bar-ticks span { padding-left: .3rem; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.n2-notes { margin: 1rem 0 0 1.1rem; max-width: 760px; }
.n2-notes li { margin-bottom: .35rem; font-size: .9rem; line-height: 1.6; color: var(--text-body); }

/* Tables: wide content scrolls inside its own box on small screens */
.n2-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 8px; }
.n2-table { width: 100%; border-collapse: collapse; font-size: .86rem; line-height: 1.5; }
.n2-table th {
  padding: .6rem .75rem;
  background: var(--off-white);
  border-bottom: 1px solid var(--line);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-align: left;
  text-transform: uppercase;
  color: var(--accent-ink);
  white-space: nowrap;
}
.n2-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text-body); }
.n2-table tr:last-child td { border-bottom: 0; }
.n2-table strong { color: var(--navy-dark); font-weight: 600; }
.n2-plan td:first-child, .n2-overview td:first-child { font-weight: 600; color: var(--navy-dark); white-space: nowrap; }
.n2-plan td:nth-child(2) { min-width: 16rem; }
.n2-plan td:nth-child(5) { min-width: 9rem; }
.n2-overview td:nth-child(2) { white-space: nowrap; }
.n2-areas td:nth-child(3), .n2-areas td:nth-child(5) { text-align: right; font-variant-numeric: tabular-nums; }

.n2-pill { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.n2-pill.n2-red { background: var(--n2-red-bg); color: var(--n2-red); }
.n2-pill.n2-amber { background: var(--n2-amber-bg); color: var(--n2-amber); }
.n2-pill.n2-green { background: var(--n2-green-bg); color: var(--n2-green); }
.n2-prio-critical { font-weight: 600; color: var(--n2-red); }
.n2-prio-high { font-weight: 600; color: var(--navy); }
.n2-prio-normal { color: var(--slate); }

.n2-prio { margin-top: 1.25rem; padding: 1rem 1.25rem; background: var(--off-white); border-radius: 8px; max-width: 760px; }
.n2-prio-title { font-weight: 600; color: var(--navy-dark) !important; margin-bottom: .3rem; }
.n2-prio ul { list-style: none; }
.n2-prio li { font-size: .9rem; line-height: 1.7; }
.n2-prio strong { color: var(--navy-dark); }
.n2-step-head { margin-top: 2.25rem !important; }

/* Page 1 references line and report "References" list */
.n2-basis { margin: -1.25rem 0 2rem; font-size: .84rem; color: var(--slate); }
.n2-basis a { color: var(--navy); }
.n2-sources { margin-top: 2.25rem; max-width: 760px; }
.n2-sources h4 { margin: 0 0 .3rem; font-size: 1.02rem; font-weight: 600; color: var(--navy-dark); }
.n2-source-list { list-style: none; margin-top: .75rem; }
.n2-source-list li { padding: .6rem 0; border-top: 1px solid var(--line); font-size: .88rem; line-height: 1.55; }
.n2-source-list a { font-weight: 600; color: var(--navy); }
.n2-source-use { display: block; color: var(--text-body); }
.n2-source-url { display: none; }   /* shown in print, where links cannot be clicked */
.n2-disclaimer { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: .84rem !important; font-style: italic; color: var(--slate) !important; }
.n2-disclaimer a { color: var(--navy); }
/* Tool version + last update, bottom of every page and of the PDF */
.n2-version { margin: 2.5rem 0 0; font-size: .75rem; color: var(--slate); text-align: right; }
.n2-version-url { display: none; }
.n2-version a { color: inherit; text-decoration: none; }

.n2-actions-bar { display: flex; flex-wrap: wrap; gap: .75rem; margin: 2rem 0 3rem; }

/* Help block (link to the normal contact form; the tool collects no data) */
.n2-contact { padding: 1.75rem 2rem; background: var(--off-white); border: 1px solid var(--line); border-radius: 8px; }
.n2-contact h2 { font-family: var(--font-serif); font-size: 1.35rem; color: var(--navy-dark); margin-bottom: .5rem; }
.n2-contact p { max-width: 640px; font-size: .92rem; line-height: 1.6; margin-bottom: 1.25rem; }
.n2-contact .n2-btn { text-decoration: none; }

/* Static "About this NIS2 self-assessment" section below the wizard (text for visitors and search engines) */
.n2-about { max-width: 820px; margin: 0 auto; padding: 2.5rem 2rem 4.5rem; border-top: 1px solid var(--line); }
.n2-about > * { max-width: 760px; }
.n2-about h2 { font-family: var(--font-serif); font-size: 1.45rem; color: var(--navy-dark); margin-bottom: .75rem; }
.n2-about h3 { font-size: 1.02rem; font-weight: 600; color: var(--navy-dark); margin: 1.6rem 0 .45rem; }
.n2-about p, .n2-about li { font-size: .95rem; line-height: 1.7; color: var(--text-body); }
.n2-about ul { margin: 0; padding-left: 1.2rem; }
.n2-about li + li { margin-top: .35rem; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .n2-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .n2-hero { padding: 6.5rem 1.25rem 2.5rem; }
  .n2-app { padding: 1.75rem 1.25rem 4rem; }
  .n2-about { padding: 2rem 1.25rem 3.5rem; }
  .n2-stepper { gap: .3rem; }
  .n2-step-label { display: none; }
  .n2-stepper li.current .n2-step-label { display: inline; }
  .n2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .n2-seg .n2-opt { flex: 1 1 40%; }
  .n2-seg .n2-opt span { min-width: 0; }
  .n2-country dl { grid-template-columns: 1fr; gap: 0; }
  .n2-country dd { margin-bottom: .4rem; }
  .n2-contact { padding: 1.4rem 1.25rem; }
  .n2-r-pct { font-size: 2.2rem; }
  /* Tables: each row becomes a small card, the column name in front of each value */
  .n2-table-wrap { border: 0; overflow: visible; }
  .n2-table thead { display: none; }
  .n2-table, .n2-table tbody, .n2-table tr, .n2-table td { display: block; width: 100%; }
  .n2-table tr { margin-bottom: .75rem; border: 1px solid var(--line); border-radius: 8px; padding: .35rem 0; }
  .n2-table td {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: .75rem;
    padding: .3rem .85rem;
    border: 0;
    text-align: left !important;
    min-width: 0 !important;
    white-space: normal !important;
  }
  .n2-table td::before {
    content: attr(data-label);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--accent-ink);
    padding-top: .15rem;
  }
  .n2-table td > * { justify-self: start; }
  .n2-bar-ticks { font-size: .62rem; }
}

/* "Powered by" + RYG logo: printed report only */
.n2-print-brand { display: none; }

/* ── Print / PDF: only the report ─────────────────────────────────────── */
@media print {
  /* Same line as "Your result": title left, "Powered by" + logo right */
  .n2-r-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; }
  .n2-print-brand:not([hidden]) {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex: 0 0 auto;
    margin-top: .35rem;
  }
  .n2-print-brand span { font-size: 9pt; color: var(--slate); }
  .n2-print-brand img { display: block; width: 150px; height: 41px; object-fit: cover; object-position: center; }
  @page { margin: 14mm 12mm; }
  .site-nav, .mobile-menu, .site-footer, .n2-hero, .n2-stepper, .n2-page, .n2-nav,
  .n2-actions-bar, .n2-contact, .n2-about { display: none !important; }
  body { background: #fff; }
  .n2-app { max-width: none; padding: 0; }
  .n2-table-wrap { overflow: visible; border: 0; }
  .n2-table { font-size: 8.5pt; width: 100%; }
  .n2-table th, .n2-table td { min-width: 0 !important; white-space: normal !important; padding: .4rem .5rem; }
  .n2-table th { letter-spacing: 0; }
  .n2-table th { background: #eef2f7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .n2-pill, .n2-bar-fill, .n2-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .n2-table tr { break-inside: avoid; }
  .n2-r-sec h3, .n2-r-sec h4 { break-after: avoid; }
  .n2-r-sec p { max-width: none; }
  .n2-source-url { display: block; font-size: 8pt; color: var(--slate); word-break: break-all; }
  .n2-sources { break-inside: avoid; }
  .n2-version-url { display: inline; }
}

/* Phones: "i" tips also fit when the question is indented (country boxes on page 2) */
@media (max-width: 600px) {
  .n2-tip { max-width: calc(100vw - 4.5rem); }
}
