/* ── SEO Audit Page ── */

/* ── Hero / Input ── */
#audit-hero {
  min-height: 52vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 8rem 2rem 4rem;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
  position: relative; overflow: hidden;
}
#audit-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(21,110,246,.08) 0%, transparent 65%);
  pointer-events: none;
}
.audit-hero-label {
  font-size: .65rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: .6rem;
}
.audit-hero-label::before {
  content: ''; display: inline-block; width: 28px; height: 1px; background: var(--accent);
}
.audit-hero-title {
  font-family: 'Figtree', sans-serif; font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.8rem); line-height: 1.1;
  letter-spacing: -.03em; margin-bottom: 1rem;
}
.audit-hero-title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic; font-weight: 400; color: var(--accent);
}
.audit-hero-sub {
  color: var(--muted); font-size: .9rem; max-width: 48ch; line-height: 1.65;
  margin-bottom: 2.5rem;
}

/* URL Form */
.audit-form {
  display: flex; gap: .75rem; width: 100%; max-width: 680px;
  position: relative; z-index: 1;
}
.audit-input {
  flex: 1;
  padding: 1rem 1.25rem;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 4px;
  font-family: var(--font-sans); font-size: .9rem; color: var(--ink);
  outline: none; transition: border-color .25s, box-shadow .25s;
}
.audit-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21,110,246,.1);
}
.audit-input::placeholder { color: var(--muted); opacity: .7; }
.audit-btn {
  padding: 1rem 2rem;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-sans); font-size: .8rem;
  letter-spacing: .1em; text-transform: uppercase;
  border: none; border-radius: 4px; cursor: pointer;
  transition: background .25s, transform .25s;
  white-space: nowrap;
}
.audit-btn:hover:not(:disabled) { background: var(--accent); transform: translateY(-1px); }
.audit-btn:disabled { opacity: .55; cursor: not-allowed; }

.audit-disclaimer {
  margin-top: 1rem; font-size: .65rem; color: var(--muted);
  letter-spacing: .05em;
}

/* ── Error Banner ── */
.audit-error {
  display: none;
  margin: 2rem auto 0; max-width: 680px;
  padding: .9rem 1.25rem;
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25); border-radius: 4px;
  color: #dc2626; font-size: .85rem;
}
.audit-error.visible { display: block; }

/* ── Loading ── */
#audit-loading {
  display: none;
  flex-direction: column; align-items: center;
  padding: 5rem 2rem; gap: 1.25rem; text-align: center;
}
#audit-loading.visible { display: flex; }
.audit-spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.audit-loading-text {
  font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}

/* ── Results Section ── */
#audit-results {
  display: none;
  padding: 4rem 0 6rem;
}
#audit-results.visible { display: block; }

/* Score Card */
.score-card {
  display: flex; gap: 3rem; align-items: center;
  padding: 3rem; background: var(--ink); border-radius: 6px;
  color: var(--paper); margin-bottom: 2rem;
  position: relative; overflow: hidden;
}
.score-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(21,110,246,.2) 0%, transparent 60%);
  pointer-events: none;
}
.score-ring-wrap {
  position: relative; flex-shrink: 0;
  width: 160px; height: 160px;
}
.score-ring {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.score-bg-circle {
  fill: none; stroke: rgba(255,255,255,.1); stroke-width: 10;
}
.score-fill-circle {
  fill: none; stroke: #22c55e; stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 408.41;
  stroke-dashoffset: 408.41;
  transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1), stroke .3s;
}
.score-center-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-number {
  font-family: 'Figtree', sans-serif; font-weight: 800;
  font-size: 2.8rem; line-height: 1; letter-spacing: -.05em;
}
.score-pct-label {
  font-size: .6rem; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255,255,255,.6);
}
.score-info { flex: 1; position: relative; z-index: 1; }
.score-grade {
  display: inline-block;
  font-family: 'Figtree', sans-serif; font-weight: 800;
  font-size: 1.1rem; letter-spacing: .05em;
  padding: .25rem .8rem; border-radius: 3px;
  background: rgba(255,255,255,.1);
  margin-bottom: .75rem;
}
.score-url {
  font-size: .75rem; color: rgba(255,255,255,.55);
  word-break: break-all; margin-bottom: 1.5rem;
}
.score-url a { color: rgba(255,255,255,.7); text-decoration: none; }
.score-url a:hover { color: var(--accent); }

/* Quick Stats */
.quick-stats {
  display: flex; flex-wrap: wrap; gap: .75rem;
}
.stat-pill {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .9rem;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1);
  border-radius: 3px;
  font-size: .7rem; color: rgba(255,255,255,.75); letter-spacing: .05em;
}
.stat-pill svg { flex-shrink: 0; }

/* ── Checks Grid ── */
.checks-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}
.check-section {
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.check-section-header {
  padding: 1rem 1.5rem;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.check-section-title {
  font-family: 'Figtree', sans-serif; font-weight: 700; font-size: .85rem;
}
.check-section-score {
  font-size: .7rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.check-item {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: auto 1fr auto; gap: .85rem;
  align-items: start;
}
.check-item:first-of-type { border-top: none; }
.check-icon {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
  font-size: .65rem; font-weight: 700;
}
.check-icon.good  { background: rgba(34,197,94,.15);  color: #16a34a; }
.check-icon.warn  { background: rgba(245,158,11,.15); color: #d97706; }
.check-icon.fail  { background: rgba(239,68,68,.15);  color: #dc2626; }
.check-body { min-width: 0; }
.check-label {
  font-family: 'Figtree', sans-serif; font-weight: 600;
  font-size: .8rem; margin-bottom: .2rem;
}
.check-value {
  font-size: .72rem; color: var(--muted);
  font-style: italic; margin-bottom: .3rem;
  word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.check-detail { font-size: .68rem; color: var(--muted); }
.check-tip {
  font-size: .68rem; color: var(--accent);
  margin-top: .3rem; line-height: 1.5;
}
.check-score-badge {
  font-size: .65rem; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  padding-top: 2px;
}

/* Score colors for ring */
.score-fill-circle.score-a  { stroke: #22c55e; }
.score-fill-circle.score-b  { stroke: var(--accent); }
.score-fill-circle.score-c  { stroke: #f59e0b; }
.score-fill-circle.score-d  { stroke: #f97316; }
.score-fill-circle.score-f  { stroke: #ef4444; }

/* Category full-width */
.check-section.full-width { grid-column: 1 / -1; }

/* Informational badge */
.check-info-badge {
  display: inline-block;
  font-size: .55rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .15rem .5rem; background: var(--cream); border: 1px solid var(--line);
  border-radius: 2px; color: var(--muted); margin-left: .5rem; vertical-align: middle;
}

/* ── New audit button ── */
.new-audit-bar {
  text-align: center; padding: 3rem 0 0;
}
.new-audit-bar button {
  padding: .75rem 2rem;
  border: 1.5px solid var(--line); border-radius: 4px;
  background: none; cursor: pointer;
  font-family: var(--font-sans); font-size: .75rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  transition: border-color .25s, color .25s;
}
.new-audit-bar button:hover { border-color: var(--ink); color: var(--ink); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .score-card { flex-direction: column; gap: 2rem; padding: 2rem; }
  .score-ring-wrap { width: 130px; height: 130px; }
  .checks-layout { grid-template-columns: 1fr; }
  .check-section.full-width { grid-column: 1; }
}
@media (max-width: 640px) {
  .audit-form { flex-direction: column; }
  .audit-btn { width: 100%; }
  #audit-hero { padding: 7rem 1.5rem 3rem; }
  .quick-stats { gap: .5rem; }
  .stat-pill { font-size: .65rem; padding: .35rem .7rem; }
  .score-number { font-size: 2.2rem; }
}
