/* ==============================================================
   Lighthouse Signal - shared styles
   Used by /scanner.html and the embedded scanner on
   /data-and-analytics. Depends on page.css for base tokens.
   ============================================================== */
:root {
  --ls-pass: #1e8e4f;
  --ls-fail: #c92626;
  --ls-warn: #b16a05;
  --ls-unknown: var(--ink-mute);
}

/* Frame */
.ls-frame {
  background: linear-gradient(160deg, var(--white) 0%, var(--tint-blue) 100%);
  border: 1px solid var(--border-blue);
  border-radius: var(--r-xl);
  padding: var(--s8);
  position: relative; overflow: hidden;
  box-shadow: var(--sh-md);
}
.ls-frame::before {
  content: ""; position: absolute;
  right: -120px; top: -120px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(1,96,226,0.10) 0%, transparent 65%);
  border-radius: 50%; pointer-events: none;
}
.ls-frame > * { position: relative; z-index: 1; }

.ls-meta {
  display: flex; align-items: center; gap: var(--s3);
  margin-bottom: var(--s4); flex-wrap: wrap;
}
.ls-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  background: var(--white);
  border: 1px solid var(--border-blue);
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--blue);
}
.ls-pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(1,96,226,0.18);
}
.ls-pill.alt { color: var(--cyan); }
.ls-pill.alt::before { background: var(--cyan); box-shadow: 0 0 0 3px rgba(32,155,212,0.18); }
.ls-pill.muted { color: var(--ink-mute); border-color: var(--border); }
.ls-pill.muted::before { background: var(--ink-mute); box-shadow: 0 0 0 3px rgba(107,122,153,0.18); }

.ls-h {
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.1;
  margin: 0 0 var(--s3); color: var(--ink);
}
.ls-h .gradient-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ls-lede { color: var(--ink-soft); font-size: 16px; max-width: 60ch; margin: 0 0 var(--s6); line-height: 1.6; }

/* Form */
.ls-form {
  display: flex; gap: var(--s3); margin: 0 0 var(--s4);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px;
  box-shadow: var(--sh-sm);
}
.ls-form input[type=url] {
  flex: 1; padding: 14px 16px; border: 0;
  background: transparent; color: var(--ink);
  font-family: var(--font); font-size: 16px;
  border-radius: var(--r-sm);
}
.ls-form input[type=url]:focus { outline: none; background: var(--paper); }
.ls-form button {
  padding: 14px 24px; border-radius: var(--r-pill);
  background: var(--gradient); color: white !important;
  font-family: var(--font); font-size: 15px; font-weight: 600;
  box-shadow: var(--sh-blue);
  cursor: pointer; border: 0;
  transition: transform .2s, box-shadow .2s, filter .2s;
}
.ls-form button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(1,96,226,.30);
  filter: brightness(1.05);
}
.ls-form button:disabled { opacity: 0.6; cursor: not-allowed; }
.ls-note { font-size: 13px; color: var(--ink-mute); margin: 0; }
.ls-note code {
  font-family: var(--mono); font-size: 12px;
  background: var(--white); padding: 2px 6px;
  border-radius: 4px; color: var(--blue);
  border: 1px solid var(--border-blue);
}

/* Output */
.ls-out { margin-top: var(--s5); }

/* Top-line verdict */
.ls-verdict {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: var(--s4); align-items: center;
  padding: var(--s5) var(--s6);
  border-radius: var(--r-md);
  margin-bottom: var(--s5);
  border: 1px solid;
  box-shadow: var(--sh-sm);
}
.ls-verdict.is-good { background: rgba(46,204,113,0.08); border-color: rgba(46,204,113,0.40); }
.ls-verdict.is-warn { background: rgba(245,166,35,0.08); border-color: rgba(245,166,35,0.40); }
.ls-verdict.is-bad  { background: rgba(255,92,92,0.07);  border-color: rgba(255,92,92,0.40); }
.ls-verdict-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0; color: white;
}
.ls-verdict.is-good .ls-verdict-icon { background: var(--ls-pass); }
.ls-verdict.is-warn .ls-verdict-icon { background: var(--ls-warn); }
.ls-verdict.is-bad  .ls-verdict-icon { background: var(--ls-fail); }
.ls-verdict-icon svg { width: 22px; height: 22px; stroke: white; stroke-width: 2.5; fill: none; }
.ls-verdict-h {
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  margin: 0 0 2px; line-height: 1.25;
}
.ls-verdict.is-good .ls-verdict-h { color: var(--ls-pass); }
.ls-verdict.is-warn .ls-verdict-h { color: var(--ls-warn); }
.ls-verdict.is-bad  .ls-verdict-h { color: var(--ls-fail); }
.ls-verdict-sub { font-size: 13px; color: var(--ink-soft); margin: 0; line-height: 1.5; }
.ls-verdict-cta {
  padding: 10px 18px; border-radius: var(--r-pill);
  background: var(--gradient); color: white !important;
  font-size: 13px; font-weight: 700;
  text-decoration: none; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(1,96,226,.22);
  transition: transform .2s, box-shadow .2s, filter .2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.ls-verdict-cta:hover {
  color: white !important; transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(1,96,226,.32);
  filter: brightness(1.05);
}

/* Summary */
.ls-summary {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s5);
  margin-bottom: var(--s5);
  display: flex; gap: var(--s5); flex-wrap: wrap;
  align-items: center;
  box-shadow: var(--sh-sm);
}
.ls-summary > div {
  font-size: 12px; color: var(--ink-mute);
  letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700;
}
.ls-summary strong {
  display: block; font-size: 26px; font-weight: 700;
  margin-bottom: 2px; letter-spacing: -0.02em; text-transform: none;
}

/* Groups + checks */
.ls-group { margin-bottom: var(--s6); }
.ls-group h3 {
  font-size: 11px; font-weight: 700;
  color: var(--ink-mute); text-transform: uppercase;
  letter-spacing: 0.16em;
  margin: 0 0 var(--s3);
}
.ls-check {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--s4) var(--s5);
  margin-bottom: var(--s2);
  transition: border-color .2s;
}
.ls-check:hover { border-color: var(--border-strong); }
.ls-check-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.ls-check-title { font-weight: 600; color: var(--ink); font-size: 15px; }
.ls-check-msg { color: var(--ink-soft); margin-top: var(--s2); font-size: 14px; line-height: 1.55; }
.ls-badge {
  font-size: 10px; font-weight: 700;
  padding: 4px 10px; border-radius: var(--r-pill);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.ls-badge.pass    { background: rgba(46,204,113,0.12); color: var(--ls-pass); }
.ls-badge.fail    { background: rgba(255,92,92,0.12);  color: var(--ls-fail); }
.ls-badge.warn    { background: rgba(245,166,35,0.14); color: var(--ls-warn); }
.ls-badge.unknown { background: rgba(107,122,153,0.12); color: var(--ls-unknown); }

/* Suggestion */
.ls-suggestion { margin-top: var(--s3); }
.ls-suggestion summary {
  cursor: pointer; color: var(--blue);
  font-size: 13px; font-weight: 600;
  user-select: none; list-style: none;
}
.ls-suggestion summary::-webkit-details-marker { display: none; }
.ls-suggestion summary::before { content: "+ "; font-weight: 700; }
.ls-suggestion[open] summary::before { content: "− "; }
.ls-suggestion summary:hover { color: var(--cyan); }
.ls-suggestion pre {
  background: var(--paper); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: var(--s4);
  overflow-x: auto; font-family: var(--mono);
  font-size: 12px; line-height: 1.5; color: var(--ink);
  margin: var(--s3) 0 0;
}
.ls-suggestion a {
  display: inline-block; margin-top: var(--s3);
  color: var(--blue); font-size: 13px; font-weight: 600;
}
.ls-suggestion a:hover { color: var(--cyan); }

/* Error + spinner */
.ls-error {
  background: rgba(255,92,92,0.08);
  border: 1px solid rgba(255,92,92,0.4);
  color: var(--ls-fail);
  padding: var(--s4) var(--s5);
  border-radius: var(--r-md);
  font-size: 14px; line-height: 1.55;
}
.ls-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: ls-spin 0.8s linear infinite;
  vertical-align: -2px; margin-right: 6px;
}
@keyframes ls-spin { to { transform: rotate(360deg); } }

/* ==============================================================
   Lead-capture gate - results gate over the detailed breakdown
   ============================================================== */
/* The detailed checks, blurred + clipped until the form is filled. */
.ls-detail.ls-locked {
  filter: blur(6px);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
  max-height: 300px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 28%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 28%, transparent 100%);
}

.ls-gate {
  background: var(--white);
  border: 1px solid var(--border-blue);
  border-radius: var(--r-md);
  padding: var(--s6);
  margin-bottom: var(--s5);
  box-shadow: var(--sh-md);
}
.ls-gate-eyebrow {
  font-family: var(--mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: var(--s2);
}
.ls-gate-h {
  font-size: 20px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink); margin: 0 0 var(--s2); line-height: 1.2;
}
.ls-gate-sub {
  font-size: 14px; color: var(--ink-soft); line-height: 1.6;
  margin: 0 0 var(--s5); max-width: 60ch;
}
.ls-gate-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--s4); margin-bottom: var(--s4);
}
.ls-gate-field { display: flex; flex-direction: column; gap: 6px; }
.ls-gate-field span {
  font-size: 12px; font-weight: 700; color: var(--ink);
  letter-spacing: 0.02em;
}
.ls-gate-field input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font); font-size: 15px; color: var(--ink);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.ls-gate-field input:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(32,155,212,0.14);
}
.ls-gate-field input[readonly] {
  background: var(--paper); color: var(--ink-soft); cursor: default;
}
.ls-gate-consent {
  display: flex; align-items: flex-start; gap: var(--s3);
  font-size: 13px; color: var(--ink-soft); line-height: 1.5;
  margin-bottom: var(--s4);
}
.ls-gate-consent input {
  margin-top: 1px; flex-shrink: 0;
  width: 16px; height: 16px; accent-color: var(--blue);
}
.ls-gate-consent a { color: var(--blue); font-weight: 600; }
.ls-gate-submit {
  width: 100%;
  padding: 14px 24px; border: 0; border-radius: var(--r-pill);
  background: var(--gradient); color: white !important;
  font-family: var(--font); font-size: 15px; font-weight: 600;
  cursor: pointer; box-shadow: var(--sh-blue);
  transition: transform .2s, box-shadow .2s, filter .2s;
}
.ls-gate-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(1,96,226,.30);
  filter: brightness(1.05);
}
.ls-gate-submit:disabled { opacity: 0.65; cursor: not-allowed; }
.ls-gate-error {
  margin-top: var(--s3);
  background: rgba(255,92,92,0.08);
  border: 1px solid rgba(255,92,92,0.4);
  color: var(--ls-fail);
  padding: 10px 14px; border-radius: var(--r-sm);
  font-size: 13px; line-height: 1.5;
}
.ls-gate-success {
  display: flex; align-items: center; gap: var(--s3);
}
.ls-gate-success-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ls-pass); flex-shrink: 0;
  display: grid; place-items: center;
}
.ls-gate-success-icon svg {
  width: 18px; height: 18px;
  stroke: white; stroke-width: 2.5; fill: none;
}
.ls-gate-success strong { color: var(--ink); }
.ls-gate-success div { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }

@media (max-width: 700px) {
  .ls-frame { padding: var(--s6) var(--s5); }
  .ls-form { flex-direction: column; }
  .ls-form button { width: 100%; }
  .ls-verdict { grid-template-columns: auto 1fr; }
  .ls-verdict-cta { grid-column: 1 / -1; justify-content: center; }
  .ls-gate-row { grid-template-columns: 1fr; gap: var(--s3); }
}
