/* ═══════════════════════════════════════════════════
   BrandBridge — AI-Ready Certification
   Design: Clean, minimal, professional
   Colors: #6366f1 / #10b981 / #ef4444 / #f59e0b
   ═══════════════════════════════════════════════════ */

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

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --max-width: 768px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  color: var(--gray-900);
  background: #fff;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* ── Layout ── */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */

.site-header {
  padding: 20px 0;
  border-bottom: 1px solid var(--gray-100);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 640px) {
  .logo {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 1rem;
  }
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--gray-600);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-cta {
  background: var(--primary);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.nav-cta:hover {
  background: var(--primary-hover);
}

/* ── Hero ── */

.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 28px;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--gray-900);
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 16px;
  }
}

.hero-title span {
  color: var(--primary);
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--gray-500);
  max-width: 540px;
  margin: 0 auto 48px;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .hero-subtitle {
    font-size: 0.9375rem;
    margin: 0 auto 36px;
  }
}

/* ── Scanner ── */

.scanner {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 560px;
  margin: 0 auto;
}

.scanner-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.scanner-input-group {
  display: flex;
  gap: 10px;
}

.scanner-input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--gray-900);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.scanner-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.scanner-input::placeholder {
  color: var(--gray-400);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.0625rem;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.trust-signals {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  font-size: 0.8125rem;
  color: var(--gray-400);
}

.trust-signal {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trust-signal svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── Error / Status ── */

.scanner-error {
  background: var(--danger-light);
  color: var(--danger);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-top: 12px;
  display: none;
}

.scanner-error.visible {
  display: block;
}

.scanner-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--gray-500);
  font-size: 0.9375rem;
}

.scanner-loading.visible {
  display: flex;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Case Study Teaser ── */

.case-study-teaser {
  margin-top: 64px;
  padding: 32px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  text-align: center;
}

.case-study-teaser .label {
  display: inline-block;
  background: var(--success-light);
  color: var(--success);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.case-study-teaser h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.case-study-teaser p {
  color: var(--gray-500);
  font-size: 0.9375rem;
  margin-bottom: 16px;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
}

.score-pill .arrow {
  color: var(--success);
}

/* ── How It Works ── */

.how-it-works {
  padding: 80px 0;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 48px;
  letter-spacing: -0.01em;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.step {
  text-align: center;
}

.step-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.25rem;
  font-weight: 700;
}

.step h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.step p {
  font-size: 0.875rem;
  color: var(--gray-500);
  line-height: 1.6;
}

/* ── Footer ── */

.site-footer {
  border-top: 1px solid var(--gray-100);
  padding: 32px 0;
  text-align: center;
}

.site-footer p {
  color: var(--gray-400);
  font-size: 0.8125rem;
}

.site-footer a {
  color: var(--gray-500);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--primary);
}

/* ═══════════════════════════════════════════════════
   Results Page
   ═══════════════════════════════════════════════════ */

.results-hero {
  padding: 60px 0 40px;
  text-align: center;
}

.results-meta {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 32px;
}

.results-meta a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

/* Score Circle */

.score-circle-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.score-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.score-circle::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(
    var(--circle-color) calc(var(--score) * 3.6deg),
    var(--gray-100) calc(var(--score) * 3.6deg)
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #fff calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #fff calc(100% - 6px));
}

.score-circle .score-number {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

.score-circle .score-label {
  font-size: 0.8125rem;
  color: var(--gray-500);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.score-color-good { --circle-color: var(--success); color: var(--success); }
.score-color-ok { --circle-color: var(--warning); color: var(--warning); }
.score-color-bad { --circle-color: var(--danger); color: var(--danger); }

/* Badge */

.badge-tier {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 40px;
}

.badge-gold {
  background: #fef3c7;
  color: #b45309;
  border: 2px solid #fcd34d;
}

.badge-silver {
  background: #f1f5f9;
  color: #475569;
  border: 2px solid #cbd5e1;
}

.badge-bronze {
  background: #fff7ed;
  color: #c2410c;
  border: 2px solid #fdba74;
}

/* Checklist */

.checklist-section {
  padding: 0 0 60px;
}

.checklist-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
}

.checklist {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.checklist-item:hover {
  background: var(--gray-50);
}

.checklist-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.875rem;
}

.checklist-icon.pass {
  background: var(--success-light);
  color: var(--success);
}

.checklist-icon.fail {
  background: var(--danger-light);
  color: var(--danger);
}

.checklist-text {
  flex: 1;
}

.checklist-text .factor-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.checklist-text .factor-detail {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.checklist-score {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* CTA Section */

.cta-section {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: 48px 0;
  text-align: center;
}

.cta-section h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.cta-section p {
  color: var(--gray-500);
  margin-bottom: 24px;
  font-size: 1rem;
}

.cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Email Capture Section */

.email-capture-section {
  background: var(--primary-light);
  padding: 48px 0;
  text-align: center;
  border-bottom: 1px solid var(--gray-200);
}

.email-capture-section h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--gray-900);
}

.email-capture-section p {
  color: var(--gray-500);
  font-size: 1rem;
  margin-bottom: 24px;
}

.email-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 480px;
  margin: 0 auto 12px;
}

.email-form input[type="email"] {
  flex: 1;
  min-width: 240px;
  padding: 14px 18px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--gray-900);
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.email-form input[type="email"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.email-form input[type="email"]::placeholder {
  color: var(--gray-400);
}

.email-privacy {
  font-size: 0.8125rem;
  color: var(--primary) !important;
  opacity: 0.75;
}

.email-success {
  display: none;
  margin-top: 8px;
}

.email-success.visible {
  display: block;
}

.email-success-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.email-success-text {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.email-success-sub {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* Scan Again */

.scan-again {
  text-align: center;
  padding: 32px 0 60px;
}

.scan-again p {
  font-size: 0.9375rem;
  color: var(--gray-500);
}

.scan-again a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.scan-again a:hover {
  text-decoration: underline;
}

/* Placeholder state */

.placeholder-state {
  padding: 80px 0;
  text-align: center;
}

.placeholder-state .icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.placeholder-state h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.placeholder-state p {
  color: var(--gray-500);
  margin-bottom: 32px;
}

/* ═══════════════════════════════════════════════════
   Case Study Page
   ═══════════════════════════════════════════════════ */

.case-study-hero {
  padding: 60px 0 40px;
  text-align: center;
}

.case-study-hero .kicker {
  color: var(--gray-400);
}

.case-study-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.case-study-hero .subtitle {
  font-size: 1.0625rem;
  color: var(--gray-500);
  max-width: 500px;
  margin: 0 auto;
}

.case-study-body {
  padding: 0 0 60px;
  max-width: 640px;
  margin: 0 auto;
}

.case-study-body h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 48px 0 12px;
}

.case-study-body p {
  color: var(--gray-600);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.case-study-body ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.case-study-body li {
  color: var(--gray-600);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 6px;
}

.score-comparison {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 32px;
  margin: 32px 0;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

.score-before, .score-after {
  text-align: center;
}

.score-before .number, .score-after .number {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.score-before .number { color: var(--danger); }
.score-after .number { color: var(--success); }

.score-before .label, .score-after .label {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-top: 4px;
  font-weight: 500;
}

.score-arrow {
  font-size: 2rem;
  color: var(--success);
}

.external-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  margin-top: 8px;
}

.external-link:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════
   API Page
   ═══════════════════════════════════════════════════ */

.api-hero {
  padding: 60px 0 20px;
  text-align: center;
}

.api-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.api-hero p {
  color: var(--gray-500);
  font-size: 1rem;
}

.api-section {
  padding: 0 0 60px;
  max-width: 640px;
  margin: 0 auto;
}

.api-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 40px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-100);
}

.api-endpoint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.api-endpoint .method {
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
}

code, pre {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

pre {
  background: var(--gray-800);
  color: #e5e7eb;
  padding: 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

pre code {
  background: none;
  padding: 0;
}

.api-section .note {
  background: var(--primary-light);
  color: var(--primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-top: 16px;
}

/* ═══════════════════════════════════════════════════
   Kicker (page label above heading)
   ═══════════════════════════════════════════════════ */

.kicker {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .hero-title { font-size: 1.75rem; line-height: 1.2; margin-bottom: 12px; }
  .hero-subtitle { font-size: 0.9375rem; }
  .scanner-input-group { flex-direction: column; }
  .scanner { padding: 24px; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .hero { padding: 80px 0 60px; }

@media (max-width: 640px) {
  .hero { padding: 60px 0 48px; }
}
  .trust-signals { flex-direction: column; align-items: center; gap: 8px; }
  
  /* Mobile header — logo 1 row, nav below */
  .site-header { padding: 14px 0; }
  .site-header .container { flex-direction: column !important; gap: 12px; padding: 0 20px; align-items: center; }
  .logo { font-size: 1.25rem; flex-shrink: 0; flex-direction: row; align-items: center; }
  .logo-icon { width: 28px; height: 28px; font-size: 0.75rem; border-radius: 6px; }
  .nav-links { gap: 14px; flex-wrap: nowrap; justify-content: center; width: 100%; }
  .nav-links a { font-size: 0.8125rem; padding: 4px 0; }
  .nav-cta { padding: 6px 12px; font-size: 0.8125rem !important; }
  
  .case-study-hero h1 { font-size: 1.75rem; }
  .score-comparison { flex-direction: column; gap: 16px; }
  .cta-actions { flex-direction: column; align-items: stretch; }
  .cta-actions .btn { width: 100%; }
  .checklist { max-width: 100%; }
  .container { padding: 0 24px; }
  
  /* Edge-to-edge fix: ALL sections get wider padding on mobile */
  section, main, footer, .hero, .how-it-works, .case-study-teaser, .case-study-hero, .case-study-body, .api-hero, .api-section, .results-hero, .checklist-section, .cta-section, .email-capture-section, .scan-again, .placeholder-state {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  
  /* Fix .container inside sections so they don't double-pad */
  section .container, .hero .container, .how-it-works .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  .scanner { margin-left: 0; margin-right: 0; }
  
  /* Badge page CTA buttons */
  .container > div[style*="flex"] .btn {
    width: 100%;
    margin-bottom: 8px;
  }
  
  /* Email form stacking */
  .email-form { flex-direction: column; }
  .email-form input[type="email"] { min-width: unset; width: 100%; }
  .email-form .btn { width: 100%; }
}
