/* onlyonlytoxinfree.com */

:root {
  --green-dark: #1a472a;
  --green-mid: #2d6a4f;
  --green-accent: #52b788;
  --green-light: #b7e4c7;
  --green-pale: #f0faf4;
  --danger: #e63946;
  --warning: #f4a261;
  --caution: #ffd166;
  --white: #ffffff;
  --bg: #f8f9fa;
  --text: #212529;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.10);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--green-dark);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}

.nav-brand span { color: var(--green-accent); }

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 60%, var(--green-accent) 100%);
  color: var(--white);
  padding: 5rem 1.5rem 6rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-inner {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 100px;
  padding: 0.3rem 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  color: var(--green-light);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.hero h1 em { font-style: normal; color: var(--green-light); }

.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 2.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.scan-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--white);
  color: var(--green-dark);
  padding: 1rem 2.5rem;
  border-radius: 100px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: -0.01em;
}

.scan-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.scan-cta .icon {
  font-size: 1.3rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.hero-stat { text-align: center; }
.hero-stat .num { font-size: 1.8rem; font-weight: 800; color: var(--green-light); }
.hero-stat .lbl { font-size: 0.8rem; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── SCANNER MODAL ── */
#scan-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.scanner-box {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--green-dark);
  color: var(--white);
}

.scanner-header h3 { font-size: 1rem; font-weight: 600; }

#close-scanner {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

#camera-feed {
  width: 100%;
  display: block;
  background: #000;
  max-height: 350px;
  object-fit: cover;
}

.scan-overlay {
  position: relative;
}

.scan-crosshair {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-crosshair::before {
  content: '';
  width: 60%;
  height: 60%;
  border: 2px solid var(--green-accent);
  border-radius: 8px;
  box-shadow: 0 0 0 3000px rgba(0,0,0,0.35);
}

#scan-canvas { display: none; }

.scanner-status {
  padding: 0.75rem 1.25rem;
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 0.9rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.scanner-status::before { content: '⬤'; color: var(--green-accent); font-size: 0.6rem; animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.scanner-hint {
  padding: 0.75rem 1.25rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── RESULTS ── */
#results-section {
  display: none;
  max-width: 860px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.results-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

#product-image {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: none;
}

.product-info { flex: 1; }
#product-name { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.25rem; }
#product-brand { color: var(--text-muted); font-size: 0.95rem; }

#hazard-score {
  text-align: center;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  min-width: 100px;
  transition: background 0.3s;
}

#score-number { font-size: 2.5rem; font-weight: 900; color: var(--white); line-height: 1; }
#score-label { font-size: 0.75rem; color: rgba(255,255,255,0.9); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.25rem; }

.section-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.section-card h2 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--green-light);
}

#ingredient-list {
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--text);
}

/* toxin highlights in ingredient text */
mark.toxin-high {
  background: rgba(230, 57, 70, 0.2);
  color: var(--danger);
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 600;
  cursor: help;
  border-bottom: 2px solid var(--danger);
}

mark.toxin-medium {
  background: rgba(244, 162, 97, 0.2);
  color: #c07a42;
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 600;
  cursor: help;
  border-bottom: 2px solid var(--warning);
}

mark.toxin-low {
  background: rgba(255, 209, 102, 0.25);
  color: #9e7c00;
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 500;
  cursor: help;
  border-bottom: 2px solid var(--caution);
}

/* ── TOXIN CARDS ── */
#toxin-cards { display: flex; flex-direction: column; gap: 0.75rem; }

.toxin-card {
  border-radius: 10px;
  padding: 1rem 1.25rem;
  border-left: 4px solid;
}

.card-high { background: #fff5f5; border-color: var(--danger); }
.card-medium { background: #fffaf5; border-color: var(--warning); }
.card-low { background: #fffef0; border-color: var(--caution); }

.toxin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.toxin-name { font-weight: 700; font-size: 1rem; }
.hazard-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  text-transform: uppercase;
}

.card-high .hazard-badge { background: var(--danger); color: var(--white); }
.card-medium .hazard-badge { background: var(--warning); color: var(--white); }
.card-low .hazard-badge { background: var(--caution); color: #6d5200; }

.toxin-category { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.4rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.toxin-harm { font-size: 0.88rem; color: var(--text); margin-bottom: 0.4rem; }
.toxin-matched { font-size: 0.8rem; color: var(--text-muted); }

.clean-badge {
  background: var(--green-pale);
  border: 2px solid var(--green-accent);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  color: var(--green-dark);
  font-weight: 600;
  font-size: 1.1rem;
}

.clean-badge::before { content: '✓ '; color: var(--green-accent); }

/* ── AFFILIATES ── */
.affiliate-block h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--green-dark); }
.affiliate-block > p { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.9rem; }

.affiliate-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.aff-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.aff-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }

.aff-amazon { background: #fff3e0; border: 1px solid #ffe0b2; }
.aff-iherb { background: #f1f8f3; border: 1px solid #c8e6c9; }
.aff-thrive { background: #f3e5f5; border: 1px solid #e1bee7; }

.aff-icon { font-size: 1.5rem; }
.aff-label { font-weight: 700; color: var(--text); }
.aff-sub { font-size: 0.75rem; color: var(--text-muted); }

.affiliate-disclaimer { font-size: 0.75rem; color: var(--text-muted); font-style: italic; }

/* ── MANUAL INPUT ── */
.manual-section {
  max-width: 860px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.manual-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.manual-card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--green-dark); }
.manual-card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1rem; }

#manual-ingredient-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  margin-bottom: 0.75rem;
  outline: none;
  transition: border-color 0.2s;
}

#manual-ingredient-input:focus { border-color: var(--green-accent); }

#manual-check-btn {
  background: var(--green-dark);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#manual-check-btn:hover { background: var(--green-mid); }

/* ── HOW IT WORKS ── */
.how-section {
  background: var(--white);
  padding: 4rem 1.5rem;
  text-align: center;
}

.how-section h2 { font-size: 1.8rem; font-weight: 800; color: var(--green-dark); margin-bottom: 0.5rem; }
.how-section > p { color: var(--text-muted); margin-bottom: 3rem; }

.steps {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
}

.step {
  flex: 1;
  min-width: 180px;
  max-width: 220px;
  text-align: center;
}

.step-icon {
  width: 64px;
  height: 64px;
  background: var(--green-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1rem;
  border: 2px solid var(--green-light);
}

.step h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--green-dark); }
.step p { font-size: 0.85rem; color: var(--text-muted); }

/* ── TOXIC CHEMICALS GUIDE ── */
.guide-section {
  max-width: 900px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.guide-section h2 { font-size: 1.8rem; font-weight: 800; color: var(--green-dark); margin-bottom: 0.5rem; }
.guide-section > p { color: var(--text-muted); margin-bottom: 2rem; }

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.guide-card {
  background: var(--white);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border-top: 4px solid;
}

.guide-card.gc-high { border-color: var(--danger); }
.guide-card.gc-medium { border-color: var(--warning); }
.guide-card.gc-low { border-color: var(--caution); }

.guide-card h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.25rem; }
.guide-card .gc-cat { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.5rem; }
.guide-card p { font-size: 0.82rem; color: var(--text-muted); }

/* ── BLOG FEED ── */
.blog-section {
  background: var(--white);
  padding: 4rem 1.5rem;
}

.blog-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.blog-inner h2 { font-size: 1.8rem; font-weight: 800; color: var(--green-dark); margin-bottom: 0.5rem; }
.blog-inner > p { color: var(--text-muted); margin-bottom: 2rem; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--green-accent);
}

.blog-card-date { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.blog-card-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; line-height: 1.4; }
.blog-card-summary { font-size: 0.85rem; color: var(--text-muted); flex: 1; margin-bottom: 0.75rem; }
.blog-card-read { font-size: 0.82rem; font-weight: 600; color: var(--green-accent); }
.blog-loading { color: var(--text-muted); font-size: 0.9rem; padding: 2rem; text-align: center; grid-column: 1/-1; }

.blog-all-link {
  display: inline-block;
  color: var(--green-dark);
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 2px solid var(--green-accent);
  padding-bottom: 2px;
}

/* ── EMAIL CAPTURE ── */
.email-section {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  padding: 4rem 1.5rem;
  text-align: center;
}

.email-inner {
  max-width: 540px;
  margin: 0 auto;
}

.email-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.email-inner h2 { font-size: 1.8rem; font-weight: 800; color: var(--white); margin-bottom: 0.5rem; }
.email-inner > p { color: rgba(255,255,255,0.8); margin-bottom: 1.5rem; font-size: 0.95rem; }

.email-form {
  display: flex;
  gap: 0.5rem;
  max-width: 420px;
  margin: 0 auto 1rem;
}

.email-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  outline: none;
}

.email-form button {
  background: var(--green-accent);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.2s;
}

.email-form button:hover { background: #3d9c6b; }

.email-trust { font-size: 0.8rem; color: rgba(255,255,255,0.5); }

/* affiliate card additions */
.aff-grove { background: #e8f5e9; border: 1px solid #a5d6a7; }
.aff-force { background: #fff8e1; border: 1px solid #ffe082; }
.aff-bc { background: #fce4ec; border: 1px solid #f48fb1; }

@media (max-width: 600px) {
  .email-form { flex-direction: column; }
}

/* ── FOOTER ── */
footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.7);
  padding: 3rem 1.5rem 2rem;
  text-align: center;
}

.footer-brand { font-size: 1.2rem; font-weight: 800; color: var(--white); margin-bottom: 0.5rem; }
.footer-brand span { color: var(--green-accent); }
footer p { font-size: 0.85rem; max-width: 600px; margin: 0 auto 1.5rem; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { font-size: 0.85rem; color: rgba(255,255,255,0.6); transition: color 0.2s; }
.footer-links a:hover { color: var(--green-accent); }
.footer-bottom { margin-top: 2rem; font-size: 0.8rem; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .nav-links { display: none; }
  .results-header { flex-direction: column; }
  #hazard-score { align-self: flex-start; }
  .hero h1 { font-size: 2rem; }
  .hero-stats { gap: 2rem; }
}
