/*
 * VectorUSA Cyber Essentials Readiness Check
 * Theme-compatible component styles.
 *
 * The module intentionally inherits the site's body and heading fonts instead
 * of loading or forcing its own typography. Component sizing is normalized so
 * the theme's 24px root scale does not make the assessment oversized.
 */

.vec-cyber-checklist {
  --vec-primary: #d22027;
  --vec-dark: #070707;
  --vec-accent: #0b2d32;

  /* Mirrors the supplied VectorUSA theme defaults. */
  --vec-body-color: #494a52;
  --vec-link-color: #0270e0;
  --vec-control-color: #494a52;
  --vec-form-label-color: #33475b;
  --vec-form-input-color: #33475b;
  --vec-placeholder-color: #bfbfbf;
  --vec-page-accent: #f8fafc;

  --vec-surface: #ffffff;
  --vec-gray-100: #f1f2f3;
  --vec-gray-200: #d9dcdf;
  --vec-gray-500: #62686d;
  --vec-green: #4c863c;
  --vec-red: #c9232b;
  --vec-warning: #efb52f;
  --vec-focus: #0270e0;

  width: 100%;
  max-width: 100%;
  color: inherit;
  background: transparent;
  font-family: inherit;
  font-size: clamp(16px, 0.72rem, 18px);
  line-height: 1.55;
  container-type: inline-size;
  overflow-wrap: anywhere;
  text-rendering: optimizeLegibility;
}

.vec-cyber-checklist *,
.vec-cyber-checklist *::before,
.vec-cyber-checklist *::after {
  box-sizing: border-box;
}

.vec-cyber-checklist fieldset,
.vec-cyber-checklist legend,
.vec-cyber-checklist label,
.vec-cyber-checklist p,
.vec-cyber-checklist ul,
.vec-cyber-checklist ol {
  margin-top: 0;
}

.vec-cyber-checklist fieldset {
  min-inline-size: 0;
}

.vec-cyber-checklist button,
.vec-cyber-checklist input,
.vec-cyber-checklist textarea {
  font: inherit;
}

.vec-cyber-checklist button,
.vec-cyber-checklist a {
  -webkit-tap-highlight-color: transparent;
}

.vec-cyber-checklist__body {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 0 clamp(24px, 3vw, 36px);
}

.vec-assessment {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 24px);
  align-items: start;
  min-width: 0;
}

/* Compact desktop score rail. It belongs to the module, not the page hero. */
.vec-live-score {
  position: sticky;
  top: 20px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--vec-gray-200);
  border-top: 5px solid var(--vec-primary);
  background: var(--vec-surface);
}

.vec-live-score__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  align-items: end;
  padding: 13px 14px 11px;
  background: var(--vec-dark);
}

.vec-live-score__eyebrow {
  color: #ffffff;
  font-size: 0.74em;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
}

.vec-live-score__value {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  color: #c9cdd0;
  white-space: nowrap;
}

.vec-live-score__value strong {
  color: #ffffff;
  font-size: 2em;
  line-height: 0.9;
}

.vec-live-score__answered {
  grid-column: 1 / -1;
  justify-self: start;
  color: #c9cdd0;
  font-size: 0.72em;
  white-space: nowrap;
}

.vec-meter {
  height: 6px;
  margin: 12px 14px 8px;
  overflow: hidden;
  background: var(--vec-gray-200);
}

.vec-meter__fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--vec-primary);
  transition: width 0.25s ease;
}

.vec-score-ranges {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0 14px;
  border-top: 1px solid var(--vec-gray-200);
  border-bottom: 1px solid var(--vec-gray-200);
}

.vec-score-range {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 7px 2px;
  text-align: left;
  line-height: 1.2;
}

.vec-score-range + .vec-score-range {
  border-top: 1px solid var(--vec-gray-200);
  border-left: 0;
}

.vec-score-range strong {
  color: var(--vec-dark);
  font-size: 0.8em;
  white-space: nowrap;
}

.vec-score-range span {
  color: var(--vec-gray-500);
  font-size: 0.65em;
  font-weight: 800;
  text-align: right;
  text-transform: uppercase;
}

.vec-live-score__status {
  margin: 0;
  padding: 9px 14px 11px;
  color: var(--vec-body-color);
  font-size: 0.76em;
  font-weight: 700;
  text-align: left;
}

.vec-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.vec-assessment__items {
  display: grid;
  gap: 14px;
}

.vec-check-item {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--vec-gray-200);
  background: var(--vec-surface);
}

.vec-check-item__legend {
  float: left;
  width: 100%;
  min-width: 0;
  padding: 18px 18px 10px;
  display: flex;
  gap: 14px;
  color: inherit;
}

.vec-check-item__legend + * {
  clear: both;
}

.vec-check-item__index {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--vec-dark);
  font-size: 0.8em;
  font-weight: 800;
}

.vec-check-item__copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.vec-check-item__title {
  font-size: 1.08em;
  font-weight: 800;
  color: var(--vec-body-color);
}

.vec-check-item__description {
  color: var(--vec-body-color);
  font-size: 0.94em;
}

.vec-score-options {
  padding: 8px 18px 18px 70px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.vec-score-option {
  min-width: 0;
  position: relative;
  margin: 0;
  cursor: pointer;
}

.vec-score-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.vec-score-option > span {
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.vec-score-option__number {
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 2px solid var(--vec-gray-200);
  border-bottom: 0;
  background: var(--vec-page-accent);
  color: var(--vec-body-color);
  font-size: 1.15em;
  font-weight: 900;
}

.vec-score-option__label {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 7px 5px;
  border: 2px solid var(--vec-gray-200);
  border-top: 0;
  color: var(--vec-body-color);
  text-align: center;
  font-size: 0.76em;
  line-height: 1.2;
}

.vec-score-option:hover .vec-score-option__number,
.vec-score-option:hover .vec-score-option__label {
  border-color: #7f858a;
}

.vec-score-option input:focus-visible + .vec-score-option__number {
  outline: 3px solid color-mix(in srgb, var(--vec-focus) 30%, transparent);
  outline-offset: 2px;
  border-color: var(--vec-focus);
}

@supports not (color: color-mix(in srgb, #000 50%, #fff)) {
  .vec-score-option input:focus-visible + .vec-score-option__number {
    outline-color: rgba(2, 112, 224, 0.3);
  }
}

.vec-score-option input:checked + .vec-score-option__number,
.vec-score-option input:checked + .vec-score-option__number + .vec-score-option__label {
  color: #ffffff;
  border-color: var(--vec-dark);
  background: var(--vec-dark);
}

.vec-score-option--0 input:checked + .vec-score-option__number,
.vec-score-option--0 input:checked + .vec-score-option__number + .vec-score-option__label {
  border-color: var(--vec-red);
  background: var(--vec-red);
}

.vec-score-option--1 input:checked + .vec-score-option__number,
.vec-score-option--1 input:checked + .vec-score-option__number + .vec-score-option__label {
  color: #1b1b1b;
  border-color: var(--vec-warning);
  background: var(--vec-warning);
}

.vec-score-option--2 input:checked + .vec-score-option__number,
.vec-score-option--2 input:checked + .vec-score-option__number + .vec-score-option__label {
  color: #17200f;
  border-color: #9aca6c;
  background: #9aca6c;
}

.vec-score-option--3 input:checked + .vec-score-option__number,
.vec-score-option--3 input:checked + .vec-score-option__number + .vec-score-option__label {
  border-color: var(--vec-green);
  background: var(--vec-green);
}

.vec-check-item__details {
  padding: 0 18px 18px 70px;
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(240px, 1.3fr);
  gap: 12px;
}

.vec-field {
  min-width: 0;
  display: grid;
  gap: 6px;
  margin: 0;
}

.vec-field__label {
  color: var(--vec-form-label-color);
  font-size: 0.8em;
  font-weight: 800;
}

.vec-field__hint {
  color: var(--vec-gray-500);
  font-weight: 400;
}

.vec-field input,
.vec-field textarea {
  width: 100%;
  min-height: 44px;
  margin: 0;
  border: 1px solid #aeb3b7;
  border-radius: 0;
  padding: 10px 11px;
  color: var(--vec-form-input-color);
  background: var(--vec-surface);
  box-shadow: none;
}

.vec-field textarea {
  min-height: 76px;
  resize: vertical;
}

.vec-field input::placeholder,
.vec-field textarea::placeholder {
  color: var(--vec-placeholder-color);
  opacity: 1;
}

.vec-field input:focus,
.vec-field textarea:focus {
  outline: 3px solid rgba(2, 112, 224, 0.22);
  outline-offset: 1px;
  border-color: var(--vec-focus);
}

.vec-results {
  margin-top: 34px;
  border: 2px solid var(--vec-dark);
  background: var(--vec-surface);
}

.vec-results__header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 20px;
  color: #ffffff;
  background: var(--vec-dark);
}

.vec-results__header h3 {
  margin: 3px 0 0;
}

.vec-results__badge {
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  font-size: 0.8em;
  font-weight: 800;
  white-space: normal;
  text-align: center;
}

.vec-results__content {
  padding: 22px;
}

.vec-results__content > p:first-child {
  margin-top: 0;
}

.vec-priority-list {
  display: grid;
  gap: 9px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.vec-priority-list li {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 0;
  padding: 12px;
  background: var(--vec-page-accent);
}

.vec-priority-score {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #ffffff;
  background: var(--vec-red);
  font-weight: 900;
}

.vec-priority-list li[data-score="1"] .vec-priority-score {
  color: #1b1b1b;
  background: var(--vec-warning);
}

.vec-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.vec-plan-card {
  min-width: 0;
  border-top: 5px solid var(--vec-primary);
  padding: 15px;
  background: var(--vec-page-accent);
}

.vec-plan-card h4 {
  margin: 0 0 8px;
  color: inherit;
}

.vec-plan-card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.9em;
}

.vec-next-step {
  margin-top: 24px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #ffffff;
  background: var(--vec-primary);
}

.vec-next-step__copy {
  min-width: 0;
  max-width: 650px;
}

.vec-next-step__eyebrow,
.vec-next-step p,
.vec-next-step div {
  color: #ffffff;
}

.vec-next-step p {
  margin: 0;
}

.vec-button,
.vec-text-button,
.vec-privacy-link {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  box-shadow: none;
  text-transform: none;
  letter-spacing: normal;
}

.vec-button {
  display: inline-flex;
  width: auto;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 0;
  padding: 10px 16px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  line-height: 1.2;
}

.vec-button:focus-visible,
.vec-text-button:focus-visible,
.vec-privacy-link:focus-visible,
.vec-privacy-note a:focus-visible {
  outline: 3px solid rgba(2, 112, 224, 0.3);
  outline-offset: 3px;
}

.vec-button--primary {
  flex: 0 0 auto;
  color: var(--vec-dark);
  background: #ffffff;
  border-color: #ffffff;
}

.vec-button--primary:hover {
  color: #ffffff;
  background: var(--vec-dark);
  border-color: var(--vec-dark);
}

.vec-button--secondary {
  color: #ffffff;
  background: var(--vec-control-color);
  border-color: var(--vec-control-color);
}

.vec-button--secondary:hover {
  color: var(--vec-control-color);
  background: #ffffff;
  border-color: var(--vec-control-color);
}

.vec-text-button,
.vec-privacy-link {
  min-height: 44px;
  border: 0;
  padding: 8px 0;
  color: var(--vec-link-color);
  background: transparent;
  cursor: pointer;
  text-decoration: underline;
  line-height: 1.3;
}

.vec-text-button {
  justify-self: center;
}

.vec-privacy-note {
  margin-top: 20px;
  padding: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--vec-gray-200);
  background: var(--vec-page-accent);
  color: var(--vec-body-color);
  font-size: 0.86em;
}

.vec-privacy-note__icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--vec-accent);
  font-weight: 800;
}

.vec-privacy-note p {
  margin: 2px 0 0;
}

.vec-privacy-note__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
}

.vec-privacy-note a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--vec-link-color);
}

.vec-cyber-checklist[data-readiness="high"] .vec-live-score__status {
  color: var(--vec-red);
}

.vec-cyber-checklist[data-readiness="progress"] .vec-live-score__status {
  color: #8b5f00;
}

.vec-cyber-checklist[data-readiness="strong"] .vec-live-score__status {
  color: var(--vec-green);
}

.vec-cyber-checklist[data-readiness="high"] .vec-meter__fill {
  background: var(--vec-red);
}

.vec-cyber-checklist[data-readiness="progress"] .vec-meter__fill {
  background: var(--vec-warning);
}

.vec-cyber-checklist[data-readiness="strong"] .vec-meter__fill {
  background: var(--vec-green);
}

.vec-cyber-checklist[data-readiness="high"] .vec-score-range--high {
  background: rgba(201, 35, 43, 0.10);
}

.vec-cyber-checklist[data-readiness="progress"] .vec-score-range--progress {
  background: rgba(239, 181, 47, 0.18);
}

.vec-cyber-checklist[data-readiness="strong"] .vec-score-range--strong {
  background: rgba(76, 134, 60, 0.12);
}

.vec-cyber-checklist[data-readiness="high"] .vec-score-range--high strong,
.vec-cyber-checklist[data-readiness="high"] .vec-score-range--high span {
  color: var(--vec-red);
}

.vec-cyber-checklist[data-readiness="progress"] .vec-score-range--progress strong,
.vec-cyber-checklist[data-readiness="progress"] .vec-score-range--progress span {
  color: #8b5f00;
}

.vec-cyber-checklist[data-readiness="strong"] .vec-score-range--strong strong,
.vec-cyber-checklist[data-readiness="strong"] .vec-score-range--strong span {
  color: var(--vec-green);
}


@container (max-width: 860px) {
  .vec-assessment {
    grid-template-columns: 1fr;
  }

  .vec-live-score {
    position: static;
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.2fr);
    margin: 0;
  }

  .vec-live-score__top {
    grid-row: 1 / span 3;
  }

  .vec-meter {
    align-self: end;
    margin-top: 12px;
  }

  .vec-score-ranges {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .vec-score-range {
    display: grid;
    gap: 1px;
    justify-content: stretch;
    text-align: center;
  }

  .vec-score-range + .vec-score-range {
    border-top: 0;
    border-left: 1px solid var(--vec-gray-200);
  }

  .vec-score-range span {
    text-align: center;
  }
}

@container (max-width: 680px) {
  .vec-cyber-checklist__body {
    padding: 0 0 32px;
  }

  .vec-live-score {
    display: block;
  }

  .vec-live-score__top {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .vec-score-options {
    padding: 8px 16px 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vec-check-item__legend {
    padding: 16px 16px 8px;
  }

  .vec-check-item__details {
    padding: 0 16px 16px;
    grid-template-columns: 1fr;
  }

  .vec-plan-grid {
    grid-template-columns: 1fr;
  }

  .vec-next-step {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  .vec-next-step .vec-button {
    width: 100%;
  }

  .vec-results__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .vec-results__content {
    padding: 18px;
  }
}

@container (max-width: 420px) {
  .vec-score-ranges {
    grid-template-columns: 1fr;
  }

  .vec-score-range {
    display: flex;
    text-align: left;
  }

  .vec-score-range + .vec-score-range {
    border-top: 1px solid var(--vec-gray-200);
    border-left: 0;
  }

  .vec-score-range span {
    text-align: right;
  }

  .vec-check-item__legend {
    gap: 10px;
  }

  .vec-check-item__index {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .vec-score-option__label {
    font-size: 0.72em;
  }

  .vec-button {
    width: 100%;
  }
}

@container (max-width: 340px) {
  .vec-check-item__legend {
    padding-left: 12px;
    padding-right: 12px;
  }

  .vec-score-options {
    padding-left: 12px;
    padding-right: 12px;
    gap: 6px;
  }

  .vec-score-option__label {
    min-height: 44px;
    padding-left: 3px;
    padding-right: 3px;
    font-size: 0.69em;
  }

  .vec-results__content,
  .vec-next-step {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Fallback for browsers that do not support CSS container queries. */
@supports not (container-type: inline-size) {
  @media (max-width: 860px) {
    .vec-assessment {
      grid-template-columns: 1fr;
    }

    .vec-live-score {
      position: static;
      display: grid;
      grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.2fr);
    }

    .vec-live-score__top {
      grid-row: 1 / span 3;
    }

    .vec-score-ranges {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .vec-score-range {
      display: grid;
      text-align: center;
    }

    .vec-score-range + .vec-score-range {
      border-top: 0;
      border-left: 1px solid var(--vec-gray-200);
    }

    .vec-score-range span {
      text-align: center;
    }
  }

  @media (max-width: 680px) {
    .vec-live-score {
      display: block;
    }

    .vec-score-options {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      padding: 8px 16px 16px;
    }

    .vec-check-item__legend {
      padding: 16px 16px 8px;
    }

    .vec-check-item__details,
    .vec-plan-grid {
      grid-template-columns: 1fr;
    }

    .vec-check-item__details {
      padding: 0 16px 16px;
    }

    .vec-next-step,
    .vec-results__header {
      align-items: stretch;
      flex-direction: column;
    }

    .vec-next-step .vec-button {
      width: 100%;
    }
  }

  @media (max-width: 420px) {
    .vec-score-ranges {
      grid-template-columns: 1fr;
    }

    .vec-score-range {
      display: flex;
      text-align: left;
    }

    .vec-score-range + .vec-score-range {
      border-top: 1px solid var(--vec-gray-200);
      border-left: 0;
    }

    .vec-score-range span {
      text-align: right;
    }

    .vec-button {
      width: 100%;
    }
  }

  @media (max-width: 340px) {
    .vec-score-options {
      padding-left: 12px;
      padding-right: 12px;
      gap: 6px;
    }

    .vec-score-option__label {
      font-size: 0.69em;
    }
  }
}

@media print {
  .vec-cyber-checklist {
    font-size: 12pt;
  }

  .vec-cyber-checklist__body {
    max-width: none;
    padding: 12px 20px 20px;
    display: block;
  }

  .vec-next-step,
  .vec-privacy-note {
    display: none !important;
  }

  .vec-check-item {
    break-inside: avoid;
  }

  .vec-field input,
  .vec-field textarea {
    border-color: #555555;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vec-meter__fill,
  .vec-score-option > span {
    transition: none;
  }
}
