/* ─── GBP Audit Tool — Brand tokens ─── */
:root {
  --bg:        #0d1117;
  --surface:   #161b22;
  --border:    #30363d;
  --accent:    #58a6ff;
  --accent-dim:#1f3a5c;
  --text:      #e6edf3;
  --muted:     #8b949e;
  --good:      #3fb950;
  --warn:      #d29922;
  --bad:       #f85149;
  --radius:    8px;
}

/* ─── Reset & base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  padding: 24px 16px 48px;
}

/* ─── Layout container ─── */
.container {
  max-width: 680px;
  margin: 0 auto;
}

/* ─── Header ─── */
.header {
  text-align: center;
  margin-bottom: 32px;
}

.logo-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.tagline {
  font-family: 'Syne', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 8px;
}

.sub {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ─── Card ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

/* ─── Input mode tabs ─── */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 10px 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-btn:hover:not(.active) {
  color: var(--text);
}

/* ─── Input group ─── */
.input-row {
  display: grid;
  gap: 12px;
}

.input-row.two-col {
  grid-template-columns: 1fr 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.field input:focus {
  border-color: var(--accent);
}

.field input::placeholder {
  color: #484f58;
}

.hidden {
  display: none;
}

/* ─── CTA ─── */
.run-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 16px;
}

.run-btn:hover {
  background: #79b8ff;
}

.run-btn:active {
  transform: scale(0.98);
}

.run-btn:disabled {
  background: #1f3a5c;
  color: #484f58;
  cursor: not-allowed;
  transform: none;
}

/* ─── Loading dots ─── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 40px;
}

.dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ─── Results ─── */
.results-section {
  display: none;
}

.results-visible .results-section {
  display: block;
}

.results-visible .loading {
  display: none;
}

/* ─── Section label ─── */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ─── Completeness score ─── */
.score-wrap {
  display: flex;
  align-items: center;
  gap: 40px;
}

.progress-ring-wrap {
  flex-shrink: 0;
  position: relative;
  width: 120px;
  height: 120px;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 10;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.progress-pct {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.progress-sub {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
}

.score-meta {
  flex: 1;
}

.score-grade {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}

.grade-a { color: var(--good); }
.grade-b { color: #56d364; }
.grade-c { color: var(--warn); }
.grade-d { color: #e3b341; }
.grade-f { color: var(--bad); }

.score-summary {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ─── Review stars ─── */
.review-stars {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.stars-display {
  display: flex;
  gap: 2px;
}

.star {
  width: 20px;
  height: 20px;
}

.star-full { color: #f5c518; }
.star-empty { color: var(--border); }

.star-rating-num {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.review-count {
  font-size: 0.875rem;
  color: var(--muted);
}

.review-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
}

.review-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.bar-label {
  width: 14px;
  text-align: right;
  color: var(--muted);
}

.bar-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: #f5c518;
  border-radius: 3px;
  transition: width 0.8s ease;
}

/* ─── Citation block ─── */
.citation-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-good  { background: var(--good); }
.dot-warn  { background: var(--warn); }
.dot-bad   { background: var(--bad); }

.nap-consistency {
  margin-bottom: 16px;
}

.nap-consistency h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.nap-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nap-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.nap-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.directories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.dir-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

.dir-check {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--good);
}

/* ─── Gaps checklist ─── */
.gaps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gaps-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.15s;
}

.gaps-list li.resolved {
  border-color: var(--good);
}

.gap-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.gap-text {
  flex: 1;
  line-height: 1.4;
}

.gap-detail {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ─── Business name display ─── */
.business-strip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 20px;
}

.business-strip-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.business-strip h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
}

.business-strip p {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ─── Hidden (JS toggled) ─── */
.hidden { display: none !important; }

/* ─── Estimate note ─── */
.estimate-note {
  font-size: 0.75rem;
  color: #484f58;
  margin-top: 12px;
  line-height: 1.4;
}

.estimate-badge {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  margin-top: 8px;
}

/* ─── Loading label ─── */
.loading-label {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  padding-bottom: 16px;
}

/* ─── Error state ─── */
.error-msg {
  color: var(--bad);
  font-size: 0.9rem;
  text-align: center;
  padding: 16px 0 0;
}

/* ─── Dimension cards ─── */
.dimensions-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dim-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
}

.dim-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.dim-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.dim-score {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.dim-max {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 400;
}

.dim-good { color: var(--good); }
.dim-warn { color: var(--warn); }
.dim-bad  { color: var(--bad); }

.dim-bar-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.dim-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}

.dim-bar-fill.dim-good { background: var(--good); }
.dim-bar-fill.dim-warn { background: var(--warn); }
.dim-bar-fill.dim-bad  { background: var(--bad); }

.dim-reason {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ─── Recommendations ─── */
.recs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rec-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
}

.rec-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.rec-rank {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}

.rec-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.rec-impact {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.impact-high { background: #2d1f1f; color: var(--bad); border: 1px solid #5a2020; }
.impact-med  { background: #2d2208; color: var(--warn); border: 1px solid #5a4010; }
.impact-low  { background: #1f2d1f; color: var(--good); border: 1px solid #205a20; }

.rec-detail {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ─── CTA block ─── */
.cta-block {
  margin-top: 32px;
  background: linear-gradient(135deg, #1a2744 0%, #1f3a5c 100%);
  border: 1px solid var(--accent-dim);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
}

.cta-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.cta-sub {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.cta-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 6px;
  transition: background 0.15s, transform 0.1s;
}

.cta-btn:hover {
  background: #79b8ff;
  transform: translateY(-1px);
}

.logo-home {
  display: flex;
  text-decoration: none;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  body { padding: 16px 12px 40px; }
  .card { padding: 18px 16px; }
  .score-wrap { flex-direction: column; align-items: flex-start; gap: 20px; }
  .progress-ring-wrap { width: 100px; height: 100px; }
  .progress-pct { font-size: 1.3rem; }
  .input-row.two-col { grid-template-columns: 1fr; }
  .tagline { font-size: 1.4rem; }
}

@media (min-width: 640px) {
  .score-wrap { gap: 60px; }
}

/* ─── Email confirmation banner ─── */
.email-confirm {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0d2818;
  border: 1px solid #166534;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  color: #86efac;
  font-size: 13px;
  font-weight: 500;
}
.email-confirm-icon {
  font-size: 16px;
  flex-shrink: 0;
}
