/* SellerMCP — "Vitrine" visual language
   ---------------------------------------------------------------------------
   Bright, commerce-native, sticker-like: warm cream paper, near-black-purple
   ink, an orange accent that carries every call to action, and hard offset
   drop-shadows instead of soft corporate blur.

   This file is the single source of truth for the design tokens. The
   Tailwind-CDN pages (landing / dashboard / policies / approval) link it too
   and mirror the same tokens into their `tailwind.config`, so a token change
   here is the one place to start. */

:root {
  /* --- Vitrine palette ------------------------------------------------- */
  --ink: #1c1730;          /* primary text + every border and hard shadow  */
  --ink-80: #3a3350;
  --ink-60: #5d5470;       /* secondary text                                */
  --ink-40: #8b8299;
  --ink-20: #d8d3e0;       /* hairlines on white                            */
  --paper: #fffaf5;        /* warm cream page background                    */
  --card: #ffffff;
  --accent: #ff5a36;       /* primary CTA / energy                          */
  --accent-dark: #e8431f;
  --accent-soft: #ffe9e2;
  --sun: #ffc93c;          /* secondary accent                              */
  --sun-soft: #fff4d1;
  --mint: #1fb6a4;         /* success / approve                             */
  --mint-soft: #dcf5f1;
  --danger: #d92d20;
  --danger-soft: #fdecea;

  /* --- Motif ----------------------------------------------------------- */
  --radius: 20px;
  --radius-lg: 28px;
  --border-w: 2.5px;
  --shadow-hard: 6px 6px 0 var(--ink);
  --shadow-hard-sm: 4px 4px 0 var(--ink);
  --shadow-hard-lg: 10px 10px 0 var(--ink);
  --shadow-hard-accent: 6px 6px 0 var(--accent);

  /* --- Type ------------------------------------------------------------ */
  --font-body: "Plus Jakarta Sans", ui-sans-serif, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Baloo 2", "Plus Jakarta Sans", ui-rounded, system-ui,
    sans-serif;

  /* Legacy aliases: older markup still reaches for --brand. */
  --brand: var(--accent);
  --brand-dark: var(--accent-dark);
  --brand-soft: var(--accent-soft);
  --ink-soft: var(--ink-60);
  --line: var(--ink-20);
  --shadow: var(--shadow-hard);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .headline, .card-title, .store-name, .display {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

::selection { background: var(--sun); color: var(--ink); }

/* Warm radial glow used behind hero-ish content on the card pages. */
.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  position: relative;
  background:
    radial-gradient(60% 55% at 50% 0%, rgba(255, 201, 60, 0.35), transparent 70%),
    radial-gradient(70% 60% at 15% 100%, rgba(255, 90, 54, 0.18), transparent 70%),
    var(--paper);
}
.page-login, .page-confirm { flex-direction: column; }
.page-dash { display: block; padding: 32px 20px 64px; }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--card);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard);
  padding: 34px 32px;
  width: 100%;
  max-width: 420px;
}
.card-login { max-width: 400px; }
.card-narrow { max-width: 460px; }
.card-confirm {
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: 470px;
  overflow: hidden;
}
.card-stat { max-width: none; }

/* ------------------------------------------------------------------ logo */
.logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--accent);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wordmark {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.wordmark strong { color: var(--accent); font-weight: 800; }

/* ------------------------------------------------------------------ type */
.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.headline {
  margin: 0 0 10px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
}
.card-title { margin: 0 0 12px; font-size: 21px; font-weight: 800; }
.store-name { margin: 0 0 2px; font-size: 27px; font-weight: 800; }
.subhead { margin: 0 0 22px; color: var(--ink-60); line-height: 1.55; }
.center { text-align: center; }
.muted { color: var(--ink-60); }
.small { font-size: 12.5px; }
.brand { color: var(--accent); font-weight: 700; }

/* ------------------------------------------------------------------ form */
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-60);
}
.input-wrap { position: relative; margin-bottom: 16px; }
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-40);
}
.input-wrap input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  outline: none;
  transition: box-shadow 0.12s, background 0.12s;
}
.input-wrap input:focus {
  background: #fff;
  box-shadow: var(--shadow-hard-sm);
}
.input-wrap input::placeholder { color: var(--ink-40); font-weight: 500; }

.btn-primary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-hard-sm);
  transition: transform 0.08s, box-shadow 0.08s, background 0.12s;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}
.btn-icon { flex: none; }
.btn-link { display: flex; margin-top: 8px; }
.btn-secondary {
  padding: 10px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-hard-sm);
  transition: transform 0.08s, box-shadow 0.08s, background 0.12s;
}
.btn-secondary:hover { background: var(--sun-soft); }
.btn-secondary:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}
.btn-danger {
  padding: 6px 13px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}
.btn-danger:hover { background: #fbd9d5; }
.form-error {
  margin: 0 0 14px;
  padding: 11px 14px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 700;
}

/* ------------------------------------------------------------------ steps */
.steps {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 26px 4px 0;
  margin: 26px 0 0;
  border-top: 2px dashed var(--ink-20);
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 62px;
}
.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  background: #fff;
  color: var(--ink-40);
}
.step.active .step-dot {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-hard-sm);
}
.step-line {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--ink-20);
  margin-bottom: 24px;
}
.step-line.done { background: var(--accent); }
.step-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--ink-40);
}
.step.active .step-label { color: var(--ink); }

/* ------------------------------------------------------------------ footer */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  font-size: 12px;
  font-weight: 600;
}
.supabase-logo { vertical-align: -2px; }

/* ------------------------------------------------------------------ confirm */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--sun);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 18px;
}
.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: var(--accent);
}
.page-dash .card-narrow { margin: 48px auto; }

.badge-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-hard-sm);
  margin: 0 auto 16px;
}
.confirm-copy { max-width: 380px; margin: 0 auto 18px; }

/* Blurred dashboard teaser behind the confirmation card (decorative). */
.preview-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  filter: blur(14px);
  pointer-events: none;
  z-index: 0;
}
.preview-card {
  width: 560px;
  max-width: 90vw;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 28px;
  padding: 26px;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 14px;
}
.preview-chip, .preview-stat, .preview-row {
  border-radius: 14px;
  border: 2px solid var(--ink);
  background: linear-gradient(120deg, var(--sun-soft), var(--accent-soft));
}
.preview-chip { height: 70px; }
.preview-stat { height: 110px; grid-column: 2; grid-row: 1 / 3; }
.preview-row { height: 34px; }
.preview-row.short { width: 65%; }

/* ------------------------------------------------------------------ dashboard */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 980px;
  margin: 0 auto 26px;
}
.dash-header .logo-row { margin-bottom: 0; }
.dash-user { display: flex; align-items: center; gap: 14px; }
.link-quiet { color: var(--ink-60); font-size: 13.5px; font-weight: 700; text-decoration: none; }
.link-quiet:hover { color: var(--accent); }

.dash-grid {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.dash-grid .card { max-width: none; }
.card-wide { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .dash-grid { grid-template-columns: 1fr; }
}

.status-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status-active { background: var(--mint-soft); color: #0d6b60; }
.status-needs_reauthorization { background: var(--danger-soft); color: var(--danger); }
.status-awaiting_consent { background: var(--sun-soft); color: #8a6300; }
.status-disabled { background: #efecf4; color: var(--ink-60); }

.stat-highlight {
  margin: 18px 0 10px;
  padding: 18px 20px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--sun-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-60);
}

.usage-bar {
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 10px;
}
.usage-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s;
}

.copy-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 12px;
}
.key-value {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.btn-copy {
  flex: none;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.btn-copy:hover { background: var(--ink-80); }

.setup { margin: 6px 0 14px; }
.setup summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--accent);
}
.setup-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--ink-60);
  font-size: 13.5px;
  line-height: 1.65;
}

.key-list { list-style: none; margin: 0 0 14px; padding: 0; }
.key-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 2px dashed var(--ink-20);
}
.key-row:last-child { border-bottom: none; }
.inline-form { margin-left: auto; }

.event-list { list-style: none; margin: 0; padding: 0; }
.event-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 2px dashed var(--ink-20);
  font-size: 13.5px;
}
.event-row:last-child { border-bottom: none; }
.event-kind { font-weight: 800; }

/* ------------------------------------------------- shared Vitrine primitives
   Used by the Tailwind-CDN pages (landing, dashboard, policies, approval) so
   the sticker motif has one definition instead of four. */
.v-card {
  background: var(--card);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard);
}
.v-card-flat {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
}
.v-shadow { box-shadow: var(--shadow-hard); }
.v-shadow-sm { box-shadow: var(--shadow-hard-sm); }
.v-shadow-lg { box-shadow: var(--shadow-hard-lg); }
.v-press {
  transition: transform 0.08s, box-shadow 0.08s;
}
.v-press:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-hard-lg); }
.v-press:active { transform: translate(3px, 3px); box-shadow: var(--shadow-hard-sm); }
.v-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-40);
}
.v-glow {
  background:
    radial-gradient(55% 50% at 72% 12%, rgba(255, 90, 54, 0.22), transparent 70%),
    radial-gradient(45% 45% at 18% 28%, rgba(255, 201, 60, 0.30), transparent 72%),
    var(--paper);
}
.v-tape {
  background-image: repeating-linear-gradient(
    -45deg, var(--ink), var(--ink) 8px, transparent 8px, transparent 16px
  );
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ── Vitrine — mobile overflow guards (landing + shared Tailwind pages) ──
   The Tailwind-CDN pages (landing / dashboard / policies / approval) use a
   utility-first grid at the hero: `grid lg:grid-cols-[1.05fr_1fr]`. In CSS
   Grid the default item `min-width: auto` prevents a column from shrinking
   below its min-content (the H1 at ~43px wants ~580px), so the whole section
   scrolls horizontally on phones. Tailwind's `min-w-0` is added in markup
   too; this file enforces the same for any missed spot and clamps the type
   scale so nothing forces overflow even before the grid can wrap.
   Keep desktop untouched — every rule is max-width-bounded. */
html, body {
  max-width: 100%;
  overflow-x: clip;
}
/* Replaced elements must never force the viewport wider. */
img, video, iframe, canvas, svg {
  max-width: 100%;
}
/* Tailwind's `max-w-6xl mx-auto px-4` containers already pad the viewport;
   make their grid descendants shrinkable even if a `min-w-0` class was missed
   in markup. */
section > div[class*="grid"] > *,
div[class*="grid"][class*="max-w-6xl"] > * {
  min-width: 0;
}
/* Hero heading: clamp from ~28px at 360px to 43px at 640px, then Tailwind's
   sm:text-6xl takes over. Without this the 2.7rem (43.2px) H1's min-content
   is ~580px and blows out the grid before it can wrap. */
@media (max-width: 640px) {
  section.v-glow h1 {
    font-size: clamp(1.75rem, calc(7vw + 0.5rem), 2.7rem) !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  section.v-glow h1 + p {
    overflow-wrap: anywhere;
  }
  /* CTA buttons: allow wrapping and reduce horizontal padding at the smallest sizes: */
  section.v-glow a[class*="rounded-pill"][class*="px-8"] {
    padding-left: clamp(1.25rem, 4vw, 2rem) !important;
    padding-right: clamp(1.25rem, 4vw, 2rem) !important;
    max-width: 100%;
    min-width: 0;
  }
  /* The checkmark row and the CTA row must wrap; the chat header must not. */
  section.v-glow ul[class*="flex"] {
    flex-wrap: wrap;
    min-width: 0;
  }
  section.v-glow div.flex.flex-col {
    flex-wrap: wrap;
    min-width: 0;
  }
  section.v-glow ul[class*="flex"] li {
    min-width: 0;
  }
  #demo,
  #demo > div {
    min-width: 0;
    max-width: 100%;
  }
  #demo > div[class*="rounded-blob"] {
    overflow: hidden;
    max-width: 100%;
  }
  /* Every `max-w-* mx-auto px-4` container should clip shadow overflow
     rather than let it enlarge scrollWidth. */
  [class*="max-w-6xl"],
  [class*="max-w-3xl"],
  [class*="max-w-2xl"] {
    max-width: 100%;
    min-width: 0;
  }
  /* Long headings in later sections (o-que-faz / como-funciona etc.) use
     text-4xl / text-5xl; clamp them the same way so a narrow phone doesn't
     get a second overflow from a section title. */
  section h2 {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  @media (max-width: 400px) {
    section h2 {
      font-size: clamp(1.5rem, 7vw, 2.25rem) !important;
    }
  }
}
/* Decorative blurred blobs in #aprovacao use w-96 + negative offsets
   (-right-24 etc.). At 390 they poke 96px outside the section even
   though the section is overflow-hidden — clip them tighter on phones. */
@media (max-width: 640px) {
  #aprovacao div.absolute.w-96 {
    width: 18rem !important; /* 288px instead of 384 */
    height: 18rem !important;
  }
  #aprovacao div.absolute.-right-24 {
    right: 0 !important;
  }
  #aprovacao div.absolute.-left-20 {
    left: 0 !important;
  }
}
/* At ~360px even the reduced H1 padding is tight — shave container padding
   by 4px so the 2.5px border + 6px shadow still fit without clipping. */
@media (max-width: 380px) {
  section.v-glow > div[class*="max-w-6xl"] {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}
/* Dashboard / policies / approval share style.css — their v-card grids and
   tables can also force overflow on phones if a long tool name or URL is
   rendered. Keep these guards broad but mobile-only. */
@media (max-width: 640px) {
  .v-card,
  .v-card-flat,
  .glass-card {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  /* Dashboard's `lg:grid-cols-3` / `lg:grid-cols-2` stat/MCP grids */
  div[class*="grid"][class*="lg:grid-cols-"] > * {
    min-width: 0;
  }
  /* Policies tool matrix: let the table scroll internally, not expand the page */
  div[class*="overflow-x-auto"] {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  div[class*="overflow-x-auto"] table {
    min-width: 560px; /* allow horizontal scroll inside the card */
  }
  /* Header on small phones: if the pills + user block don't fit, let them
     wrap to a second row rather than force the viewport wider. */
  header div[class*="max-w-6xl"] {
    min-width: 0;
  }
  header div[class*="max-w-6xl"] > * {
    min-width: 0;
  }
  @media (max-width: 420px) {
    header div[class*="max-w-6xl"] {
      flex-wrap: wrap;
      height: auto !important;
      padding-top: 10px;
      padding-bottom: 10px;
      gap: 8px;
    }
  }
}

/* OAuth consent page (reuses card/btn primitives above). */
.consent-box {
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 12px 16px;
  margin: 12px 0;
  background: #fff;
}
.consent-domain {
  font-weight: 800;
  font-size: 1.1rem;
  margin: 4px 0 8px;
  overflow-wrap: anywhere;
}
.consent-line { margin: 6px 0; }
.consent-list { margin: 6px 0 6px 18px; }
.consent-warn { font-weight: 700; margin: 8px 0 0; }
.consent-actions { display: flex; gap: 12px; margin-top: 12px; }
.consent-actions form { margin: 0; }
