:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #64748b;
  --line: #e5e9f0;
  --line-strong: #cbd5e1;

  /* Brand colors — pulled from the JBM logo (deep blue + vivid orange) */
  --brand: #1d4ed8;
  --brand-2: #2563eb;
  --brand-soft: #eff4ff;

  --accent: #f26722;         /* orange from logo */
  --accent-2: #ff8a3d;
  --accent-soft: #fff1e6;
  --accent-deep: #c9531a;

  --gold: #f5b301;
  --gold-soft: #fff6d6;
  --success: #059669;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 8px 24px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 45px rgba(15,23,42,.12);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
button { font-family: inherit; }

/* ---------- QR / Landing page ---------- */
.qr-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg);
}
.qr-card {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 40px 32px 32px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
/* Logo on the QR/landing card — clean, no placeholder box */
.qr-logo {
  width: 180px;
  height: auto;
  max-height: 110px;
  object-fit: contain;
  display: block;
  margin: 0 auto 20px;
  /* No background, no border, no padding — just the logo */
}

/* Prominent brand header — logo sits OUTSIDE and above the card */
.brand-header {
  text-align: center;
  margin: 0 auto 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.brand-logo-hero {
  width: 150px;
  height: 150px;
  object-fit: contain;
  background: #fff;
  padding: 16px;
  border-radius: 24px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15,23,42,0.06);
  border: 1px solid var(--line);
}
.brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-tag {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.qr-card h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 10px;
}
.qr-card .sub {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
  max-width: 380px;
  margin: 0 auto 24px;
}
.qr-wrap {
  display: inline-block;
  padding: 18px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}
#qrcode img, #qrcode canvas { display: block; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 13px 24px;
  border: none;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: 0 8px 18px rgba(242, 103, 34, 0.3);
}
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; background: var(--accent); }

.steps {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
}
.step span {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.footer {
  margin-top: 26px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Review page ---------- */
body:has(.review-page) {
  background: var(--bg);
}
.review-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
.rating-logo {
  display: block;
  width: 180px;
  height: auto;
  max-height: 110px;
  object-fit: contain;
  margin: 0 auto 18px;
  /* No background, no border, no padding — logo shows clean */
}
.site-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}
.header-logo {
  width: 46px; height: 46px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 4px;
}
.header-text h2 {
  font-size: 17px;
  font-weight: 700;
}
.header-text span {
  color: var(--muted);
  font-size: 13px;
}

.rating-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 28px;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 26px;
}
.rating-card h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 10px;
}
.rating-card .sub {
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 460px;
  margin: 0 auto 22px;
  line-height: 1.55;
}
.stars {
  display: inline-flex;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fafbfd;
  border: 1px solid var(--line);
}
.star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 40px;
  line-height: 1;
  color: #cbd5e1;
  padding: 4px 6px;
  transition: transform .12s ease, color .12s ease;
}
.star:hover { transform: scale(1.08); }
.star.active { color: var(--accent); text-shadow: 0 4px 12px rgba(242,103,34,.4); }
.rating-label {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  min-height: 20px;
}

/* Reviews section */
.reviews-section { margin-top: 4px; }
.reviews-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.reviews-header h2 {
  font-size: 20px;
  font-weight: 700;
}
.reviews-header .sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn-ghost:hover { background: #f8fafc; border-color: #94a3b8; }
.btn-ghost:disabled { opacity: .5; cursor: not-allowed; }

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.review-card {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--line-strong); /* permanent outline as requested */
  border-radius: var(--radius);
  padding: 18px 16px 14px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.review-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(242,103,34,.18);
  transform: translateY(-2px);
}
.review-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(242,103,34,.18), 0 8px 22px rgba(242,103,34,.18);
}
.review-card .badge {
  position: absolute;
  top: -10px;
  left: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  letter-spacing: .02em;
  box-shadow: 0 3px 8px rgba(242,103,34,.28);
}
.review-card .body {
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 8px 0 12px;
  flex-grow: 1;
  white-space: pre-wrap;
}
.review-card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.lang-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(29,78,216,0.15);
}
.lang-tag.hinglish {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: rgba(242,103,34,0.25);
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.copy-btn:hover { background: #f1f5f9; color: var(--ink); }
.copy-btn.done { background: #ecfdf5; border-color: #a7f3d0; color: var(--success); }

/* Skeleton loader cards */
.review-card.skeleton {
  cursor: default;
  overflow: hidden;
  position: relative;
}
.review-card.skeleton:hover { transform: none; border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, #eef2f7 0%, #e2e8f0 50%, #eef2f7 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 6px;
  margin: 8px 0;
}
.skeleton-line.short { width: 60%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Post bar */
.post-bar {
  position: sticky;
  bottom: 16px;
  margin-top: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-lg);
}
.post-info {
  font-size: 14px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}
.post-info strong { color: var(--ink); margin-right: 6px; }

/* Ensure [hidden] wins over display rules */
[hidden] { display: none !important; }

/* Loader */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.spinner {
  width: 22px; height: 22px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 9999;
  max-width: 90vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 36px;
}

/* Responsive */
@media (max-width: 600px) {
  .qr-card { padding: 30px 22px 24px; }
  .qr-card h1 { font-size: 24px; }
  .rating-card { padding: 26px 18px; }
  .rating-card h1 { font-size: 22px; }
  .star { font-size: 34px; }
  .post-bar { flex-direction: column; align-items: stretch; }
  .post-info { max-width: 100%; }
  .btn-primary { width: 100%; }
  .reviews-grid { grid-template-columns: 1fr; }
}
