:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f3f4f6;
  --accent: #111827;
  --success: #166534;
  --warning: #92400e;
  --radius: 24px;
  --shadow: 0 16px 40px rgba(17, 24, 39, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; background: var(--accent); color: white;
  font-size: 22px; font-weight: 800;
}
.brand-name { font-weight: 800; line-height: 1.1; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.header-actions { display: flex; gap: 8px; }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 32px auto 110px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 36px;
  padding: 40px;
  align-items: center;
}
.hero-copy h1 { font-size: clamp(38px, 6vw, 74px); line-height: .95; margin: 10px 0 18px; letter-spacing: -0.05em; }
.hero-copy p { font-size: 18px; line-height: 1.6; max-width: 560px; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 800; color: var(--muted); }
.trial-line { display: inline-flex; padding: 9px 12px; border-radius: 999px; background: var(--soft); font-size: 13px; font-weight: 700; margin-top: 10px; }

.item-form { display: grid; gap: 16px; }
.upload-zone {
  min-height: 250px; border: 2px dashed #cbd5e1; border-radius: 22px;
  background: #fafafa; display: grid; place-items: center; overflow: hidden; cursor: pointer;
  transition: .2s ease;
}
.upload-zone:hover { border-color: #6b7280; transform: translateY(-1px); }
.upload-zone img { width: 100%; height: 250px; object-fit: cover; }
.upload-prompt { text-align: center; color: var(--muted); display: grid; gap: 8px; }
.upload-prompt strong { color: var(--text); font-size: 16px; }
.upload-icon { margin: auto; width: 54px; height: 54px; border-radius: 18px; background: var(--text); color: white; display: grid; place-items: center; font-size: 28px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 8px; }
.field > span { font-size: 13px; font-weight: 700; }
.field input {
  width: 100%; min-height: 52px; border-radius: 14px; border: 1px solid var(--line); padding: 0 14px;
  outline: none; background: white; color: var(--text);
}
.field input:focus { border-color: #9ca3af; box-shadow: 0 0 0 4px rgba(17,24,39,.05); }
.money-input { position: relative; }
.money-input input { padding-right: 42px; }
.money-input span { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }

.primary-btn, .secondary-btn, .ghost-btn {
  border: 0; border-radius: 14px; font-weight: 800; transition: .18s ease;
}
.primary-btn { background: var(--accent); color: white; padding: 14px 18px; }
.primary-btn:hover { transform: translateY(-1px); opacity: .92; }
.secondary-btn { background: var(--soft); color: var(--text); padding: 11px 14px; }
.ghost-btn { background: transparent; color: var(--text); border: 1px solid var(--line); padding: 10px 12px; }
.large { min-height: 54px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 999px; padding: 0 7px; background: var(--soft); font-size: 11px; margin-left: 5px; }

.results-section { margin-top: 28px; }
.results-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 14px; }
.results-head h2 { margin: 6px 0 4px; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.035em; }
.muted { color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: white; border-radius: 999px; padding: 9px 13px; font-size: 13px; font-weight: 700; }
.chip.active { background: var(--text); color: white; border-color: var(--text); }
.result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.result-card { background: white; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; transition: .18s ease; display: flex; flex-direction: column; }
.result-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.result-media { aspect-ratio: 4/3; position: relative; display: grid; place-items: center; font-size: 56px; background: linear-gradient(135deg, #f3f4f6, #ffffff); }
.match-pill { position: absolute; top: 10px; left: 10px; padding: 7px 9px; border-radius: 999px; background: rgba(17,24,39,.88); color: white; font-size: 11px; font-weight: 800; }
.result-body { padding: 14px; display: grid; gap: 10px; flex: 1; }
.result-name { font-weight: 800; font-size: 16px; line-height: 1.3; }
.result-price { font-size: 18px; font-weight: 900; }
.diff { font-size: 12px; font-weight: 700; color: var(--muted); }
.diff.good { color: var(--success); }
.result-actions { display: flex; gap: 8px; margin-top: auto; }
.result-actions button { flex: 1; }

.modal { border: 0; padding: 0; background: transparent; width: min(520px, calc(100% - 28px)); }
.modal.wide { width: min(720px, calc(100% - 28px)); }
.modal::backdrop { background: rgba(17,24,39,.45); backdrop-filter: blur(6px); }
.modal-card { position: relative; background: white; border-radius: 24px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.modal-card h3 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
.modal-close { position: absolute; top: 14px; right: 14px; border: 0; background: var(--soft); width: 36px; height: 36px; border-radius: 50%; font-size: 22px; }
.modal-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--text); color: white; font-size: 24px; font-weight: 900; }
.tiny-note { margin: 0; font-size: 12px; color: var(--muted); }
.modal-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.inventory-list { display: grid; gap: 10px; }
.inventory-item { display: flex; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; }
.inventory-item strong { display: block; margin-bottom: 4px; }
.slot-card { padding: 16px; border-radius: 16px; border: 1px dashed #9ca3af; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #fafafa; }
.slot-card p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.offer-compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.offer-box { border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-width: 0; }
.offer-box strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offer-arrow { font-size: 22px; font-weight: 900; }

.toast { position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 20px); background: #111827; color: white; padding: 11px 14px; border-radius: 12px; font-weight: 700; font-size: 13px; opacity: 0; pointer-events: none; transition: .2s ease; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-nav { display: none; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 28px; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .topbar { padding: 10px 14px; min-height: 62px; }
  .header-actions { display: none; }
  .page-shell { width: min(100% - 20px, 1180px); margin-top: 12px; margin-bottom: 96px; }
  .hero { padding: 20px; gap: 22px; border-radius: 20px; }
  .hero-copy h1 { font-size: 48px; }
  .hero-copy p { font-size: 15px; }
  .field-grid { grid-template-columns: 1fr; }
  .upload-zone, .upload-zone img { min-height: 210px; height: 210px; }
  .results-head { align-items: start; flex-direction: column; }
  .result-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .result-media { font-size: 42px; }
  .result-body { padding: 11px; }
  .result-name { font-size: 14px; }
  .result-price { font-size: 15px; }
  .result-actions { flex-direction: column; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 10px; right: 10px; bottom: 10px;
    background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 6px; z-index: 30; backdrop-filter: blur(14px);
  }
  .nav-item { border: 0; background: transparent; min-height: 54px; border-radius: 13px; display: grid; place-items: center; gap: 2px; color: var(--muted); }
  .nav-item span { font-size: 20px; line-height: 1; }
  .nav-item small { font-size: 10px; font-weight: 800; }
  .nav-item.active { color: var(--text); background: var(--soft); }
  .slot-card { flex-direction: column; align-items: stretch; }
  .offer-compare { grid-template-columns: 1fr; }
  .offer-arrow { text-align: center; transform: rotate(90deg); }
}

/* Registration privacy + email OTP additions */
.privacy-note {
  margin-top: 12px; max-width: 560px; color: var(--muted); font-size: 13px; line-height: 1.55;
}
.privacy-banner {
  margin: 10px 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px;
  background: white; display: grid; grid-template-columns: auto 1fr auto; gap: 10px 14px; align-items: center;
}
.privacy-banner strong { font-size: 14px; }
.privacy-banner span { font-size: 13px; color: var(--muted); }
.owner-row {
  display: flex; gap: 9px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fafafa;
}
.owner-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: white; border: 1px solid var(--line); flex: 0 0 auto; }
.owner-row div { min-width: 0; }
.owner-row strong, .owner-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-row strong { font-size: 12px; }
.owner-row small { margin-top: 2px; font-size: 11px; color: var(--muted); }
.locked-owner { border-style: dashed; }
.result-meta-line { font-size: 12px; }
.otp-input { text-align: center; letter-spacing: .35em; font-size: 24px; font-weight: 900; }
.otp-actions { display: flex; justify-content: space-between; gap: 12px; }
.link-btn { border: 0; background: transparent; color: var(--text); font-size: 12px; font-weight: 800; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
.demo-otp { padding: 12px; border: 1px dashed #92400e; border-radius: 12px; background: #fffbeb; color: #92400e; text-align: center; font-weight: 900; }
.owner-contact { border: 1px solid var(--line); background: var(--soft); padding: 14px; border-radius: 16px; display: grid; gap: 4px; }
.owner-contact strong { font-size: 12px; color: var(--muted); }
.owner-contact span { font-weight: 900; }
.owner-contact a { color: var(--text); font-size: 13px; }
.empty-state { padding: 18px 0; }
button:disabled { opacity: .6; cursor: wait; transform: none !important; }
@media (max-width: 640px) {
  .privacy-banner { grid-template-columns: 1fr; }
  .privacy-banner .secondary-btn { width: 100%; }
  .otp-actions { flex-direction: column; align-items: flex-start; }
}
