/* ============================================================
   ADA Standalone — App stylesheet
   Single-page audit experience matching the OwlHoot screenshot.
   ============================================================ */

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

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
               Ubuntu, "Helvetica Neue", Arial, sans-serif;
  background: #f1f5fb;
  color: #1f2533;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.modal-open { overflow: hidden; }

a       { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Shell ─────────────────────────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-header {
  background: var(--brand-dark);
  color: #fff;
  padding: 22px 28px 18px;
  border-bottom: 4px solid var(--brand-primary);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 9px;
  background: var(--brand-primary);
  color: var(--brand-dark);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.brand-name    { font-size: 18px; letter-spacing: 0.02em; }
.brand-tagline { margin-top: 6px; font-size: 13px; color: #c8c8be; letter-spacing: 0.02em; }

.app-main {
  flex: 1;
  padding: 36px 22px 60px;
  display: flex;
  justify-content: center;
}
.app-footer {
  padding: 14px 22px;
  font-size: 12px;
  text-align: center;
  color: #6b7385;
  background: #e7ecf4;
  border-top: 1px solid #d6deeb;
}
.app-footer .dot { margin: 0 6px; opacity: .5; }

/* ── Single-page state container ───────────────────────────────────── */
.audit-app { width: 100%; max-width: 1280px; }
.stage     { animation: fadeIn .25s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============================================================
   STAGE 1 — Gateway (GHL form)
   ============================================================ */
.gateway-card {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 8px 32px rgba(20, 25, 34, 0.08);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 36px;
}
@media (max-width: 880px) {
  .gateway-card { grid-template-columns: 1fr; padding: 24px; }
}
.gateway-headline h1 {
  font-size: 30px;
  margin: 0 0 12px;
  color: var(--brand-dark);
  line-height: 1.2;
}
.gateway-sub { color: #4a5468; margin-top: 0; }
.gateway-bullets {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
}
.gateway-bullets li {
  padding: 10px 0 10px 30px;
  position: relative;
  border-bottom: 1px dashed #e4e0d4;
}
.gateway-bullets li:last-child { border-bottom: none; }
.gateway-bullets li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 10px;
  width: 22px; height: 22px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 13px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   STAGE 2 — Audit form  (two-column, matches screenshot)
   ============================================================ */
.audit-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 980px) {
  .audit-grid { grid-template-columns: 1fr; }
}

.audit-form-card,
.info-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(20, 25, 34, .06);
}
.audit-form-card { padding: 28px 28px 26px; border-top: 4px solid #4f7cf6; }
.info-card       { padding: 22px 24px; border: 1px solid #e2e9f4; box-shadow: none; }
.info-card + .info-card { margin-top: 18px; }
.info-card-alt   { background: #f3f7ff; border-color: #d8e3f7; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.card-header h2 {
  margin: 0;
  font-size: 19px;
  color: var(--brand-dark);
  display: flex; align-items: center; gap: 8px;
}
.card-desc {
  color: #5b6478;
  font-size: 14px;
  margin: 6px 0 22px;
}
.btn-pill {
  background: #eaf0fb;
  color: #3a5fd5;
  border: 1px solid #cdd9f1;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, border .15s;
}
.btn-pill:hover { background: #d9e3f7; border-color: #9eb7e6; }

/* ── Form fields ─────────────────────────────────────────────────── */
.audit-form { display: flex; flex-direction: column; gap: 20px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1f2533;
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-label .req { color: #e54848; font-weight: 700; }
.field-label .hint-inline {
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #8a93a6;
}

.input-wrap {
  position: relative;
}
.input-wrap .input-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.6;
  pointer-events: none;
}
.input-wrap input,
.url-row input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1.5px solid #d4dceb;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fbfcff;
  transition: border .15s, box-shadow .15s, background .15s;
}
.input-wrap input:focus,
.url-row input:focus {
  outline: none;
  border-color: #4f7cf6;
  box-shadow: 0 0 0 3px rgba(79, 124, 246, .15);
  background: #fff;
}

.hint {
  font-size: 12px;
  color: #8a93a6;
}

/* ── URL multi-input list ────────────────────────────────────────── */
.url-list { display: flex; flex-direction: column; gap: 8px; }
.url-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.url-row .input-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.6;
  pointer-events: none;
}
.btn-icon {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 10px;
  border: 1.5px solid #d4dceb;
  background: #f3f7ff;
  color: #4f7cf6;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: background .12s, border .12s, color .12s;
}
.btn-icon:hover    { background: #e2ebff; border-color: #b1c5ee; }
.btn-icon.btn-remove {
  background: #fff0ed;
  border-color: #f7c5be;
  color: #c0392b;
}
.btn-icon.btn-remove:hover { background: #fcd9d3; }

/* ── Submit button ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-block  { width: 100%; padding: 14px 22px; font-size: 16px; margin-top: 4px; }
.btn-primary {
  background: #3a5fd5;
  color: #fff;
  box-shadow: 0 4px 14px rgba(58, 95, 213, .3);
}
.btn-primary:hover { background: #2c50c1; }
.btn-ghost {
  background: #f1f4fb;
  color: #4a5468;
}
.btn-ghost:hover { background: #e3e9f5; text-decoration: none; }

.audit-error {
  background: #fdecea;
  color: #8b1a13;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #f5c5bf;
  font-size: 14px;
  margin-top: 4px;
}

/* ── Right column: How it works + Covers ─────────────────────────── */
.audit-info h3 {
  margin: 0 0 14px;
  font-size: 17px;
  color: var(--brand-dark);
  display: flex; align-items: center; gap: 8px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.steps li {
  display: flex;
  gap: 14px;
  padding: 6px 0 18px 0;
  position: relative;
}
.steps li:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 17px; top: 36px; bottom: -2px;
  width: 2px;
  background: linear-gradient(to bottom, #d8e3f7, transparent);
}
.step-num {
  flex: 0 0 36px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #eaf0fb;
  color: #3a5fd5;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 1.5px solid #cdd9f1;
  position: relative;
  z-index: 1;
}
.step-body h4 {
  margin: 4px 0 4px;
  font-size: 15px;
  color: var(--brand-dark);
  font-weight: 700;
}
.step-body p {
  margin: 0;
  color: #5b6478;
  font-size: 14px;
}
.step-body .note {
  color: #3a5fd5;
}

/* "What the report covers" */
.covers {
  list-style: disc;
  padding-left: 20px;
  margin: 6px 0 0;
  color: #1f2533;
}
.covers li {
  padding: 4px 0;
  font-size: 14px;
}

/* ============================================================
   STAGE 3 — Progress
   ============================================================ */
.progress-card {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 8px 32px rgba(20, 25, 34, 0.08);
  text-align: center;
}
.progress-spinner {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 5px solid #e4ecf9;
  border-top-color: #3a5fd5;
  margin: 0 auto 18px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-card h2 { margin: 4px 0 6px; color: var(--brand-dark); font-size: 22px; }
.progress-msg { color: #5b6478; margin: 0 0 18px; word-break: break-all; }
.progress-bar {
  height: 8px;
  background: #e7ecf4;
  border-radius: 99px;
  overflow: hidden;
  margin: 8px auto 6px;
  max-width: 520px;
}
.progress-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #3a5fd5, #6c8ee0);
  border-radius: inherit;
  transition: width 0.5s ease-out;
}
.progress-counter { font-size: 13px; color: #8a93a6; margin: 4px 0 18px; }

.progress-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  text-align: left;
}
.progress-item {
  display: grid;
  grid-template-columns: 24px minmax(0,1fr) auto;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e9f4;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 8px;
  background: #fafcff;
  align-items: center;
}
.progress-item .url    { color: #1f2533; word-break: break-all; }
.progress-item .status { font-size: 12px; color: #6b7385; white-space: nowrap; }
.progress-item .dot    { font-weight: 700; text-align: center; }
.progress-item-active  { border-color: #c5d4f3; background: #f0f4ff; }
.progress-item-active  .status { color: #3a5fd5; }
.progress-item-done    { border-color: #c0e3cf; background: #f0faf4; }
.progress-item-done    .status { color: #1f6b3f; }
.progress-item-failed  { border-color: #f5c5bf; background: #fdecea; }
.progress-item-failed  .status { color: #8b1a13; }

.progress-note { font-size: 13px; color: #888; margin-top: 18px; }

/* ============================================================
   STAGE 4 — Results
   ============================================================ */
.results-card {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  padding: 32px 32px 26px;
  box-shadow: 0 8px 32px rgba(20, 25, 34, 0.08);
}
.results-header { margin-bottom: 22px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 700;
  color: #1f6b3f;
  margin: 0 0 6px;
}
.results-card h2 { margin: 0 0 6px; color: var(--brand-dark); font-size: 24px; }
.results-sub { color: #5b6478; margin: 0; }

.results-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.result-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #e2e9f4;
  border-radius: 12px;
  background: #fafcff;
}
.result-ok   { border-color: #c0e3cf; background: #f6faf7; }
.result-fail { border-color: #f5c5bf; background: #fff7f6; }
.result-meta   { flex: 1 1 280px; min-width: 0; }
.result-domain { font-weight: 700; color: var(--brand-dark); }
.result-url    { color: #6b7385; font-size: 13px; word-break: break-all; }
.result-stats  { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  display: inline-block;
  background: #eaf0fb;
  color: #3a5fd5;
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}
.result-error { color: #8b1a13; font-size: 13px; margin-top: 4px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.results-actions { text-align: center; padding-top: 6px; border-top: 1px dashed #e2e9f4; }

/* ============================================================
   Modal — Guidelines
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 100; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 25, 34, .55);
  backdrop-filter: blur(2px);
}
.modal-panel {
  position: relative;
  margin: 5vh auto;
  width: 92%;
  max-width: 580px;
  background: #fff;
  border-radius: 14px;
  padding: 26px 28px;
  max-height: 86vh;
  overflow: auto;
  box-shadow: 0 24px 60px rgba(20, 25, 34, .35);
  z-index: 1;
}
.modal-panel h2 { margin: 0 0 14px; color: var(--brand-dark); }
.modal-close {
  position: absolute;
  top: 10px; right: 12px;
  background: transparent;
  border: none;
  color: #5b6478;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: #1f2533; }
.guidelines-list {
  margin: 0;
  padding-left: 22px;
  color: #1f2533;
}
.guidelines-list li { padding: 6px 0; font-size: 14px; }
.guidelines-list code {
  background: #f1f4fb;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 13px;
  color: #3a5fd5;
}

/* ============================================================
   Single-report view & Admin (kept light from prior version)
   ============================================================ */
.report-card {
  width: 100%; max-width: 760px; margin: 0 auto;
  background: #fff; border-radius: 16px; padding: 32px;
  box-shadow: 0 8px 32px rgba(20,25,34,.08);
}
.report-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; margin-bottom: 16px; flex-wrap: wrap;
}
.report-card h1 { margin: 0 0 4px; font-size: 26px; color: var(--brand-dark); }
.report-meta { color: #6b7385; margin: 0; font-size: 14px; }
.report-score { display: flex; align-items: baseline; gap: 4px; padding: 10px 18px; border-radius: 12px; font-weight: 700; }
.report-score.score-bad  { background: #fdecea; color: #8b1a13; }
.report-score.score-mid  { background: #fef3df; color: #8c4f06; }
.report-score.score-good { background: #e6f4ec; color: #1f6b3f; }
.score-num { font-size: 32px; }
.score-lbl { font-size: 14px; opacity: 0.7; }
.report-summary {
  background: #f3f7ff; border-left: 4px solid #3a5fd5;
  padding: 14px 16px; margin: 18px 0 24px; border-radius: 6px; color: #2a3146;
}
.report-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
@media (max-width: 600px) { .report-stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: #f6f8fd; padding: 14px; border-radius: 10px; text-align: center; }
.stat-num { display: block; font-size: 26px; font-weight: 700; color: var(--brand-dark); }
.stat-lbl { display: block; font-size: 12px; color: #6b7385; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }
.stat-critical .stat-num { color: #c0392b; }
.stat-serious  .stat-num { color: #d97706; }
.stat-moderate .stat-num { color: #2563eb; }
.report-tier {
  background: var(--brand-dark); color: #f5f5f0;
  padding: 14px 16px; border-radius: 10px; margin-bottom: 24px; font-size: 14px;
}
.report-tier .price { color: var(--brand-primary); font-weight: 700; font-size: 16px; }
.report-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.report-preview h3 { margin: 0 0 12px; font-size: 16px; color: var(--brand-dark); }
.pdf-preview { width: 100%; height: 720px; border: 1px solid #e2e9f4; border-radius: 10px; background: #f6f8fd; }

.admin-shell { width: 100%; max-width: 1240px; margin: 0 auto; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
@media (max-width: 700px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: #fff; padding: 18px; border-radius: 12px; box-shadow: 0 2px 10px rgba(20, 25, 34, .06); }
.kpi-num { display: block; font-size: 26px; font-weight: 700; color: var(--brand-dark); }
.kpi-lbl { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: #6b7385; margin-top: 4px; }
.admin-shell h2 { margin: 0 0 14px; color: var(--brand-dark); }
.admin-table {
  width: 100%; border-collapse: collapse;
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(20, 25, 34, .06);
}
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #eef2f8; font-size: 14px; vertical-align: top; }
.admin-table th { background: #f3f7ff; text-transform: uppercase; font-size: 11px; letter-spacing: 0.08em; color: #6b7385; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .actions a { margin-right: 10px; font-weight: 600; }
.admin-table .empty { text-align: center; color: #6b7385; padding: 28px; }

/* ── Embed mode ────────────────────────────────────────────────────── */
body.embed .app-header,
body.embed .app-footer { display: none; }
body.embed .app-main { padding: 18px 14px 30px; }
