/* ============================================================
   CELVEX Group — /free-scan.html + /scan-status.html
   Extends index.css. Anything not declared here inherits the
   shared visual system (dark navy + cyan, glass cards,
   gradient buttons).
   ============================================================ */

/* ---------- Visually-hidden helper (a11y) ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ---------- Honeypot (DOM-present, visually hidden, tab-skipped) ---------- */
.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---------- Hero shape on free-scan + scan-status ---------- */
.scan-hero {
  padding-top: 4rem;
  padding-bottom: 2rem;
}
.scan-hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
}
.scan-hero p.sub {
  margin-bottom: 1.5rem;
}

/* ---------- Scan form (free-scan.html) ---------- */
.scan-form {
  max-width: 560px;
  margin: 1.25rem auto 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.field label,
.field legend {
  color: var(--text);
  font-size: .92rem;
  font-weight: 600;
}
.field input[type=text],
.field input[type=email] {
  padding: .9rem 1.1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--white);
  font-size: .98rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.field input::placeholder { color: var(--text-muted); }
.field input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(48,184,220,.2);
}
.field input.is-error,
.field input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,68,68,.18);
}

.field-help {
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.5;
  margin-top: .15rem;
}
.field-error {
  color: #fca5a5;
  font-size: .85rem;
  font-weight: 500;
  margin-top: .15rem;
}

/* Schedule-radio styles removed 2026-05-14: the free scan runs once by
   design, so the form no longer carries a schedule selector. */

/* ---------- Turnstile widget slot ---------- */
.turnstile-field {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.turnstile-field .cf-turnstile {
  /* CF injects an iframe; nothing to style. The container only ensures
     vertical spacing parity with other fields. */
  width: 100%;
  display: flex;
  justify-content: center;
}

/* ---------- Submit button + privacy note ---------- */
.submit-btn {
  width: 100%;
  padding: 1rem 1.4rem;
  font-size: 1rem;
}
.submit-btn:disabled {
  opacity: .65;
  cursor: progress;
  transform: none !important;
  box-shadow: none !important;
}

.privacy-note {
  margin-top: .25rem;
  font-size: .82rem;
  color: var(--text-muted);
}
.privacy-note a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Form-level status / live region ---------- */
.form-status {
  max-width: 560px;
  margin: .25rem auto 0;
  min-height: 1.5em;
  font-size: .92rem;
  font-weight: 500;
  text-align: center;
  color: var(--text-dim);
}
.form-status.level-info    { color: var(--cyan); }
.form-status.level-error   { color: #fca5a5; }
.form-status.level-success { color: var(--green); }

/* ---------- Status page card ---------- */
.status-card {
  max-width: 720px;
  margin: 2rem auto 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.6rem;
  text-align: left;
  box-shadow: var(--shadow);
}

.status-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.status-meta dt {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: .15rem;
}
.status-meta dd {
  color: var(--text);
  font-size: .95rem;
  font-weight: 500;
  margin: 0;
  word-break: break-all;
}
@media (max-width: 540px) {
  .status-meta { grid-template-columns: 1fr; gap: .75rem; }
}

.status-state {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.state-pill {
  display: inline-block;
  padding: .35rem .85rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: rgba(48,184,220,.12);
  color: var(--cyan);
  border: 1px solid rgba(48,184,220,.3);
}
.state-pill[data-state="loading"]                { color: var(--text-dim); border-color: var(--border); background: rgba(255,255,255,.04); }
.state-pill[data-state="pending_authorization"]  { color: var(--gold); background: rgba(234,179,8,.1);   border-color: rgba(234,179,8,.3); }
.state-pill[data-state="queued"]                 { color: var(--cyan); }
.state-pill[data-state="running"]                { color: var(--cyan); animation: pulseGlow 2.4s ease-in-out infinite; }
.state-pill[data-state="complete"]               { color: var(--green); background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.3); }
.state-pill[data-state="failed"]                 { color: #fca5a5; background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.3); }

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(48,184,220,.0); }
  50%      { box-shadow: 0 0 0 6px rgba(48,184,220,.15); }
}

.state-detail {
  color: var(--text-dim);
  font-size: .9rem;
}

.progress-wrap {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: .5rem;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--navy), var(--cyan));
  border-radius: 999px;
  transition: width .8s ease;
}
.progress-label {
  margin-top: .4rem;
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.5rem;
}
.status-actions .btn { flex: 1 1 200px; min-width: 0; }

.status-error {
  margin-top: 1rem;
  padding: .85rem 1rem;
  border-radius: 10px;
  font-size: .9rem;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5;
}
.status-error[data-level="warn"] {
  background: rgba(234,179,8,.08);
  border-color: rgba(234,179,8,.3);
  color: #fde68a;
}

/* ---------- Active nav state ---------- */
.nav-cta.active {
  box-shadow: 0 0 0 1px rgba(48,184,220,.6), 0 6px 18px rgba(48,184,220,.25);
}

/* ---------- Reduced-motion: kill the running pulse ---------- */
@media (prefers-reduced-motion: reduce) {
  .state-pill[data-state="running"] { animation: none; }
  .progress-bar { transition: none; }
}
