/* Light default (current palette) */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #f7f9fc;
  --border: #dce3ec;
  --text: #0b0d10;
  --muted: #5b6b7c;
  --accent: #2f7ae5;

  /* component tokens (optional) */
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
  --focus: 0 0 0 3px color-mix(in oklab, var(--accent), white 70%);
}
* { box-sizing: border-box }
html, body { margin:0; padding:0; background:var(--bg); color:var(--text); font-family: "Lato", sans-serif; }
.theme-toggle {
  display: inline-grid; grid-auto-flow: column; gap: .4rem;
  align-items: center; cursor: pointer; user-select: none;
  padding: .25rem .5rem; border-radius: 999px; background: var(--panel);
  border: 1px solid var(--border);
}
.home-content-row-content h1 {
	font-size:36px;
}
.theme-toggle input { display: none; }
.theme-toggle .sun, .theme-toggle .moon { opacity: .6; }
#theme-toggle:checked ~ .moon { opacity: 1; }
#theme-toggle:not(:checked) ~ .sun { opacity: 1; }

/* When checked, force dark variables via :has() */
html:has(#theme-toggle:checked) {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel:#12161c;
  --border:#243040;
  --text:#e7ecf2;
  --muted:#9aa7b4;
  --accent:#2f7ae5;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.35);
  --focus: 0 0 0 3px color-mix(in oklab, var(--accent), black 60%);
}
/* Optional manual hooks if you ever want to force a theme */
[data-theme="light"] { color-scheme: light; }
[data-theme="dark"]  { color-scheme: dark;  }

/* Base elements referencing tokens */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.nav a {
  color: var(--text);
}

/* Buttons/inputs follow theme */
.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .55rem .9rem;
  box-shadow: var(--shadow);
}
a.btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.55rem 3rem;
    box-shadow: var(--shadow);
    text-align: center;
    text-decoration: none;
}
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: transparent;
    border: none;
}
#scan-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-icon svg {
  fill: var(--text);
  width: 42px;
  height: 42px;
}

.btn-icon svg:hover {
  filter: brightness(2.05);
}  

.btn:hover { filter: brightness(1.05); }

textarea.mono,
input[type="url"],
input[type="number"] {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* Progress indicator */
.progress {
    width: 72px;
    height: 42px;
    border-radius: 100%;
    border: 4px solid color-mix(in oklab, var(--accent), white 30%);
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
    display: inline-block;
}    

.progress.hidden { display: none; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

.container { max-width:900px; margin:24px auto; padding:0 16px; display:flex; align-items: center; justify-content: center; }
.site-footer { max-width:900px; margin:24px auto; padding:0 16px }
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-footer-container {display: flex; align-items: center; gap: 20px; background: var(--panel); padding: 10px 16px; border-radius: 12px; }
.site-header h1 { margin:0 0 6px 0 }
.muted { color: var(--muted) }
.mt { margin-top: 16px }
.actions { display: flex; gap: 16px; }
form {
  display:flex; gap:8px; align-items:center; background:var(--panel);
  border:1px solid var(--border); padding:12px; border-radius:12px;
}
input[type=url] { flex:1; padding:10px 12px; border-radius:8px; border:1px solid var(--border); background:var(--panel); color:var(--text) }
button:not(.btn-icon, .faq-question, .nav-toggle) { padding:10px 14px; border-radius:10px; border:1px solid transparent; background:var(--accent); color:white; cursor:pointer }
button:hover { filter: brightness(1.1) }
.card {
  background:var(--panel); border:1px solid var(--border); border-radius:12px; padding:16px;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; width:100% }
.meta { display:grid; grid-template-columns: 1fr 1fr; gap:8px; margin-top:8px }
.grid { display:grid; grid-template-columns: 1fr; gap:12px; }
.k { font-weight:600; margin-bottom:4px }
.v { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-word }
@media (min-width: 720px){
  .grid { grid-template-columns: 1fr 1fr }
}
.nav {
  max-width: 900px;
  display: flex;
  margin: 0 auto;
  align-items: center;
  gap: 20px;
  padding: 10px 16px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-toggle {
  display: none;
  font-size: 26px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}
.nav a.brand {
  font-weight: 700;
  color: var(--accent);
  margin-right: auto;
}
.nav a.brand img {
  height:64px;
  width:64px
}
.nav a.active {
  color: var(--accent);
}
main.container {
  margin-top: 120px; /* adjust if header height changes */
}

/* HTMX automatically removes/sets this */
.htmx-request .progress,
.progress.htmx-request {
  display: block;
}

.hidden {
  display: none;
}
.progress-label {
  position: absolute;
  right: 10px;
  font-size: 12px;
  color: var(--muted, #9aa7b4);
}
.tree {
  list-style: none;
  padding-left: 1em;
  margin: 0;
}

.tree summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent, #2f7ae5);
}

.tree .count {
  color: var(--muted, #9aa7b4);
  font-weight: bold;
  font-size: 0.85em;
  margin-left: 4px;
}

.tree details {
  margin: 4px 0;
}

.tree .url {
  font-family: monospace;
  font-size: 0.9em;
  color: var(--muted, #9aa7b4);
  margin-left: 1em;
}
.hidden { display: none; }
.risk-score {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 500;
}
.risk-score .grade {
  font-weight: bold;
  text-transform: uppercase;
  margin-left: 6px;
}
.grade.excellent { color: #3cb371; }
.grade.good { color: #4caf50; }
.grade.moderate { color: #ff9800; }
.grade.weak { color: #f44336; }
.grade.critical { color: #b71c1c; }
.risk-score {
	margin-top: 1rem;
	padding: 12px 16px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--panel);
	color: var(--text);
}
.risk-score strong {
	display: block;
	margin-bottom: 6px;
}
.risk-score .grade {
	text-transform: capitalize;
	font-weight: bold;
	margin-left: 6px;
}
.risk-score .grade.excellent { color: #2ecc71; } /* green */
.risk-score .grade.good { color: #27ae60; }
.risk-score .grade.moderate { color: #f39c12; }
.risk-score .grade.weak { color: #e67e22; }
.risk-score .grade.critical { color: #e74c3c; }

.risk-details ul {
	margin: 8px 0 0 16px;
	padding: 0;
}
.risk-details li {
	margin-bottom: 4px;
	line-height: 1.4;
}
.risk-details code {
	background: var(--border);
	padding: 1px 4px;
	border-radius: 4px;
	font-family: monospace;
}
.snapshot-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-top: 8px;
}
.csp-wrapper {
  position: relative;
  margin-top: 12px;
}

.csp-overlay {
  position: absolute;
  inset: 0;
  padding: 8px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 13px/1.5 ui-monospace,Menlo,Consolas,monospace;
  pointer-events: none;
  z-index: 1; /* <- ON TOP of background */
  color: transparent;
}
#csp-text {
  position: relative;
  z-index: 2; /* <- ABOVE overlay for caret/clicks */
  background: transparent;
  color: #e7ecf2;
  width: 100%;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px;
  font: 13px/1.5 ui-monospace,Menlo,Consolas,monospace;
  resize: vertical;
  caret-color: #e7ecf2;
}
.live-csp {
  position: relative;
  z-index: 1; /* textarea on top */
  background: transparent; /* allows overlay highlights to show through */
  color: var(--text, #e7ecf2);
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border, #333);
  border-radius: 6px;
  resize: vertical;
  min-height: 8lh;
}
.live-csp:focus {
  outline: none;
  box-shadow: 0 0 0 1px #2f7ae5;
}
/* highlights */
.csp-overlay mark{ padding:0 2px; border-radius:3px }
.csp-overlay mark.unsafe{ background:rgba(255,0,0,.25); color:#c00; font-weight:600 }
.csp-overlay mark.good{   background:rgba(0,128,0,.2);  color:#0a730a }
.csp-overlay .hl-unsafe{background:rgba(255,0,0,.25); color:#c00; font-weight:600}
.csp-overlay .hl-permissive{background:rgba(255,165,0,.25); color:#a65e00}
.csp-overlay .hl-strong{background:rgba(0,128,0,.2); color:#0a730a}

.home-container {
    display: flex;
    width: 100%;
    gap: 60px;
    /* justify-content: flex-start; */
    align-items: center;
    /* padding: 32px; */
}
.home-container-bottom {
	display: flex;
    width: 100%;
    gap: 60px;
    justify-content: center;
    /* Removed align-items: center; */
    flex-wrap: wrap;
}
.home-container-cta {
	display: flex;
    width: 100%;
    justify-content: center;
    padding: 32px 0;
    flex-wrap: wrap;
}
.page-container {
    display: flex;
	width: 100%;
	flex-direction: column;
}
.img-responsive {
	  width: 100%;
    border-radius: 8px;
}
.form-container {
    display: flex;
    padding: 20px 0;
    gap: 18px;
    max-width: 900px;
    flex-direction: column;
}
@media (max-width: 768px) {
.form-container {
    display: flex;
    padding: 20px 0;
    max-width: 100%;
    flex-direction: column;
}
form {	
	display: flex;
    gap: 8px;
    align-items: flex-start;
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 12px;
    flex-direction: column;
	}
}
.home-content-row-content {
    flex: 0 0 50%;
}
.home-content-row-content-bottom {
	flex: 0 0 calc(50% - 30px); /* 50% minus half the 60px gap */
    display: flex;
    align-items: center;
    flex-direction: column;
}
.home-content-row-content-bottom-seo {
	flex: 0 0 calc(50% - 30px); /* 50% minus half the 60px gap */
    display: flex;
    gap: 20px;
    align-items: center;
}
.home-content-row-img {
    flex: 0 0 40%;
	max-width: 280px;
    max-height: 280px;
}
.home-main {
	display: flex;
    flex-direction: column;
}
.home-svg-row {
	display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: 32px;
    padding-bottom: 32px;	
}
.home-svg-icon-content svg {
	fill:var(--text);
	height:80px;
	width:80px;
	flex-shrink: 0;
}	
.home-content-row-content-bottom svg {
	height:80px;
	width:80px;
	flex-shrink: 0;
	fill:var(--text);
}
.home-content-row-content-bottom-seo svg {
	height:80px;
	width:80px;
	flex-shrink: 0;
	fill:var(--text);
}
h3.title-center {
    text-align: center;
    max-height: 80px;
    height: 100%;
}
p.text-center {
	text-align:center;	
}
.home-svg-icon-content {
	display: flex;
    align-items: center;
    align-content: center;
    justify-content: center;
    gap: 36px;
}
.home-svg-icon-content p {

    font-family: Roboto, Arial, sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.5;	
}
/* ---------- Accordion Container ---------- */
.faq {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ---------- FAQ Item ---------- */
.faq-item {
  border-bottom: 1px solid rgba(0,0,0,0.15);
  padding: 16px 0;
}

/* ---------- Accordion Button (Question) ---------- */
.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;

  font-size: 1.1rem;
  font-weight: 600;
  text-align: left;
  color: var(--text);

  transition: color 0.2s ease;
}

/* Hover state */
.faq-question:hover {
  color: #0059ff;
}

/* Expand/collapse arrow */
.faq-question::after {
  content: "+";
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.3s ease;
}

/* When opened */
.faq-question[aria-expanded="true"]::after {
  transform: rotate(45deg);
}

/* ---------- Answer Panel ---------- */
.faq-answer {
  padding: 12px 0 4px 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  animation: accordion-open 0.3s ease;
}

.faq-question:hover {
  color: #0059ff;
  background: rgba(0,89,255,0.06);
  border-radius: 6px;
  padding: 8px;
}

@keyframes accordion-open {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Lists inside answers ---------- */
.faq-answer ul {
  margin: 10px 0 16px 20px;
  padding: 0;
}

.faq-answer li {
  margin-bottom: 6px;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .home-container {
    display: flex;
    width: 100%;
    /* gap: 60px; */
    /* justify-content: flex-start; */
    align-items: flex-start;
    /* padding: 32px; */
    flex-direction: column-reverse;
  }	
  .home-container-seo {
    display: flex;
    width: 100%;
    gap: 20px;
    /* justify-content: flex-start; */
    align-items: flex-start;
    /* padding: 32px; */
    flex-direction: column;
  }	
  .faq {
    padding: 20px 16px;
  }
  .faq-question {
    font-size: 1rem;
  }
  .home-content-row-content-bottom {
	flex: 0 0 100%;
	align-items: flex-start;
  }
  .home-content-row-content-bottom-seo {
	flex: 0 0 100%;
	align-items: flex-start;
  }
   p.text-center {
	text-align: left;
  }
  h3.title-center {
	text-align: left;
  }
}
@media (max-width: 768px) {

  .nav {
    justify-content: space-between;
  }

  .nav-toggle {
    display: block;
    color: inherit;
  }

  /* Stack links vertically */
  .nav-links {
    position: absolute;
    top: 90px;
    right: 16px;
    background: var(--panel);
    border: 1px solid #222;
    border-radius: 8px;
    padding: 16px;
    display: none;
    flex-direction: column;
    gap: 16px;
    z-index: 999;
  }

  /* Show when nav-open class is active */
  body.nav-open .nav-links {
    display: flex;
  }
}

.copy-btn,
.copied {
  transition: opacity .25s ease, background-color .25s ease;
}

.htmx-swapping {
  opacity: 0;
}

.htmx-settling {
  opacity: 1;
}

.copied {
  background: #1e7f43;
  color: #fff;
}