/* ==========================================================================
   Feedback.Best — design system
   One token set, one type scale, one set of primitives. Every surface
   (public form, dashboard, builder, share) inherits from here so the product
   reads as one thing instead of three.
   ========================================================================== */

:root {
  /* ── Ink ───────────────────────────────────────────────────────────── */
  --ink:        #17150F;
  --ink-2:      #4A453C;
  --ink-3:      #837C71;
  --ink-4:      #B4ADA2;

  /* ── Paper ─────────────────────────────────────────────────────────── */
  --paper:      #FEFDFB;
  --card:       #FFFFFF;
  --sunken:     #F7F4EE;
  --line:       #E8E3D9;
  --line-soft:  #F1EDE5;

  /* ── Accent (a merchant's brand colour overrides --brand at runtime) ─ */
  --brand:        #D4A574;
  --brand-deep:   #B4854F;
  --brand-ink:    #17150F;   /* text that sits on --brand */
  --brand-wash:   #FAF3E9;
  --brand-line:   #EBD9BF;

  /* ── Semantic ──────────────────────────────────────────────────────── */
  --good:       #2F9E5F;
  --good-wash:  #EAF6EF;
  --warn:       #C98A1E;
  --warn-wash:  #FBF3E2;
  --bad:        #C9483A;
  --bad-wash:   #FBEDEB;
  --info:       #3B6FB0;
  --info-wash:  #EDF3FB;

  /* ── Type ──────────────────────────────────────────────────────────── */
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --sans:  'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;

  /* ── Radii ─────────────────────────────────────────────────────────── */
  --r-sm:  10px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-pill: 999px;

  /* ── Elevation (warm-tinted, never grey) ───────────────────────────── */
  --sh-xs: 0 1px 2px rgba(35, 28, 15, .05);
  --sh-sm: 0 2px 6px rgba(35, 28, 15, .06), 0 1px 2px rgba(35, 28, 15, .04);
  --sh-md: 0 8px 24px rgba(35, 28, 15, .08), 0 2px 6px rgba(35, 28, 15, .04);
  --sh-lg: 0 20px 48px rgba(35, 28, 15, .10), 0 4px 12px rgba(35, 28, 15, .05);
  --sh-xl: 0 32px 80px rgba(35, 28, 15, .14), 0 8px 20px rgba(35, 28, 15, .06);
  --ring:  0 0 0 3px rgba(212, 165, 116, .32);

  /* ── Motion ────────────────────────────────────────────────────────── */
  --ease:      cubic-bezier(.22, 1, .36, 1);
  --ease-in:   cubic-bezier(.5, 0, .75, 0);
  --t-fast:    .15s;
  --t-base:    .25s;
  --t-slow:    .45s;

  --shell: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 { margin: 0; color: var(--ink); font-weight: 600; line-height: 1.15; }
p  { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a  { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

/* Author display rules (grid/flex) otherwise beat the UA stylesheet's
   [hidden] { display: none }, leaving "hidden" elements on screen. */
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--brand-deep);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Display type — the serif is for headlines only, never body copy. */
.display {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: 1.08;
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.muted     { color: var(--ink-3); }
.small     { font-size: 13px; }
.tabnum    { font-variant-numeric: tabular-nums; }

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.005em;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform var(--t-fast) var(--ease),
              box-shadow var(--t-base) var(--ease),
              background var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease),
              color var(--t-base) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; pointer-events: none; }

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--sh-sm);
}
.btn-primary:hover { background: #262218; box-shadow: var(--sh-md); }

.btn-brand {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 34%, transparent);
}
.btn-brand:hover {
  background: var(--brand-deep);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 42%, transparent);
}

.btn-ghost {
  background: var(--card);
  color: var(--ink-2);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink-4); color: var(--ink); }

.btn-quiet { background: transparent; color: var(--ink-3); }
.btn-quiet:hover { color: var(--ink); background: var(--sunken); }

.btn-danger { background: var(--bad-wash); color: var(--bad); border-color: transparent; }
.btn-danger:hover { background: #F6DDD9; }

.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; gap: 6px; }
.btn-lg { min-height: 56px; padding: 0 30px; font-size: 16.5px; }
.btn-block { width: 100%; }
.btn svg { width: 17px; height: 17px; flex: none; }

/* ── Surfaces ────────────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}
.card-pad { padding: 24px; }

/* ── Pills & badges ──────────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  background: var(--sunken);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill-good { background: var(--good-wash); color: var(--good); }
.pill-warn { background: var(--warn-wash); color: var(--warn); }
.pill-bad  { background: var(--bad-wash);  color: var(--bad); }
.pill-info { background: var(--info-wash); color: var(--info); }
.pill-brand{ background: var(--brand-wash); color: var(--brand-deep); }

/* ── Fields ──────────────────────────────────────────────────────────── */

.field { display: block; margin-bottom: 18px; }
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
/* Always its own line: a hint that follows an inline control (a toggle,
   say) otherwise wraps around it and reads as part of the label. */
.field-hint { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }

.input, .textarea, .select {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 15px;
  color: var(--ink);
  transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}
.textarea { min-height: 104px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23837C71' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

/* ── Toggle ──────────────────────────────────────────────────────────── */

.toggle { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: relative;
  width: 42px; height: 24px;
  flex: none;
  border-radius: var(--r-pill);
  background: #DCD6CA;
  transition: background var(--t-base) var(--ease);
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--sh-xs);
  transition: transform var(--t-base) var(--ease);
}
.toggle input:checked + .toggle-track { background: var(--brand-deep); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-track { box-shadow: var(--ring); }
.toggle-text { font-size: 14px; color: var(--ink-2); }

/* ── Stars ───────────────────────────────────────────────────────────── */

.stars { display: inline-flex; gap: 2px; color: var(--brand); letter-spacing: .04em; }
.stars-muted { color: var(--ink-4); }

/* ── Toast ───────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--sh-lg);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 16px; height: 16px; }

/* ── Skeleton / empty ────────────────────────────────────────────────── */

.empty {
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
}
.empty-icon {
  width: 52px; height: 52px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-wash);
  color: var(--brand-deep);
}
.empty h3 { font-size: 17px; margin-bottom: 6px; }
.empty p  { font-size: 14px; color: var(--ink-3); max-width: 380px; margin: 0 auto; }

/* ── Utilities ───────────────────────────────────────────────────────── */

.row  { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@keyframes fb-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise { animation: fb-rise var(--t-slow) var(--ease) both; }
.rise-1 { animation-delay: .05s; }
.rise-2 { animation-delay: .10s; }
.rise-3 { animation-delay: .15s; }
.rise-4 { animation-delay: .20s; }

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