/* Free Website Audit page — extends page.css (same tokens). */
.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; }
[hidden] { display: none !important; }

.audit-box {
  margin: 2rem 0 1rem; padding: 1.5rem; border-radius: 20px;
  background: linear-gradient(var(--dark-2), var(--dark-2)) padding-box, var(--grad) border-box;
  border: 1px solid transparent; box-shadow: 0 20px 60px rgba(0, 240, 255, 0.08);
}
.audit-form { display: flex; gap: .75rem; }
.audit-form input {
  flex: 1; min-width: 0; background: rgba(255,255,255,0.05); border: 1px solid var(--card-border); border-radius: 999px;
  padding: .95rem 1.3rem; color: var(--text-1); font-family: var(--font-body); font-size: 1.05rem;
}
.audit-form input:focus { outline: none; border-color: var(--cyan); }
.audit-form .btn { white-space: nowrap; }
.audit-note { font-size: .85rem; color: var(--text-3); margin: .8rem 0 0; }
.audit-error { margin: .8rem 0 0; padding: .7rem 1rem; border-radius: 12px; background: rgba(255, 70, 90, 0.12); border: 1px solid rgba(255, 70, 90, 0.35); color: #ffb3bd; font-size: .92rem; }
@media (max-width: 560px) { .audit-form { flex-direction: column; } .audit-form .btn { justify-content: center; } }

/* Progress */
.audit-progress { margin: 2rem 0; padding: 2rem 1.5rem; text-align: center; border: 1px solid var(--card-border); border-radius: 20px; background: var(--card-bg); }
.audit-spinner { width: 54px; height: 54px; margin: 0 auto 1rem; border-radius: 50%; border: 3px solid rgba(255,255,255,0.08); border-top-color: var(--cyan); border-right-color: var(--magenta); animation: audit-spin 1s linear infinite; }
@keyframes audit-spin { to { transform: rotate(360deg); } }
.audit-progress-title { font-family: var(--font-head); font-size: 1.15rem; color: var(--text-1); }
.audit-steps { list-style: none; padding: 0; margin: 1rem auto 0; max-width: 340px; text-align: left; }
.audit-steps li { padding: .3rem 0 .3rem 1.8rem; position: relative; color: var(--text-3); transition: color .3s; }
.audit-steps li::before { content: ''; position: absolute; left: 0; top: .72rem; width: .7rem; height: .7rem; border-radius: 50%; border: 2px solid var(--text-3); }
.audit-steps li.active { color: var(--text-1); }
.audit-steps li.active::before { border-color: var(--cyan); animation: audit-pulse 1s ease-in-out infinite; }
.audit-steps li.done { color: var(--text-2); }
.audit-steps li.done::before { background: var(--cyan); border-color: var(--cyan); }
@keyframes audit-pulse { 50% { box-shadow: 0 0 0 5px rgba(0,240,255,0.15); } }

/* Results */
.audit-results { margin-top: 2rem; }
.audit-results, .audit-book, .audit-box, .audit-progress { scroll-margin-top: 90px; }
.audit-summary { display: flex; gap: 1.5rem; align-items: center; padding: 1.5rem; border: 1px solid var(--card-border); border-radius: 20px; background: var(--card-bg); }
.audit-summary h2 { margin: 0 0 .4rem; }
.audit-summary .eyebrow { margin-bottom: .3rem; word-break: break-all; }
.audit-summary .cta-row { margin: 1rem 0 0; }
.audit-grade {
  flex-shrink: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; text-align: center;
  font-family: var(--font-head); font-weight: 700; font-size: 3.4rem; line-height: 1; color: #fff;
}
.audit-grade small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .85rem; opacity: .9; margin-top: .25rem; }
.g-A { background: radial-gradient(circle at 30% 30%, #34d399, #15803d); }
.g-B { background: radial-gradient(circle at 30% 30%, #a3e635, #4d7c0f); }
.g-C { background: radial-gradient(circle at 30% 30%, #facc15, #a16207); }
.g-D { background: radial-gradient(circle at 30% 30%, #fb923c, #c2410c); }
.g-F { background: radial-gradient(circle at 30% 30%, #f87171, #b91c1c); }
.audit-counts { margin: 0; color: var(--text-2); }
.audit-counts b { color: var(--text-1); font-weight: 600; }
@media (max-width: 640px) { .audit-summary { flex-direction: column; text-align: center; } .audit-summary .cta-row { justify-content: center; } }

.audit-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: 1rem 0 0; }
@media (max-width: 560px) { .audit-cats { grid-template-columns: repeat(2, 1fr); } }
.audit-cat { padding: 1rem; border: 1px solid var(--card-border); border-radius: 16px; background: var(--card-bg); }
.audit-cat-label { font-size: .85rem; color: var(--text-2); }
.audit-cat-score { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: var(--text-1); }
.audit-cat-score span { font-size: .9rem; color: var(--text-3); font-weight: 600; margin-left: .3rem; }
.audit-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,0.08); overflow: hidden; margin-top: .4rem; }
.audit-bar i { display: block; height: 100%; border-radius: 6px; }
.b-A { background: #22c55e; } .b-B { background: #84cc16; } .b-C { background: #eab308; } .b-D { background: #f97316; } .b-F { background: #ef4444; }

/* Google Lighthouse panel */
.audit-lh { margin-top: 2rem; padding: 1.5rem; border: 1px solid var(--card-border); border-radius: 20px; background: var(--card-bg); }
.audit-lh h2 { margin: 0 0 1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; }
.audit-lh-src { font-family: var(--font-body); font-weight: 400; font-size: .8rem; color: var(--text-3); }
.audit-lh-grid { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: start; }
.audit-lh-scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.audit-lh-score { text-align: center; }
.audit-lh-ring {
  --c: #ef4444; width: 74px; height: 74px; margin: 0 auto .4rem; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; color: var(--c);
  background: radial-gradient(closest-side, var(--dark-2) 82%, transparent 83%), conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255,255,255,0.08) 0);
}
.audit-lh-ring.lh-good { --c: #22c55e; } .audit-lh-ring.lh-average { --c: #f59e0b; }
.audit-lh-label { font-size: .82rem; color: var(--text-2); line-height: 1.3; }
.audit-lh-field { margin: 1.1rem 0 0; padding: .6rem .9rem; border-radius: 10px; font-size: .92rem; background: rgba(255,255,255,0.04); }
.audit-lh-field.lh-good { color: #86efac; } .audit-lh-field.lh-average { color: #fcd34d; } .audit-lh-field.lh-poor { color: #fca5a5; }
.audit-lh-metrics { list-style: none; padding: 0; margin: 1rem 0 0; }
.audit-lh-metrics li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0 .45rem 1.2rem; border-bottom: 1px solid var(--card-border); position: relative; }
.audit-lh-metrics li::before { content: ''; position: absolute; left: 0; top: 50%; width: .55rem; height: .55rem; margin-top: -.27rem; border-radius: 50%; background: #ef4444; }
.audit-lh-metrics li.lh-good::before { background: #22c55e; } .audit-lh-metrics li.lh-average::before { background: #f59e0b; }
.audit-lh-metrics b { color: var(--text-1); font-weight: 600; white-space: nowrap; }
.audit-lh-shot { margin: 0; width: 170px; text-align: center; }
.audit-lh-shot img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--card-border); display: block; }
.audit-lh-shot figcaption { font-size: .78rem; color: var(--text-3); margin-top: .4rem; }
@media (max-width: 640px) {
  .audit-lh-grid { grid-template-columns: 1fr; }
  .audit-lh-scores { grid-template-columns: repeat(2, 1fr); }
  .audit-lh-shot { width: 150px; margin: 0 auto; }
}

.audit-ai { margin-top: 2rem; padding: 1.25rem 1.5rem; border-left: 3px solid var(--magenta); background: var(--card-bg); border-radius: 0 16px 16px 0; }
.audit-ai h2 { margin-top: 0; }
.audit-ai h3 { font-size: 1.05rem; margin: 1.2rem 0 .4rem; }
.audit-ai ul, .audit-ai ol { padding-left: 1.3rem; margin: 0 0 1em; }
.audit-muted { color: var(--text-3); font-style: italic; }

.audit-issue { padding: 1.1rem 1.25rem; border: 1px solid var(--card-border); border-radius: 16px; background: var(--card-bg); margin-bottom: .75rem; }
.audit-issue-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.audit-issue h3 { margin: 0; font-size: 1.02rem; flex-basis: 100%; }
.audit-issue p { margin: .35rem 0 0; font-size: .95rem; }
.audit-fix { padding-left: .8rem; border-left: 2px solid #22c55e; }
.audit-fix strong { color: #4ade80; }
.chip { display: inline-block; padding: .12rem .6rem; border-radius: 999px; font-size: .7rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #fff; }
.chip-cat { background: rgba(255,255,255,0.08); color: var(--text-2); text-transform: none; letter-spacing: 0; font-weight: 500; }
.s-critical { background: #dc2626; } .s-high { background: #ea580c; } .s-medium { background: #ca8a04; } .s-low { background: #2563eb; } .s-info { background: #4b5563; }
.audit-more { padding: 1rem 1.25rem; border-radius: 16px; border: 1px dashed rgba(255,0,212,0.45); color: var(--text-1); }

.audit-book select {
  width: 100%; background: rgba(255,255,255,0.04); border: 1px solid var(--card-border); border-radius: 10px;
  padding: .85rem 1rem; color: var(--text-1); font-family: var(--font-body); font-size: 1rem;
}
.audit-book select option { background: var(--dark-2); color: var(--text-1); }
.audit-form-msg { margin: 0; padding: .75rem 1rem; border-radius: 10px; font-size: .95rem; }
.audit-form-msg.ok { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.4); color: #86efac; }
.audit-form-msg.err { background: rgba(255,70,90,0.12); border: 1px solid rgba(255,70,90,0.35); color: #ffb3bd; }
.audit-again { text-align: center; margin-top: 2rem; }
button.btn-ghost { font-family: var(--font-body); }

@media (prefers-reduced-motion: reduce) { .audit-spinner, .audit-steps li.active::before { animation: none; } }
