/* ============================================================
   JUSTDOGS.ai design system
   Matches the visual language of the original prototype:
   - passport navy #141C3A · warm paper #FBFAF7 · brand red-orange #E8542F
   - Bricolage Grotesque (display) + Inter (body)
   - 520px mobile-first stage
   ============================================================ */

:root {
  --ink: #141C3A;
  --paper: #FBFAF7;
  --brand: #E8542F;
  --mint: #1F8A70;
  --amber: #F2A93B;
  --cloud: #EDEAE2;
  --soft: #6B7280;
  --card: #FFFFFF;
  --navy2: #1E2A55;
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.display { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; }

.stage {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  padding-bottom: 90px;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes pop { 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.fade-in { animation: fadeIn .45s ease both; }

.proto-badge {
  position: fixed; top: 10px; right: 10px; z-index: 60;
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  background: var(--ink); color: #fff; padding: 5px 10px;
  border-radius: 999px; opacity: .85;
}

/* ---------- Landing (S1 front door) ---------- */
.door {
  min-height: 100dvh; display: flex; flex-direction: column;
  justify-content: center; padding: 32px 26px;
  background: linear-gradient(178deg, #FBFAF7 0%, #F5EFE4 70%, #F1E6D2 100%);
}
.wordmark { font-weight: 800; font-size: 15px; letter-spacing: .06em; }
.wordmark .ai { color: var(--brand); }
.door h1 {
  font-size: clamp(34px, 9vw, 46px); line-height: 1.04; font-weight: 800;
  margin: 26px 0 14px; letter-spacing: -.01em;
  font-family: 'Bricolage Grotesque', 'Inter', sans-serif;
}
.door h1 em { font-style: normal; color: var(--brand); }
.door p.sub { color: var(--soft); font-size: 15.5px; line-height: 1.55; max-width: 34ch; }

.phone-row { margin-top: 34px; display: flex; gap: 10px; }
.cc {
  background: var(--card); border: 1.5px solid var(--cloud); border-radius: 14px;
  padding: 0 14px; display: flex; align-items: center; font-weight: 600; font-size: 15px;
}
input.phone {
  flex: 1; background: var(--card); border: 1.5px solid var(--cloud); border-radius: 14px;
  padding: 16px; font-size: 17px; font-weight: 600; letter-spacing: .04em;
  font-family: inherit; color: var(--ink); min-width: 0;
}
input.phone:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }

.btn {
  display: block; width: 100%; margin-top: 14px; border: none; cursor: pointer;
  background: var(--brand); color: #fff; font-family: inherit;
  font-weight: 700; font-size: 16px; padding: 17px; border-radius: 14px;
  transition: transform .12s ease, box-shadow .12s ease;
  text-align: center; text-decoration: none;
}
.btn:active { transform: scale(.985); }
.btn.ghost {
  background: transparent; color: var(--ink); border: 1.5px solid var(--cloud);
  font-weight: 600;
}
.btn.dark {
  background: var(--ink); color: #fff;
}
.tiny { margin-top: 18px; font-size: 12px; color: var(--soft); line-height: 1.5; }
.err { color: #C13B1B; font-size: 13px; margin-top: 10px; font-weight: 600; }

/* ---------- OTP (S2) ---------- */
.center-col {
  min-height: 100dvh; display: flex; flex-direction: column;
  justify-content: center; padding: 32px 26px;
}
.eyebrow {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--brand); font-weight: 700;
}
.center-col h2 { font-size: 28px; font-weight: 800; margin: 10px 0 8px; font-family: 'Bricolage Grotesque', sans-serif; }
.center-col .sub { color: var(--soft); font-size: 14.5px; }
.otp-row { display: flex; gap: 12px; margin: 30px 0 8px; }
.otp-input {
  width: 58px; height: 66px; background: var(--card);
  border: 1.5px solid var(--cloud); border-radius: 14px;
  text-align: center; font-size: 26px; font-weight: 800;
  font-family: 'Bricolage Grotesque', sans-serif;
}
.otp-input:focus { outline: 2px solid var(--brand); border-color: transparent; }
.returning-banner {
  background: #FDF1DC; border: 1px solid #F2D9B8; border-radius: 12px;
  padding: 14px 16px; margin-top: 22px; font-size: 13.5px; line-height: 1.5;
}
.returning-banner b { color: #B07914; }

/* ---------- Question waves (S3) ---------- */
.q-wrap { min-height: 100dvh; display: flex; flex-direction: column; padding: 30px 26px 40px; }
.q-top { display: flex; align-items: center; justify-content: space-between; }
.dots { display: flex; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cloud); }
.dot.on { background: var(--brand); }
.q-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.q-label {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--soft); font-weight: 600; margin-bottom: 10px;
}
.q-text {
  font-size: clamp(26px, 7vw, 32px); font-weight: 800; line-height: 1.12;
  font-family: 'Bricolage Grotesque', sans-serif; margin-bottom: 26px;
}
.q-text .hl { color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: 1.5px solid var(--cloud); background: var(--card);
  border-radius: 999px; padding: 12px 20px; font-size: 15px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  color: var(--ink); transition: all .15s ease;
}
.chip:hover { border-color: var(--brand); }
.chip.suggest { border-color: var(--brand); background: #FDEEE8; color: var(--brand); }
.chip.selected { border-color: var(--brand); background: var(--brand); color: #fff; }
.q-note { margin-top: 22px; font-size: 12.5px; color: var(--soft); line-height: 1.5; }

input.text-field, select.text-field {
  width: 100%; background: var(--card); border: 1.5px solid var(--cloud);
  border-radius: 14px; padding: 16px; font-size: 16px; font-weight: 500;
  font-family: inherit; color: var(--ink);
}
input.text-field:focus, select.text-field:focus { outline: 2px solid var(--brand); border-color: transparent; }
label.field-label { display: block; font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--soft); font-weight: 600; margin: 14px 0 6px; }

input[type=file] { font-size: 14px; }

/* ---------- Assembly (S4) ---------- */
.assembly {
  min-height: 100dvh; background: var(--ink); color: #fff;
  display: flex; flex-direction: column; justify-content: center;
  padding: 36px 30px;
}
.assembly .eyebrow { color: var(--amber); }
.assembly h2 {
  font-size: clamp(26px, 7vw, 32px); font-weight: 800;
  font-family: 'Bricolage Grotesque', sans-serif; margin: 12px 0 30px; line-height: 1.15;
}
.loglines { display: flex; flex-direction: column; gap: 15px; min-height: 240px; }
.logline {
  display: flex; gap: 12px; align-items: flex-start; opacity: 0;
  animation: slideUp .4s ease both; font-size: 14.5px; line-height: 1.45; color: #D7DBEA;
}
.logline .tick {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  background: var(--mint); color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.logline.hide .tick { background: var(--brand); }
.logline strong { color: #fff; }

/* ---------- Pet page (S5) ---------- */
.page { padding: 0 0 30px; }
.mast {
  background: linear-gradient(160deg, var(--ink) 0%, var(--navy2) 100%);
  color: #fff; padding: 54px 24px 26px; border-radius: 0 0 28px 28px;
}
.mast-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.mast .wordmark { color: #A8B0CC; font-size: 11px; }
.mast .wordmark .ai { color: var(--amber); }
.addpet {
  font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px; padding: 7px 14px; cursor: pointer; font-family: inherit;
  text-decoration: none;
}
.pet-row { display: flex; gap: 16px; align-items: center; }
.avatar {
  width: 68px; height: 68px; border-radius: 50%;
  background: rgba(255,255,255,.14); display: flex; align-items: center;
  justify-content: center; font-size: 34px; flex: 0 0 auto; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.mast h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 34px; font-weight: 800; line-height: 1;
}
.mast .meta { color: #B9C0D8; font-size: 13.5px; margin-top: 6px; }
.passport-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.pchip {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px; padding: 8px 11px; font-size: 11px; color: #C9CFE3;
}
.pchip b { display: block; color: #fff; font-size: 12.5px; margin-top: 2px; font-weight: 600; }

.mods { padding: 18px 18px 0; display: flex; flex-direction: column; gap: 16px; }
.mod {
  background: var(--card); border: 1px solid var(--cloud);
  border-radius: var(--radius); padding: 20px;
  animation: slideUp .5s ease both;
}
.mod h3 {
  font-family: 'Bricolage Grotesque', sans-serif; font-size: 17px;
  font-weight: 800; display: flex; align-items: center; gap: 8px;
}
.mod .mh-sub { font-size: 12.5px; color: var(--soft); margin-top: 3px; line-height: 1.5; }
.tag {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; border-radius: 999px; padding: 4px 9px;
}
.tag.live { background: #E3F4EE; color: var(--mint); }
.tag.earned { background: #FDF1DC; color: #B07914; }

/* Weight band */
.band-wrap { margin-top: 18px; }
.band {
  position: relative; height: 12px; border-radius: 999px;
  background: linear-gradient(90deg, #F5D9CF 0%, #CFE8DF 30%, #CFE8DF 75%, #F5D9CF 100%);
}
.band .marker {
  position: absolute; top: -7px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--ink); color: #fff;
  font-size: 10px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; transform: translateX(-50%);
  border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.band-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--soft); margin-top: 10px; }
.band-read { margin-top: 12px; font-size: 13.5px; line-height: 1.55; }

/* Shelf */
.shelf-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 14px; }
.scard {
  border: 1px solid var(--cloud); border-radius: 14px;
  padding: 14px; background: #fff;
}
.scard-top { display: flex; gap: 12px; align-items: flex-start; }
.scard-img {
  width: 64px; height: 64px; flex: 0 0 auto; background: #F5EFE4;
  border-radius: 10px; overflow: hidden; display: flex; align-items: center;
  justify-content: center; font-size: 24px;
}
.scard-img img { width: 100%; height: 100%; object-fit: cover; }
.scard-body { flex: 1; min-width: 0; }
.scard-body b { font-size: 13.5px; display: block; line-height: 1.3; }
.scard-meta { font-size: 11.5px; color: var(--soft); margin-top: 3px; }
.scard-price { font-weight: 800; font-size: 14px; margin-top: 6px; }
.scard-price .strike { color: var(--soft); text-decoration: line-through; font-weight: 500; margin-right: 6px; font-size: 12px; }
.add-btn {
  margin-top: 10px; width: 100%; padding: 10px; border-radius: 10px;
  border: 1.5px solid var(--cloud); background: #fff; font-family: inherit;
  font-weight: 700; font-size: 13px; color: var(--ink); cursor: pointer;
}
.add-btn:hover { border-color: var(--brand); color: var(--brand); }
.why-card {
  margin-top: 12px; background: #FBFAF7; border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; line-height: 1.5; color: var(--ink);
}
.why-card b { display: block; font-size: 11px; color: var(--brand); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 3px; }

/* Hidden module */
.hidden-toggle {
  margin-top: 12px; background: transparent; border: 1.5px dashed var(--cloud);
  width: 100%; padding: 12px; border-radius: 10px; font-family: inherit;
  font-size: 13px; font-weight: 600; color: var(--soft); cursor: pointer;
}
.hidden-list { display: none; margin-top: 10px; }
.hidden-list.open { display: block; }
.hidden-list .strike {
  font-size: 13px; color: var(--soft); padding: 6px 0;
  border-bottom: 1px dashed var(--cloud); text-decoration: line-through;
}

/* Next-step CTA */
.cta-wave {
  background: linear-gradient(135deg, #FDEEE8 0%, #FFF7E8 100%);
  border-radius: var(--radius); padding: 22px; margin: 8px 18px 0;
  border: 1px solid #F5D9CF;
}
.cta-wave h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 19px; font-weight: 800; margin-bottom: 6px;
}
.cta-wave p { font-size: 13.5px; color: var(--ink); margin-bottom: 14px; line-height: 1.5; }

/* Chat dock */
.dock {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 12px 18px; display: flex; align-items: center; gap: 10px;
  width: calc(100% - 36px); max-width: 484px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(20,28,58,.25); z-index: 50;
}
.dot-live {
  width: 8px; height: 8px; border-radius: 50%; background: var(--mint);
  box-shadow: 0 0 0 0 rgba(31, 138, 112, .55); animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(31, 138, 112, .55); }
  70%  { box-shadow: 0 0 0 10px rgba(31, 138, 112, 0); }
  100% { box-shadow: 0 0 0 0   rgba(31, 138, 112, 0); }
}
.sm { font-size: 11.5px; color: #A8B0CC; }

.chat-panel {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%) translateY(100%);
  background: #fff; width: 100%; max-width: 520px; height: 80dvh;
  border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.18);
  display: flex; flex-direction: column; transition: transform .35s ease;
  z-index: 70;
}
.chat-panel.open { transform: translateX(-50%) translateY(0); }
.chat-head {
  padding: 14px 18px; border-bottom: 1px solid var(--cloud);
  display: flex; justify-content: space-between; align-items: center;
}
.close-x {
  background: var(--cloud); border: none; width: 32px; height: 32px;
  border-radius: 50%; font-size: 16px; cursor: pointer;
}
.chat-body { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.bub { padding: 10px 14px; border-radius: 14px; max-width: 80%; font-size: 14px; line-height: 1.45; }
.bub.ai { background: #FBFAF7; border: 1px solid var(--cloud); align-self: flex-start; }
.bub.me { background: var(--ink); color: #fff; align-self: flex-end; }
.quick { padding: 0 18px 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.quick button {
  background: #FDEEE8; color: var(--brand); border: none;
  border-radius: 999px; padding: 7px 12px; font-size: 12.5px;
  font-weight: 600; font-family: inherit; cursor: pointer;
}
.chat-input { padding: 12px 18px; border-top: 1px solid var(--cloud); display: flex; gap: 8px; }
.chat-input input {
  flex: 1; background: #FBFAF7; border: 1.5px solid var(--cloud);
  border-radius: 10px; padding: 10px 14px; font-family: inherit; font-size: 14px;
}
.chat-input button {
  background: var(--ink); color: #fff; border: none; border-radius: 10px;
  padding: 0 16px; font-family: inherit; font-weight: 700; cursor: pointer;
}

/* Reset row */
.reset-row { text-align: center; margin-top: 22px; padding: 0 18px; }
.reset-row a {
  color: var(--soft); font-size: 12.5px; text-decoration: none;
  border: 1px solid var(--cloud); padding: 7px 14px; border-radius: 999px;
}
