:root {
  --brown:        #612B1E;
  --brown-dark:   #4A1F14;
  --cream:        #EFE4B0;
  --cream-tint:   #F8F4E3;
  --gold:         #C49A3C;
  --gold-light:   #FBF5E0;
  --text:         #1a1a1a;
  --muted:        #6b7280;
  --border:       #e5e7eb;
  --bg:           #FDFBF5;
  --white:        #ffffff;
  --danger:       #c0392b;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── NAVBAR ─────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.navbar-logo-img {
  height: 62px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-link:hover { background: var(--cream); color: var(--brown); }
.nav-link.active { background: var(--brown); color: var(--white); }
.nav-link.outline {
  border: 1.5px solid var(--brown);
  color: var(--brown);
}
.nav-link.outline:hover { background: var(--brown); color: var(--white); }
.nav-link.outline.active { background: var(--brown); color: var(--white); border-color: var(--brown); }

/* ── BOTTOM NAV ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  background: rgba(20,20,20,0.85);
  padding: 7px 10px;
  border-radius: 40px;
  z-index: 999;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.bottom-tab {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.bottom-tab:hover { color: white; }
.bottom-tab.active { background: var(--brown); color: white; }

/* ── HERO (index.html) ──────────────────────────────────── */
.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 48px 72px;
  gap: 40px;
  overflow: hidden;
}

.hero-left { max-width: 520px; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brown);
  background: var(--cream);
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 22px;
}
.hero-eyebrow::before { content: '✦'; font-size: 0.6rem; }

.hero-heading {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1.1;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.hero-heading em {
  font-style: normal;
  color: var(--brown);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 36px;
  max-width: 420px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--brown);
  color: white;
  border: 2px solid var(--brown);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-hero:hover { background: var(--brown-dark); border-color: var(--brown-dark); transform: translateY(-1px); }

.btn-hero-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: transparent;
  color: var(--brown);
  border: 2px solid var(--brown);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}
.btn-hero-outline:hover { background: var(--brown); color: white; transform: translateY(-1px); }

.hero-explore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.hero-explore:hover { color: var(--brown); }
.hero-explore::after { content: '→'; }

.hero-badges {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.badge-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}
.badge-icon {
  width: 28px;
  height: 28px;
  background: var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Diamond grid */
.hero-right {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 480px;
}
.diamond-grid {
  display: grid;
  grid-template-columns: repeat(3, 120px);
  grid-template-rows: repeat(3, 120px);
  gap: 12px;
  transform: rotate(45deg);
}
.diamond {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  overflow: hidden;
}
.diamond-inner {
  width: 100%;
  height: 100%;
  transform: rotate(-45deg) scale(1.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
}
.d1 .diamond-inner { background: linear-gradient(135deg, #8B4513, #612B1E); }
.d2 .diamond-inner { background: linear-gradient(135deg, #F0E68C, #C49A3C); }
.d3 .diamond-inner { background: linear-gradient(135deg, #F5DEB3, #EFE4B0); }
.d4 .diamond-inner { background: linear-gradient(135deg, #D2B48C, #C49A3C); }
.d5 .diamond-inner { background: linear-gradient(135deg, #EFE4B0, #F8F4E3); }
.d6 .diamond-inner { background: linear-gradient(135deg, #DEB887, #C49A3C); }
.d7 .diamond-inner { background: linear-gradient(135deg, #F4A460, #8B4513); }
.d8 .diamond-inner { background: linear-gradient(135deg, #FFE4B5, #C49A3C); }
.d9 .diamond-inner { background: linear-gradient(135deg, #FAEBD7, #EFE4B0); }
.diamond-empty { opacity: 0; pointer-events: none; }

/* ── VERIFY / TRACK PRODUCT PAGE ───────────────────────── */
.verify-page {
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 80px;
  background: linear-gradient(160deg, var(--cream-tint) 0%, var(--white) 60%);
}

.verify-card {
  background: var(--white);
  border-radius: 16px;
  padding: 44px 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
}

.verify-card h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.verify-card .sub {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 28px;
}

.field-group { margin-bottom: 6px; }
.field-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #374151;
  margin-bottom: 7px;
}
.field-group input[type="text"],
.field-group input[type="email"],
.field-group input[type="tel"] {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  letter-spacing: 0;
  outline: none;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field-group input[type="text"] {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.field-group input[type="text"]:focus,
.field-group input[type="email"]:focus,
.field-group input[type="tel"]:focus {
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(97,43,30,0.1);
}
.field-group input::placeholder { color: #bbb; text-transform: none; letter-spacing: 0; }

.field-group select {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  color: var(--text);
  background: var(--white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field-group select:focus {
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(97,43,30,0.1);
}

.field-required { color: var(--danger); margin-left: 2px; }

/* Honeypot — off-screen, not display:none so bots don't skip it */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.field-error {
  display: none;
  position: relative;
  margin-top: 6px;
  padding: 6px 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid #fecaca;
}
.field-error::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 14px;
  width: 8px;
  height: 8px;
  background: #fef2f2;
  border-top: 1px solid #fecaca;
  border-left: 1px solid #fecaca;
  transform: rotate(45deg);
}
.field-error.visible { display: block; }

.error-msg {
  color: var(--danger);
  font-size: 0.83rem;
  margin-top: 7px;
  display: none;
}
.error-msg.visible { display: block; }

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--brown);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
  letter-spacing: 0.02em;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--brown-dark); }
.btn-primary:disabled { background: #aaa; cursor: not-allowed; }

/* Result content inside verify.html */
#content { padding-top: 4px; }

#product-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
#rid-display {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 18px 0 8px;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--white);
  transition: border-color 0.15s, background 0.15s;
}
.doc-item:hover { border-color: var(--brown); background: var(--cream-tint); }

.doc-view-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}
.doc-icon { font-size: 1.4rem; flex-shrink: 0; }
.doc-info { min-width: 0; }
.doc-info .doc-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-info .doc-meta { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

.badge-valid {
  background: var(--cream);
  color: var(--brown);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  flex-shrink: 0;
}
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--brown);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-download:hover { background: var(--brown-dark); }

.btn-view {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--cream);
  color: var(--brown);
  border: 1.5px solid var(--brown);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-view:hover { background: var(--brown); color: white; }

.not-found { text-align: center; padding: 20px 0; color: var(--muted); }
.not-found a { color: var(--brown); }

.btn-go-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--brown);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 20px;
  transition: opacity 0.15s;
}

/* ── MANUFACTURER PAGE ─────────────────────────────────── */
.mfr-page {
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 80px;
  background: linear-gradient(160deg, var(--cream-tint) 0%, var(--white) 60%);
}

.mfr-page-header {
  text-align: center;
  margin-bottom: 28px;
  max-width: 440px;
  width: 100%;
  padding: 0 16px;
}
.mfr-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-light);
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.mfr-page-header h2 {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.mfr-page-header p { font-size: 0.92rem; color: var(--muted); line-height: 1.55; }

.mfr-card {
  background: var(--white);
  border-radius: 16px;
  padding: 36px 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
}

#result-card {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
  margin-top: 16px;
}

.mfr-result-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.mfr-logo-box {
  width: 52px;
  height: 52px;
  background: var(--cream);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
}
.mfr-logo-box img { width: 100%; height: 100%; object-fit: contain; }

.mfr-field {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.mfr-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  min-width: 130px;
  padding-top: 2px;
}
.mfr-value { font-size: 0.9rem; color: var(--text); line-height: 1.4; }

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: var(--brown); color: var(--brown); }

/* ── RID HELP LINK & MODAL ──────────────────────────────── */
.rid-help-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 0;
  background: none;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}
.rid-help-link:hover { color: var(--brown); }

.rid-help-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.rid-help-modal.open { display: flex; }

.rid-help-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.rid-help-container {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: 14px;
  overflow: hidden;
  width: calc(100vw - 40px);
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.rid-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.rid-help-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.rid-help-body {
  padding: 20px;
  text-align: center;
}
.rid-help-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* ── PDF PREVIEW MODAL ──────────────────────────────────── */
.pdf-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.pdf-modal.open { display: flex; }

.pdf-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pdf-modal-container {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: calc(100vw - 40px);
  max-width: 860px;
  height: calc(100vh - 72px);
  max-height: 900px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}
.pdf-modal-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.pdf-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.pdf-modal-close {
  width: 32px;
  height: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.pdf-modal-close:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

.pdf-modal-body {
  flex: 1;
  overflow: hidden;
  background: #525659;
}
.pdf-modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 36px 24px 48px;
    min-height: auto;
    gap: 0;
  }
  .hero-right {
    display: flex;
    height: 300px;
    margin-top: 40px;
  }
  .diamond-grid {
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(3, 80px);
    gap: 8px;
  }
  .diamond { width: 80px; height: 80px; }
  .diamond-inner { font-size: 1.6rem; }
  .navbar { padding: 0 16px; }
  .navbar-name span { display: none; }
  .navbar-links { display: none; }
  .verify-card { padding: 32px 24px; }
  .mfr-card, #result-card { padding: 28px 20px; }
}

@media (max-width: 480px) {
  .hero-heading { font-size: 2.2rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn-hero, .btn-hero-outline { justify-content: center; }
  .bottom-tab { padding: 7px 12px; font-size: 0.75rem; }
}

/* Tom Select — match existing select styling */
.ts-wrapper .ts-control {
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text, #1a1a1a);
  background: #fff;
  box-shadow: none;
  cursor: pointer;
}
.ts-wrapper.single .ts-control:after { border-top-color: var(--text, #1a1a1a); }
.ts-wrapper.focus .ts-control,
.ts-wrapper .ts-control:focus-within { border-color: #7c3e1e; outline: none; box-shadow: 0 0 0 3px rgba(124,62,30,0.12); }
.ts-dropdown { border: 1.5px solid var(--border, #e2e8f0); border-radius: 8px; font-size: 0.95rem; }
.ts-dropdown .ts-dropdown-content { max-height: 220px; }
.ts-dropdown .option.selected, .ts-dropdown .option:hover { background: #f5ede8; color: #7c3e1e; }
.ts-dropdown .option.active { background: #7c3e1e; color: #fff; }
.ts-wrapper.ts-error .ts-control { border-color: #f87171 !important; }
