/* ============================================================
   SmawPaw — site.css
   Shared design system: landing, builder chrome, legal pages.
   ============================================================ */

:root {
  --cream: #FBF6EE;
  --paper: #FFFFFF;
  --blush: #F8E8D8;
  --ink: #2B2521;
  --ink-soft: #6E6156;
  --line: #EADFCE;
  --terra: #E0662F;
  --terra-dark: #C4531D;
  --terra-soft: #FBEADD;
  --teal: #2F7E78;
  --teal-soft: #E2F0EE;
  --sun: #F5B841;
  --danger: #C0392B;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 6px rgba(43, 37, 33, 0.06), 0 12px 32px rgba(43, 37, 33, 0.08);
  --shadow-soft: 0 1px 3px rgba(43, 37, 33, 0.07);
  --font-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }
a { color: var(--terra-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 11px 22px;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.06s ease, background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--terra);
  color: #fff;
  box-shadow: 0 4px 14px rgba(224, 102, 47, 0.35);
}
.btn-primary:hover { background: var(--terra-dark); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--terra); color: var(--terra-dark); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: #256560; }
.btn-lg { font-size: 18px; padding: 14px 30px; }
.btn-sm { font-size: 14px; padding: 7px 14px; }
.btn[disabled], .btn.is-disabled {
  opacity: 0.55; cursor: not-allowed; box-shadow: none;
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 246, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 14px 22px;
  max-width: 1080px;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none !important;
}
.brand .paw { width: 34px; height: 34px; }
.nav-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  align-items: center;
}
.nav-links a { color: var(--ink-soft); font-weight: 700; font-size: 15px; }
.nav-links a:hover { color: var(--terra-dark); text-decoration: none; }

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 60px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(34px, 4.6vw, 52px);
  margin-bottom: 18px;
}
.hero h1 .accent { color: var(--terra); }
.hero .sub {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 28px;
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero-note { font-size: 14px; color: var(--ink-soft); margin-top: 14px; }

/* Hero mock — a CSS-drawn handbook cover */
.mock-stack { position: relative; min-height: 420px; }
.mock-card {
  position: absolute;
  background: var(--paper);
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.mock-cover {
  width: 300px;
  padding: 26px 24px 24px;
  left: 8%;
  top: 0;
  transform: rotate(-3deg);
  text-align: center;
}
.mock-cover .mc-photo {
  width: 108px; height: 108px;
  margin: 6px auto 14px;
  border-radius: 50%;
  background: var(--terra-soft);
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--terra);
}
.mock-cover .mc-photo svg { width: 58px; height: 58px; }
.mock-cover h3 { font-size: 24px; margin-bottom: 2px; }
.mock-cover .mc-sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 14px; }
.mock-cover .mc-strip {
  background: var(--terra-soft);
  border-radius: 9px;
  font-size: 12.5px;
  padding: 8px 10px;
  color: var(--terra-dark);
  font-weight: 700;
}
.mock-quickref {
  width: 250px;
  right: 2%;
  top: 130px;
  transform: rotate(2.5deg);
  padding: 18px;
}
.mock-quickref h4 { font-size: 15px; margin-bottom: 10px; color: var(--teal); }
.mock-line { height: 9px; border-radius: 5px; background: var(--cream); margin-bottom: 8px; }
.mock-line.w60 { width: 60%; }
.mock-line.w80 { width: 80%; }
.mock-tag {
  display: inline-block;
  background: var(--teal-soft);
  color: var(--teal);
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 8px;
  margin: 2px 4px 2px 0;
}

/* ---------- Sections ---------- */

.section { padding: 64px 0; }
.section.alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 62ch; margin: 0 auto 42px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); }
.section-head p { color: var(--ink-soft); font-size: 17.5px; }

.kicker {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-soft);
}
.card h3 { font-size: 19px; }
.card p { color: var(--ink-soft); font-size: 15.5px; margin: 0; }
.card .icon {
  width: 46px; height: 46px;
  border-radius: 13px;
  background: var(--terra-soft);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  font-size: 22px;
}

.steps { counter-reset: step; }
.step { position: relative; padding-top: 8px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -18px; left: 22px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--terra);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(224,102,47,0.4);
}

/* ---------- Pricing ---------- */

.pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); gap: 26px; justify-content: center; }
.price-card { position: relative; display: flex; flex-direction: column; }
.price-card .price {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  margin: 8px 0 2px;
}
.price-card .price small { font-size: 16px; color: var(--ink-soft); font-weight: 600; }
.price-card ul { list-style: none; padding: 0; margin: 16px 0 22px; }
.price-card li { padding: 6px 0 6px 30px; position: relative; font-size: 15.5px; }
.price-card li::before {
  content: "";
  position: absolute; left: 0; top: 9px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--teal-soft) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%232F7E78" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>') center/11px no-repeat;
}
.price-card li.dim { color: var(--ink-soft); }
.price-card li.dim::before { filter: grayscale(1); opacity: 0.5; }
.price-card .btn { margin-top: auto; justify-content: center; }
.price-card.featured { border: 2px solid var(--terra); box-shadow: var(--shadow); }
.ribbon {
  position: absolute;
  top: -14px; right: 22px;
  background: var(--sun);
  color: #6b4a00;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  border-radius: 999px;
  padding: 4px 14px;
}

/* ---------- FAQ ---------- */

.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 20px;
  margin-bottom: 12px;
}
.faq summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 16.5px;
  padding: 12px 0;
  list-style: none;
  position: relative;
  padding-right: 30px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 2px; top: 8px;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--terra);
  transition: transform 0.15s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-soft); margin: 0 0 14px; }

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 44px;
  color: var(--ink-soft);
  font-size: 14.5px;
}
.foot-inner {
  display: flex;
  gap: 26px;
  align-items: center;
  flex-wrap: wrap;
}
.foot-inner .brand { font-size: 18px; }
.foot-inner .brand .paw { width: 26px; height: 26px; }
.foot-links { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.foot-links a { color: var(--ink-soft); }

/* ---------- Legal pages ---------- */

.legal { max-width: 720px; margin: 0 auto; padding: 56px 22px 80px; }
.legal h1 { font-size: 34px; }
.legal h2 { font-size: 21px; margin-top: 1.6em; }
.legal p, .legal li { color: #4d443c; font-size: 15.5px; }
.legal .updated { color: var(--ink-soft); font-size: 14px; margin-bottom: 2em; }

/* ============================================================
   Builder app chrome
   ============================================================ */

.app-body { background: var(--cream); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(251, 246, 238, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  max-width: 1460px;
  margin: 0 auto;
}
.topbar .brand { font-size: 19px; }
.topbar .brand .paw { width: 28px; height: 28px; }
.save-pill {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 999px;
  padding: 4px 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.save-pill.show { opacity: 1; }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.badge-premium {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  border: 2px solid var(--sun);
  background: #fff8e8;
  color: #8a6100;
}
.badge-premium.unlocked { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); cursor: default; }

.app-main {
  display: grid;
  grid-template-columns: minmax(430px, 560px) 1fr;
  gap: 26px;
  max-width: 1460px;
  margin: 0 auto;
  padding: 24px 18px 90px;
  align-items: start;
}

/* Form column */
.form-col { min-width: 0; }

.pet-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.pet-tab {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14.5px;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
}
.pet-tab.active { border-color: var(--terra); color: var(--terra-dark); background: var(--terra-soft); }
.pet-tab.add { border-style: dashed; }
.pet-tab .x { margin-left: 6px; opacity: 0.6; }

.fsection {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
  overflow: hidden;
}
.fsection > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  user-select: none;
}
.fsection > summary::-webkit-details-marker { display: none; }
.fsection > summary .emoji { font-size: 20px; }
.fsection > summary .chev {
  margin-left: auto;
  transition: transform 0.15s ease;
  color: var(--ink-soft);
  font-size: 13px;
}
.fsection[open] > summary .chev { transform: rotate(180deg); }
.fsection .fbody { padding: 4px 20px 20px; }

.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.frow.one { grid-template-columns: 1fr; }
.frow.three { grid-template-columns: 1fr 1fr 1fr; }

.field { margin-bottom: 12px; min-width: 0; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}
.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.field textarea { resize: vertical; min-height: 66px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--terra);
  background: #fff;
}
.field .hint { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

/* photo uploader */
.photo-row { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.photo-thumb {
  width: 74px; height: 74px;
  border-radius: 50%;
  background: var(--terra-soft);
  border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex: none;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb svg { width: 36px; height: 36px; }

/* meds repeater */
.med-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.med-row input {
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
}
.med-row input:focus { border-color: var(--terra); background: #fff; outline: none; }
.med-del {
  border: none; background: none; cursor: pointer;
  color: var(--ink-soft); font-size: 17px; padding: 4px 6px;
}
.med-del:hover { color: var(--danger); }
.add-link {
  background: none; border: none; cursor: pointer;
  color: var(--terra-dark); font-weight: 800; font-size: 14px; padding: 4px 0;
}
.add-link:hover { text-decoration: underline; }

/* Print options / themes */
.opt-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 2px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
}
.theme-chip .dot { width: 14px; height: 14px; border-radius: 50%; }
.theme-chip.active { border-color: var(--terra); color: var(--ink); background: var(--terra-soft); }
.theme-chip.locked { opacity: 0.75; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 15px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--terra); }
.check-row .lock { font-size: 13px; color: #8a6100; background: #fff8e8; border: 1px solid var(--sun); border-radius: 6px; padding: 1px 7px; font-weight: 800; }

.data-actions { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 4px; }

/* Preview column */
.preview-col {
  position: sticky;
  top: 76px;
  min-width: 0;
}
.preview-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 700;
}
.preview-frame {
  background: var(--blush);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

/* Mobile view switcher */
.view-tabs {
  display: none;
  position: fixed;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  background: var(--ink);
  border-radius: 999px;
  padding: 5px;
  gap: 4px;
  box-shadow: var(--shadow);
}
.view-tabs button {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14.5px;
  border: none;
  background: transparent;
  color: #d8cfc6;
  border-radius: 999px;
  padding: 9px 22px;
  cursor: pointer;
}
.view-tabs button.active { background: var(--terra); color: #fff; }

/* ---------- Modal ---------- */

.modal-back {
  position: fixed; inset: 0;
  background: rgba(43, 37, 33, 0.5);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-back.open { display: flex; }
.modal {
  background: var(--paper);
  border-radius: 20px;
  max-width: 470px;
  width: 100%;
  padding: 30px;
  box-shadow: var(--shadow);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 { font-size: 23px; margin-bottom: 6px; }
.modal .close {
  position: absolute; top: 14px; right: 16px;
  border: none; background: none; cursor: pointer;
  font-size: 22px; color: var(--ink-soft);
}
.modal ul { padding-left: 0; list-style: none; margin: 14px 0 18px; }
.modal li { padding: 5px 0 5px 28px; position: relative; font-size: 15px; }
.modal li::before {
  content: "🐾";
  position: absolute; left: 0; top: 5px;
  font-size: 13px;
}
.modal .price-line { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.modal .price-line s { color: var(--ink-soft); font-weight: 400; font-size: 15px; }
.license-row { display: flex; gap: 8px; margin-top: 10px; }
.license-row input {
  flex: 1;
  font-size: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--cream);
  min-width: 0;
}
.license-row input:focus { border-color: var(--terra); background: #fff; outline: none; }
.modal .fine { font-size: 12.5px; color: var(--ink-soft); margin-top: 12px; }
.modal .msg { font-size: 14px; font-weight: 700; margin-top: 10px; min-height: 20px; }
.modal .msg.ok { color: var(--teal); }
.modal .msg.err { color: var(--danger); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 12.5px; font-weight: 800; margin: 18px 0 4px; text-transform: uppercase; letter-spacing: 0.08em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  border-radius: 12px;
  padding: 13px 20px;
  z-index: 120;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  max-width: 340px;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1060px) {
  .app-main { grid-template-columns: 1fr; }
  .preview-col { position: static; display: none; }
  .app-main[data-view="preview"] .preview-col { display: block; }
  .app-main[data-view="preview"] .form-col { display: none; }
  .view-tabs { display: flex; }
  .preview-frame { max-height: none; padding: 14px; }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .mock-stack { min-height: 400px; transform: scale(0.94); transform-origin: top center; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .pricing { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .frow, .frow.three { grid-template-columns: 1fr; }
  .med-row { grid-template-columns: 1fr 1fr; }
  .med-row input:first-child { grid-column: 1 / -1; }
}

@media print {
  .nav, .topbar, footer, .view-tabs, .toast, .modal-back { display: none !important; }
}
