:root {
  --accent: #3fc7c3;
  --text: #003366;
  --bg: #ffffff;
  --card-bg: #fff;
  --warn: #f4a261;
  --good: #2a9d8f;
  --high: #e76f51;
  --radius: 8px;
  --spacing: 24px;
  --btn-vert: 14px;
  --btn-horiz: 26px;
  --border-light: #ddd;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--bg);
}

#fsb-embed {
  max-width: 960px;
  margin: var(--spacing) auto;
  padding: var(--spacing);
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.1em 1em;
  margin-bottom: 1em;
}

/* TIP BOX */
.tip-box {
  background: #e7f9fa;
  border-left: 5px solid var(--accent);
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: var(--spacing);
  color: #04505c;
  line-height: 1.5;
  font-size: 0.8em;
}
.tip-box p { margin: 0 0 0.75em; }

/* HEADINGS */
h1 {
  margin: 0 0 var(--spacing);
  font-size: 2rem;
  text-align: left;
}

h2.section-title {
  font-size: 1.75rem;
  margin-bottom: var(--spacing);
  border-bottom: 3px solid var(--accent);
  padding-bottom: 8px;
}

/* BUTTONS */
.fsb-btn-primary {
  display: inline-block;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  margin: 1em 0 2em 0;
  text-align: left;
}
.fsb-btn-primary:hover {
  transform: translateY(-2px);
}
.big-btn {
  font-size: 1.1rem !important;
  padding: 12px 28px !important;
  border-radius: 8px !important;
  margin-top: 0.5em !important;
  margin-bottom: 1em !important;
}

/* LEGAL DISCLAIMER DIVIDER */
.legal-divider {
  border-top: 1px solid var(--border-light);
  margin: 3em 0 1em;
  width: 100%;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* INPUTS */
input[type='email'], input, select, textarea {
  width: 100%;
  padding: 0.7em 0.9em;
  font-size: 1rem;
  background: #f0f0f0;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  margin-bottom: var(--spacing);
}

input::placeholder, textarea::placeholder {
  color: #03304a !important;
  font-family: 'Montserrat', Arial, sans-serif !important;
  opacity: 0.7;
}

.error-msg {
  font-size: 0.7rem;
  color: red;
  display: none;
  margin-bottom: calc(var(--spacing)/2);
}

/* PROGRESS BAR */
.progress-bar {
  background: #e0e0e0;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--spacing);
}
.progress {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width .3s ease;
}

/* QUESTION PROGRESS */
.question-progress {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 4px 16px;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--spacing);
  letter-spacing: 0.3px;
}

.question-text {
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.question-explanation {
  margin-bottom: var(--spacing);
  color: #333;
  font-size: 0.9rem;
  line-height: 1.4;
}

.response-buttons {
  margin-bottom: var(--spacing);
  text-align: left;
  display: flex;
  gap: 1em;
}
.response-buttons button {
  margin-right: 12px;
}

/* DECK (TWO COLUMN LAYOUT) */
.deck {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing);
}
@media (max-width: 900px) {
  .deck {
    grid-template-columns: 1fr;
  }
}
.card.wide {
  grid-column: 1 / -1;
}

/* CHART (not used for SVG ring, but for other chart.js) */
.chart-container {
  height: 140px;
  margin-bottom: var(--spacing);
}
canvas {
  width: 100% !important;
  height: 100% !important;
}

/* LISTS */
.fsb-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.fsb-list li {
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  font-size: 0.97em;
}
.fsb-list li:last-child {
  border-bottom: none;
}

/* BREACH FORMAT */
.breach-severity {
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 12px;
}
.High .breach-severity {
  background: var(--high);
  color: #fff;
}
.Medium .breach-severity {
  background: var(--warn);
  color: #fff;
}
.Low .breach-severity {
  background: var(--good);
  color: #fff;
}
.breach-name {
  margin-right: auto;
  margin-left: 8px;
  font-size: 0.8rem;
}
.breach-date {
  margin-left: auto;
  font-size: 0.8rem;
  color: #555;
}

/* RISK BADGE */
.risk-badge {
  display: inline-block;
  font-size: 1.24rem;
  font-weight: 700;
  padding: 0.72em 2em 0.72em 2em;
  border-radius: 11px;
  margin-left: 0.5em;
  margin-top: 0;
  min-width: 122px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(231,111,81,0.07);
  align-self: center;
  background: #ccc;
  color: #fff;
  vertical-align: middle;
  letter-spacing: 0.7px;
}
.risk-high   { background: var(--high); }
.risk-medium { background: var(--warn); }
.risk-low    { background: var(--good); }

/* SCORE META/SUMMARY */
.score-meta {
  margin: 1em 0 0.4em 0;
  font-size: 1.02rem;
  color: #166777;
  font-weight: 500;
}
.score-summary {
  margin: 1em 0 0.5em 0;
  font-size: 1.13rem;
  color: #233b3b;
}
.score-footnote {
  font-size: 0.97rem;
  margin-top: 0.7em;
  color: #445b5b;
}

/* REPORT BADGE */
.report-badge {
  display: inline-block;
  padding: 7px 28px 7px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 24px;
  font-size: 1.13rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: -28px;
  margin-top: 0;
  box-shadow: 0 2px 8px rgba(52,199,195,0.09);
  position: relative;
  z-index: 2;
}

/* SCORE RING SVG (Desktop) */
.score-flex {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.4em;
  margin: 2em 0 1.1em 0;
}
.score-ring-svg {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.score-ring-svg svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 110px;
  height: 110px;
}
.score-center {
  position: absolute;
  width: 110px;
  height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  top: 0;
  left: 0;
  pointer-events: none;
}
.big-score {
  font-size: 2.1rem;
  font-weight: 800;
  color: #03304a;
  line-height: 1;
}
.score-outof {
  font-size: 1.05rem;
  color: #a3b8c3;
  font-weight: 600;
  margin-top: 2px;
}
.score-ring-bg {
  stroke: #e3f8f7;
}
.score-ring-fg {
  stroke: var(--accent);
  transition: stroke-dashoffset 1s cubic-bezier(0.23, 1, 0.32, 1);
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

/* IMPROVED TIP BOX (for strengths/weaknesses) */
.improved-tip {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #eafcff;
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(60, 199, 195, 0.08);
  padding: 16px 18px;
  margin-bottom: var(--spacing);
  font-size: 0.87rem;
  min-width: 0;
  width: 100%;
}
.improved-tip.strength {
  background: #e9fbe9;
  border-left: 5px solid var(--good);
}
.tip-icon {
  font-size: 1.1rem;
  margin-right: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}
.tip-main {
  color: #04505c;
  font-size: 0.85rem;
}
.tip-desc {
  font-size: 0.96rem;
  color: #206677;
  margin-top: 3px;
  word-break: break-word;
}

/* STRENGTHS/WEAKNESSES FONT SIZES */
#strength-list li,
#weakness-list li {
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 0.24em 0;
}
#strengths-card h3,
#weaknesses-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.45em;
}

/* STEPS */
.step-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1em;
}
.step-list {
  list-style: none;
  margin: 0 0 0.4em 0;
  padding: 0;
}
.step-list li {
  margin-bottom: 0.7em;
  font-size: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 7px;
}
.step-icon {
  font-size: 1.28rem;
  vertical-align: middle;
  margin-right: 6px;
  color: var(--accent);
}

/* PRIVACY HIGHLIGHT */
.privacy-highlight {
  margin: 1em 0 0 0;
  background: #f7fbfa;
  color: #187372;
  padding: 7px 12px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  display: inline-block;
}

/* CONSENT + CAPTCHA */
label[for="consentCheckbox"] {
  font-size: 0.9rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 1em 0 1.5em;
  cursor: pointer;
}
#consentCheckbox {
  transform: scale(1.2);
  accent-color: var(--accent);
  vertical-align: middle;
  margin: 0;
}
label[for="consentCheckbox"] a {
  color: var(--accent);
  text-decoration: underline;
  transition: color 0.2s ease;
}
label[for="consentCheckbox"] a:hover,
label[for="consentCheckbox"] a:focus {
  color: #03304a;
  outline: none;
}
.captcha-wrapper {
  display: flex;
  justify-content: left;
  align-items: left;
  padding: 0;
  margin: -8px 0 24px;
}
.cf-turnstile {
  width: 100%;
  max-width: 300px;
}
.align-left {
  text-align: left !important;
}

/* SIDE-BY-SIDE CARDS FOR FUTURE FEATURES */
.side-by-side-container {
  display: flex;
  gap: var(--spacing);
  margin-top: var(--spacing);
  flex-wrap: wrap;
  justify-content: start;
}
.side-by-side-container > .card {
  flex: 1 1 48%;
  min-width: 280px;
  box-sizing: border-box;
  margin-bottom: var(--spacing);
}
.side-by-side-container > .card.wide {
  grid-column: auto !important;
  flex-basis: 45% !important;
}

/* ======= NCSC THREATS LIST ======= */
#ncsc-threats-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ncsc-threat-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4em 1em;
  padding: 1em 0;
  border-bottom: 1px solid #e0e8e7;
}
.ncsc-threat-title {
  font-weight: 700;
  font-size: 1.03em;
  color: #125;
  flex: 1 1 220px;
}
.ncsc-threat-date {
  font-size: 0.93em;
  color: #888;
  min-width: 88px;
  text-align: right;
  flex: 0 0 88px;
}
.ncsc-threat-summary {
  flex-basis: 100%;
  font-size: 0.97em;
  color: #166777;
  margin: 0.16em 0 0.28em 0;
}
.ncsc-threat-link {
  font-size: 0.97em;
  color: #23a1ae;
  text-decoration: underline;
  margin-left: auto;
  min-width: 80px;
}

.fsb-btn-primary:disabled,
.fsb-btn-primary[disabled] {
  opacity: 0.48;
  background: #b7dddb;
  cursor: not-allowed !important;
  pointer-events: none;
  box-shadow: none;
}

input[type="checkbox"]:disabled {
  filter: grayscale(1) brightness(1.2);
  opacity: 0.66;
  cursor: not-allowed !important;
  pointer-events: none;
}
label[for="consentCheckbox"]:has(input[disabled]) {
  opacity: 0.58;
}
.spinner {
  margin: 1.4em auto 0 auto;
  width: 48px;
  height: 48px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--accent);
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}
.loading-bar-wrap {
  width: 80%;
  max-width: 320px;
  height: 24px;
  margin: 1.6em 0 0 0;
  background: #e0e8e7;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, #46e0c3 100%);
  border-radius: 8px;
  transition: width .3s cubic-bezier(0.22,1,0.36,1);
}
@keyframes loadingBarAnim {
  0%   { width: 0%; }
  25%  { width: 23%; }
  45%  { width: 47%; }
  75%  { width: 82%; }
  90%  { width: 96%; }
  100% { width: 100%; }
}
.fsb-fade {
  opacity: 1;
  transition: opacity 0.42s cubic-bezier(.4,.2,.2,1);
  will-change: opacity;
}
.fsb-fade-hide {
  opacity: 0;
  pointer-events: none;
}

/* ---- FONTS & COLOR OVERRIDES FOR PICO ---- */
html, body, #fsb-embed {
  font-family: 'Montserrat', Arial, sans-serif !important;
  color: #03304a !important;
}

h1, h2, h3, h4, h5, h6,
.fsb-btn-primary, button, .big-btn, input[type="submit"] {
  font-family: 'Open Sans Condensed', Arial, sans-serif !important;
  color: #03304a !important;
}

input, select, textarea, label {
  font-family: 'Montserrat', Arial, sans-serif !important;
  color: #03304a !important;
}

ul, ol, li {
  font-family: 'Montserrat', Arial, sans-serif !important;
  color: #03304a !important;
}

/* Remove universal color so checkbox tick is always visible */
* {
  font-family: inherit !important;
}

/* Buttons: ensure white text */
.fsb-btn-primary, button.fsb-btn-primary, .big-btn {
  color: #fff !important;
}

/* Override Pico input borders for valid/invalid states */
input:focus,
input:active {
  outline: 2px solid var(--accent);
  border-color: var(--accent) !important;
  box-shadow: none !important;
}

input:invalid {
  border-color: var(--high) !important;
  box-shadow: none !important;
}
input:valid {
  border-color: var(--good) !important;
  box-shadow: none !important;
}

input:invalid, input:valid {
  border-width: 2px !important;
}

/* Checkbox: only accent-color, NO border/background override! */
input[type="checkbox"]:not([disabled]) {
  accent-color: #3fc7c3 !important;
  width: 1.2em !important;
  height: 1.2em !important;
}
input[type="checkbox"].custom-checkbox {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 4px;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  vertical-align: middle;
  position: relative;
  cursor: pointer;
  transition: border 0.2s, box-shadow 0.2s;
  margin-right: 0.6em;
}
input[type="checkbox"].custom-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}
input[type="checkbox"].custom-checkbox:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input[type="checkbox"].custom-checkbox:checked::after {
  content: "";
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 7px;
  border: solid #fff;
  border-width: 0 0 3px 3px;
  transform: translate(-50%, -55%) rotate(-45deg);
  pointer-events: none;
  box-sizing: border-box;
}

/* Ensure main body text uses FSB blue (#003366) */
body,
p,
ul,
ol,
li,
h1, h2, h3, h4, h5, h6,
.section-title,
.question-text,
.question-explanation,
.score-meta,
.score-summary,
.score-footnote,
.tip-box,
.improved-tip,
.step-title,
.step-list li,
.fsb-list li,
.ncsc-threat-title,
.ncsc-threat-summary,
.ncsc-threat-date,
.ncsc-threat-link,
label[for="consentCheckbox"],
input[type='email'],
input[type='text'],
select,
textarea {
  color: #003366 !important;
}

/* Buttons and badges stay unaffected, ensure white text explicitly */
.fsb-btn-primary,
.big-btn,
.report-badge,
.risk-badge {
  color: #ffffff !important;
}

/* Retain accent colours for feedback items */
.risk-high { background: var(--high) !important; }
.risk-medium { background: var(--warn) !important; }
.risk-low { background: var(--good) !important; }

/* Links remain accent colour for clear interactivity */
a,
.ncsc-threat-link,
label[for="consentCheckbox"] a {
  color: var(--accent) !important;
}

details, summary {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
details::after, details::before, summary::after, summary::before {
  content: none !important;
  display: none !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}
.card {
  transform: none !important;
  will-change: auto !important;
}
