/* GFF × AI prototype — design tokens and shared components.
   Module styles live in css/<module>.css and must only use these tokens. */
@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Figtree:wght@400;500;600;700&display=swap");

:root {
  --paper: #ffffff;
  --paper-2: #f4f3f8;
  --paper-3: #e9e7f1;
  --ink: #22223b;
  --ink-2: #4a4a68;
  --ink-3: #8a89a3;
  --magenta: #e5337a;
  --magenta-2: #c21f62;
  --magenta-soft: #fde6ef;
  --yellow: #ffd447;
  --yellow-soft: #fff6d1;
  --mint: #1fa99b;
  --mint-soft: #ddf4f1;
  --red: #d64545;
  --red-soft: #fbe3e3;
  --line: #dddbe8;

  --f-display: "Bricolage Grotesque", system-ui, sans-serif;
  --f-body: "Figtree", system-ui, sans-serif;

  /* type scale (1.25) */
  --t-xs: .75rem; --t-s: .875rem; --t-m: 1rem; --t-l: 1.25rem; --t-xl: 1.563rem; --t-2xl: 1.953rem; --t-3xl: 2.441rem; --t-4xl: 3.815rem;

  --r-s: 8px; --r-m: 14px; --r-l: 22px; --r-pill: 999px;
  --shadow-device: 0 30px 60px -20px rgba(34, 34, 59, .35), 0 0 0 1px rgba(34, 34, 59, .06);
  --shadow-lift: 0 8px 20px -8px rgba(34, 34, 59, .25);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--f-body); font-size: var(--t-m); line-height: 1.5; color: var(--ink);
  background: var(--paper-2); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.1; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 .75em; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- buttons, chips, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em; border: 0; cursor: pointer;
  padding: .7em 1.2em; border-radius: var(--r-pill); font-weight: 600; font-size: var(--t-s);
  background: var(--paper-3); color: var(--ink); transition: transform .15s var(--ease-out), background .15s;
}
.btn:hover { background: var(--line); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--magenta); color: #fff; }
.btn-primary:hover { background: var(--magenta-2); }
.btn-ai { background: var(--mint); color: #fff; }
.btn-ai:hover { background: #178a7e; }
.btn-ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-ai::before { content: ""; width: 1em; height: 1em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1l2.6 7.4L22 11l-7.4 2.6L12 21l-2.6-7.4L2 11l7.4-2.6z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1l2.6 7.4L22 11l-7.4 2.6L12 21l-2.6-7.4L2 11l7.4-2.6z'/%3E%3C/svg%3E") center/contain no-repeat; }

.chip {
  display: inline-flex; align-items: center; gap: .35em; padding: .45em .9em; border-radius: var(--r-pill);
  border: 1.5px solid var(--line); background: var(--paper); font-size: var(--t-s); font-weight: 500; cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s var(--ease-spring);
}
.chip:hover { border-color: var(--magenta); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }

.field { display: grid; gap: .3rem; font-size: var(--t-s); }
.field label { font-weight: 600; color: var(--ink-2); }
.input, .textarea, .select {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-s); padding: .6em .8em; background: var(--paper);
}
.textarea { resize: vertical; min-height: 6em; line-height: 1.45; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--mint); outline: none; }

.tag { display: inline-block; font-size: var(--t-xs); font-weight: 600; padding: .15em .55em; border-radius: var(--r-pill); background: var(--paper-3); color: var(--ink-2); }
.tag-ai { background: var(--mint-soft); color: #11776d; }
.tag-bad { background: var(--red-soft); color: var(--red); }
.tag-good { background: var(--mint-soft); color: #11776d; }
.tag-warn { background: var(--yellow-soft); color: #8a6a00; }

/* ---------- product card (catalogue item) ---------- */
.pcard { background: var(--paper); border-radius: var(--r-m); overflow: hidden; box-shadow: 0 0 0 1px var(--line); display: grid; }
.pcard img { aspect-ratio: 1; object-fit: cover; background: var(--paper-2); width: 100%; }
.pcard .pcard-body { padding: .6rem .7rem .7rem; display: grid; gap: .25rem; }
.pcard .pcard-name { font-size: var(--t-s); font-weight: 600; line-height: 1.3; }
.pcard .pcard-price { font-family: var(--f-display); font-weight: 700; color: var(--magenta); }
.pcard .pcard-why { font-size: var(--t-xs); color: #11776d; background: var(--mint-soft); border-radius: var(--r-s); padding: .3rem .45rem; }

/* ---------- device frames ---------- */
.phone {
  width: 375px; max-width: 100%; height: 740px; border-radius: 46px; background: var(--ink); padding: 12px;
  box-shadow: var(--shadow-device); position: relative; flex: none;
}
.phone-screen { width: 100%; height: 100%; border-radius: 36px; background: var(--paper); overflow: hidden; display: flex; flex-direction: column; position: relative; }
.phone-notch { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 110px; height: 28px; border-radius: 0 0 18px 18px; background: var(--ink); z-index: 5; }
.phone-bar { padding: 2.4rem 1rem .7rem; display: flex; align-items: center; gap: .6rem; border-bottom: 1px solid var(--line); background: var(--paper); flex: none; }
.phone-bar .shop-logo { font-family: var(--f-display); font-weight: 800; color: var(--magenta); font-size: var(--t-l); }
.phone-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }

.desktop {
  width: 100%; border-radius: var(--r-l); background: var(--paper); box-shadow: var(--shadow-device); overflow: hidden;
  display: flex; flex-direction: column; min-height: 640px;
}
.desktop-bar { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; background: var(--paper-2); border-bottom: 1px solid var(--line); flex: none; }
.desktop-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--paper-3); display: inline-block; }
.desktop-bar .desk-title { margin-left: .6rem; font-size: var(--t-s); color: var(--ink-3); font-weight: 500; }
.desktop-body { flex: 1; padding: 1.25rem; overflow: auto; }

/* ---------- chat bubbles (shared by finder & support) ---------- */
.chat { display: flex; flex-direction: column; gap: .6rem; padding: 1rem; }
.bubble { max-width: 85%; padding: .65rem .85rem; border-radius: 18px; font-size: var(--t-s); line-height: 1.45; animation: pop .35s var(--ease-spring) both; }
.bubble.bot { background: var(--paper-2); border-bottom-left-radius: 6px; align-self: flex-start; }
.bubble.user { background: var(--magenta); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.typing-dots { display: inline-flex; gap: 4px; padding: .8rem .9rem; background: var(--paper-2); border-radius: 18px; align-self: flex-start; }
.typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .15s; } .typing-dots span:nth-child(3) { animation-delay: .3s; }
.caret::after { content: ""; display: inline-block; width: 2px; height: 1em; background: var(--mint); margin-left: 2px; vertical-align: -2px; animation: blink .8s steps(1) infinite; }

/* ---------- message sticker: the signature element ---------- */
.sticker {
  --s: 120px; width: var(--s); height: var(--s); border-radius: 50%; background: var(--yellow); color: var(--ink);
  display: grid; place-items: center; text-align: center; font-family: var(--f-display); font-weight: 800; line-height: 1.05;
  box-shadow: 0 2px 0 rgba(0,0,0,.08), 0 10px 20px -10px rgba(34,34,59,.4); padding: calc(var(--s) * .13);
  position: relative; transform: rotate(-8deg);
}
.sticker::after { content: ""; position: absolute; inset: 6%; border-radius: 50%; border: 2px dashed rgba(34,34,59,.25); }
.sticker > span { display: block; max-width: 100%; overflow-wrap: normal; hyphens: manual; position: relative; z-index: 1; }
.sticker.magenta { background: var(--magenta); color: #fff; }
.sticker.mint { background: var(--mint); color: #fff; }
.sticker.white { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line), 0 10px 20px -10px rgba(34,34,59,.4); }

/* ---------- utilities ---------- */
.stack { display: grid; gap: var(--gap, 1rem); }
.row { display: flex; gap: var(--gap, .75rem); align-items: center; flex-wrap: wrap; }
.muted { color: var(--ink-3); }
.small { font-size: var(--t-s); }
.xs { font-size: var(--t-xs); }
.demo-note { font-size: var(--t-xs); color: var(--ink-3); }

@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
.skeleton { background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-3) 50%, var(--paper-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: var(--r-s); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
