/* PupFit — Dog Harness & Crate Measurement Guide */
:root {
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-800: #92400e;
  --amber-900: #78350f;
  --indigo-50: #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-200: #c7d2fe;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-800: #3730a3;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --green-100: #dcfce7;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --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;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-width: 1160px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--indigo-600); text-decoration: none; }
a:hover, a:focus-visible { color: var(--indigo-700); text-decoration: underline; }

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

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--gray-900);
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.logo:hover, .logo:focus-visible { text-decoration: none; color: var(--amber-700); }
.logo-icon { flex-shrink: 0; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}
.main-nav a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-600);
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.main-nav a:hover, .main-nav a:focus-visible {
  background: var(--amber-50);
  color: var(--amber-700);
  text-decoration: none;
}
.main-nav .nav-ext { color: var(--indigo-600); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  line-height: 1.3;
  text-decoration: none;
}
.btn:hover, .btn:focus-visible { text-decoration: none; }
.btn-primary {
  background: var(--amber-500);
  color: var(--amber-900);
  border-color: var(--amber-600);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--amber-400);
  box-shadow: 0 0 0 3px rgba(245,158,11,.25);
}
.btn-secondary {
  background: var(--indigo-50);
  color: var(--indigo-700);
  border-color: var(--indigo-200);
}
.btn-secondary:hover, .btn-secondary:focus-visible {
  background: var(--indigo-100);
  box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}
.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border-color: var(--gray-300);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  background: var(--gray-50);
  color: var(--gray-800);
}
.btn-lg { padding: 14px 28px; font-size: 1.0625rem; }
.btn-sm { padding: 6px 14px; font-size: .8125rem; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--amber-50) 0%, var(--indigo-50) 100%);
  padding: 60px 0 50px;
}
.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.hero h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  color: var(--gray-900);
  margin-bottom: 16px;
}
.hero-sub {
  font-size: 1.125rem;
  color: var(--gray-600);
  margin-bottom: 28px;
  max-width: 480px;
}
.hero-visual { display: flex; justify-content: center; }
.hero-illustration { max-width: 300px; width: 100%; height: auto; }

/* Sections */
section { padding: 60px 0; }
section h2 {
  font-size: 1.75rem;
  color: var(--gray-900);
  margin-bottom: 12px;
}
.section-desc {
  color: var(--gray-500);
  margin-bottom: 32px;
  max-width: 600px;
}

/* Guide cards */
.section-guide { background: var(--gray-50); }
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}
.guide-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}
.guide-icon { font-size: 2rem; margin-bottom: 12px; }
.guide-card h3 { font-size: 1.125rem; margin-bottom: 8px; color: var(--gray-900); }
.guide-card p { color: var(--gray-600); font-size: .9375rem; }

/* Measure section */
.section-measure { background: var(--white); }
.measure-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

/* Form */
.form-row {
  margin-bottom: 18px;
}
.form-row label {
  display: block;
  font-weight: 600;
  font-size: .875rem;
  color: var(--gray-700);
  margin-bottom: 4px;
}
.form-row input,
.form-row select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px rgba(245,158,11,.2);
}
.field-hint {
  display: block;
  font-size: .8125rem;
  color: var(--gray-500);
  margin-top: 4px;
}
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
fieldset { border: none; padding: 0; }
legend {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 20px;
}

/* Measurement diagram */
.measurement-diagram {
  margin-top: 32px;
  padding: 24px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}
.measurement-diagram h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--gray-800);
}
.diagram-svg { width: 100%; height: auto; max-width: 360px; display: block; margin: 0 auto 16px; }
.diagram-legend { font-size: .875rem; }
.diagram-legend dt { font-weight: 600; color: var(--gray-700); margin-top: 8px; }
.diagram-legend dd { color: var(--gray-500); margin-left: 0; }

/* Results panel */
.measure-results-panel {
  position: sticky;
  top: 80px;
}
.results-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.result-dog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.result-dog-header h3 { font-size: 1.25rem; color: var(--gray-900); }
.result-summary-badge {
  background: var(--amber-100);
  color: var(--amber-800);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .8125rem;
  font-weight: 600;
}
.result-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}
.result-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 20px;
}
.result-card h4 {
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  margin-bottom: 6px;
}
.result-main {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}
.result-detail {
  font-size: .875rem;
  color: var(--gray-600);
  margin-top: 4px;
}
.result-brand-notes {
  margin-top: 10px;
  font-size: .8125rem;
  color: var(--gray-600);
  padding-top: 10px;
  border-top: 1px dashed var(--gray-300);
}
.result-brand-notes strong { color: var(--gray-700); }

.result-fit-tips {
  background: var(--indigo-50);
  border: 1px solid var(--indigo-200);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}
.result-fit-tips h4 {
  font-size: .9375rem;
  color: var(--indigo-800);
  margin-bottom: 10px;
}
.result-fit-tips ul {
  padding-left: 20px;
}
.result-fit-tips li {
  font-size: .875rem;
  color: var(--indigo-700);
  margin-bottom: 6px;
}
.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Tips section */
.section-tips { background: var(--gray-50); }
.tips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}
.tip-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}
.tip-card h3 { font-size: 1rem; margin-bottom: 8px; color: var(--gray-900); }
.tip-card p { font-size: .875rem; color: var(--gray-600); }

/* Saved profiles */
.section-saved { background: var(--white); }
.saved-profiles { margin-top: 24px; }
.saved-empty { color: var(--gray-500); font-style: italic; }
.saved-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}
.saved-card-info h4 { font-size: 1rem; color: var(--gray-900); }
.saved-card-info p { font-size: .8125rem; color: var(--gray-500); }
.saved-card-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* FAQ */
.section-faq { background: var(--gray-50); }
.faq-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-item summary {
  padding: 18px 24px;
  font-weight: 600;
  color: var(--gray-800);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--gray-400);
  transition: transform .2s;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p {
  padding: 0 24px 18px;
  color: var(--gray-600);
  font-size: .9375rem;
}

/* Footer */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 40px 0 24px;
}
.footer-inner { display: flex; flex-direction: column; gap: 20px; }
.footer-brand .logo-text { color: var(--white); font-size: 1.125rem; font-weight: 700; }
.footer-brand p { font-size: .875rem; margin-top: 4px; }
.footer-brand a { color: var(--amber-400); }
.footer-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-nav a { color: var(--gray-400); font-size: .875rem; }
.footer-nav a:hover, .footer-nav a:focus-visible { color: var(--white); }
.footer-copy { font-size: .8125rem; color: var(--gray-500); }

/* Print styles */
@media print {
  .site-header, .site-footer, .section-guide, .section-tips, .section-saved, .section-faq, .hero, .form-actions, .result-actions, .measurement-diagram, #results-empty { display: none !important; }
  .measure-layout { display: block; }
  .measure-results-panel { position: static; }
  #print-card { display: block !important; }
  #print-card[hidden] { display: block !important; }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--gray-900);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  z-index: 999;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-visual { order: -1; }
  .measure-layout { grid-template-columns: 1fr; }
  .measure-results-panel { position: static; }
  .guide-grid { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 1.75rem; }
  section { padding: 40px 0; }
  section h2 { font-size: 1.375rem; }
  .form-actions { flex-direction: column; }
  .result-actions { flex-direction: column; }
  .saved-card { flex-direction: column; align-items: flex-start; }
  .main-nav { gap: 2px; }
  .main-nav a { padding: 4px 8px; font-size: .8125rem; }
}

/* Focus visible */
*:focus-visible {
  outline: 2px solid var(--amber-500);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
