/* ============================================================================
 * GR Solutions — Review Funnel · STYLES
 * Bold & premium · high contrast · mobile-first · gold stars
 * ========================================================================== */

/* ---- Design tokens · OPULENT OBSIDIAN + GOLD ---------------------------- */
:root {
  --bg:        #0a0805;                     /* deep warm obsidian */
  --bg-2:      #14100a;                     /* raised dark surface */
  --card:      #16110a;
  --ink:       #f8eccd;                     /* warm champagne cream */
  --ink-soft:  #e6d4a6;
  --muted:     #b29a6a;                     /* antique muted gold */
  --line:      rgba(214,178,94,.30);
  --line-soft: rgba(214,178,94,.18);

  --gold-1:    #FFE8A8;                      /* light champagne */
  --gold-2:    #E8B23A;                      /* rich gold */
  --gold-deep: #9c7016;                      /* deep antique */

  /* metallic gold-foil gradient for buttons, headlines, accents */
  --gold-foil: linear-gradient(135deg, #FBE7A8 0%, #E9C25B 26%, #B8841E 52%, #F6DE92 74%, #D7A93B 100%);
  --gold-glow: rgba(232,178,58,.45);

  --primary:       #111114;
  --primary-press: #000000;
  --on-primary:    #1c1404;

  --good:      #46c98a;
  --good-tint: rgba(70,201,138,.14);

  --radius:    26px;
  --radius-sm: 16px;
  --radius-pill: 999px;

  --shadow-card:
    0 0 0 1px rgba(0,0,0,.5),
    0 0 70px -12px var(--gold-glow),
    0 44px 90px -34px rgba(0,0,0,.85),
    inset 0 1px 0 rgba(255,235,180,.20);
  --shadow-btn:  0 0 0 1px rgba(255,235,180,.45) inset, 0 12px 30px -8px var(--gold-glow), 0 2px 5px rgba(0,0,0,.5);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;

  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(130% 90% at 50% -20%, rgba(232,178,58,.20), transparent 55%),
    radial-gradient(100% 80% at 50% 120%, rgba(184,120,30,.16), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in oklab, var(--gold-2), #000 6%); outline-offset: 3px; border-radius: 6px; }

/* ---- App shell ----------------------------------------------------------- */
.app {
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: clamp(16px, 5vw, 40px);
}
.stage {
  width: 100%;
  max-width: 460px;
  margin: auto;
  position: relative;
}

/* ---- Card + screen transitions ------------------------------------------ */
.card {
  background:
    linear-gradient(180deg, rgba(255,228,160,.06), transparent 32%),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: clamp(26px, 7vw, 40px);
  position: relative;
  overflow: hidden;
}
.card::before { /* gold top sheen */
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 130px;
  background: linear-gradient(180deg, rgba(255,226,150,.12), transparent);
  pointer-events: none;
}
.card::after { /* hairline gold inner frame for that gaudy ornate edge */
  content: "";
  position: absolute; inset: 9px;
  border: 1px solid rgba(214,178,94,.22);
  border-radius: calc(var(--radius) - 9px);
  pointer-events: none;
}

.screen { display: none; }
.screen.is-active {
  display: block;
  transition: transform .5s var(--ease);
}
/* Entrance: JS adds .enter for one frame, then removes it so the screen
   slides into place. Transform-only on purpose — opacity always stays 1, so
   content can NEVER be stranded invisible if a render/capture context freezes
   the transition at frame 0. */
.screen.is-active.enter {
  transform: translateY(12px) scale(.985);
}
@media (prefers-reduced-motion: reduce) {
  .screen.is-active { transition: none; }
}

/* ---- Brand header (name + optional logo) --------------------------------
   NOTE: block layout (not flex). background-clip:text drops wrapped lines on
   flex items, so the gold-foil business name / headline must not be flex kids. */
.brand {
  text-align: center;
  margin-bottom: 30px;
}
.brand__logo {
  width: 64px; height: 64px;
  object-fit: contain;
  border-radius: 16px;
  margin: 0 auto 14px;
  display: none;            /* shown by JS only when a logo URL exists */
}
.brand__logo.is-shown { display: block; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 6.4vw, 30px);
  letter-spacing: -.02em;
  line-height: 1.18;
  margin: 0;
  padding-bottom: 2px;
  text-wrap: balance;
  background: var(--gold-foil);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold-2);
}
.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-2);
}

/* ---- Headline ------------------------------------------------------------ */
.headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 7.6vw, 34px);
  letter-spacing: -.025em;
  line-height: 1.12;
  margin: 0 0 8px;
  text-align: center;
  text-wrap: balance;
  background: var(--gold-foil);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold-2);
}
.subhead {
  margin: 0 auto;
  max-width: 34ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  text-align: center;
  text-wrap: pretty;
}

/* ---- Stars --------------------------------------------------------------- */
.stars {
  display: flex;
  justify-content: center;
  gap: clamp(6px, 2.5vw, 12px);
  margin: 30px 0 8px;
}
.star {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px;
  border-radius: 16px;
  line-height: 0;
  transition: transform .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.star svg { width: clamp(40px, 12.5vw, 54px); height: auto; display: block; }
.star .s-fill { opacity: 0; transform-origin: center; transition: opacity .14s var(--ease); }
.star .s-stroke { stroke: rgba(214,178,94,.42); stroke-width: 6; fill: rgba(255,255,255,.02); transition: stroke .14s var(--ease); }

/* lit state (driven by JS hover/selection) */
.star.is-lit .s-fill { opacity: 1; }
.star.is-lit .s-stroke { stroke: var(--gold-deep); }
.star.is-lit { filter: drop-shadow(0 0 12px rgba(232,178,58,.6)); }
.star:not(:disabled):hover { transform: translateY(-3px); }
.star:not(:disabled):active { transform: translateY(0) scale(.92); }
.star.pop { animation: star-pop .42s var(--ease); }
@keyframes star-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); }
  100% { transform: scale(1); }
}
.stars-hint {
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .01em;
  min-height: 20px;
  margin-top: 6px;
  transition: color .2s var(--ease);
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 16px 22px;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none;
  transition: transform .16s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.btn--primary {
  background: var(--gold-foil);
  color: var(--on-primary);
  box-shadow: var(--shadow-btn);
  text-shadow: 0 1px 0 rgba(255,255,255,.3);
  font-weight: 800;
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,235,180,.6) inset, 0 16px 38px -8px var(--gold-glow), 0 2px 5px rgba(0,0,0,.5); }
.btn--primary:active { transform: translateY(0); filter: brightness(.94); }
.btn--ghost {
  background: transparent;
  color: var(--muted);
  min-height: 46px;
  font-weight: 600;
  font-size: 15px;
}
.btn--ghost:hover { color: var(--ink); }
.btn svg { width: 20px; height: 20px; }

/* ---- Google review screen ------------------------------------------------ */
.celebrate {
  width: 76px; height: 76px;
  margin: 4px auto 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  box-shadow: 0 14px 30px -12px var(--gold-deep);
}
.celebrate svg { width: 40px; height: 40px; }
.gicon { width: 22px; height: 22px; }

/* ---- Feedback screen ----------------------------------------------------- */
.field { margin-top: 22px; text-align: left; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink-soft);
}
.textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  padding: 16px;
  font: inherit;
  font-size: 16px;            /* >=16px prevents iOS zoom-on-focus */
  line-height: 1.5;
  color: var(--ink);
  background: rgba(255,255,255,.03);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .18s var(--ease), background .18s, box-shadow .18s;
}
.textarea::placeholder { color: rgba(178,154,106,.7); }
.textarea:focus { outline: 0; border-color: var(--gold-2); background: rgba(255,255,255,.05); box-shadow: 0 0 0 3px rgba(232,178,58,.16); }

/* Optional follow-up (name + phone) — reuses the feedback field vocabulary */
.input {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-size: 16px;            /* >=16px prevents iOS zoom-on-focus */
  line-height: 1.4;
  color: var(--ink);
  background: rgba(255,255,255,.03);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .18s var(--ease), background .18s, box-shadow .18s;
}
.input::placeholder { color: rgba(178,154,106,.7); }
.input:focus { outline: 0; border-color: var(--gold-2); background: rgba(255,255,255,.05); box-shadow: 0 0 0 3px rgba(232,178,58,.16); }
.followup {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  text-align: left;
}
.followup__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -.01em;
  margin: 0;
  background: var(--gold-foil);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold-2);
}
.followup__desc {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}
.followup__field { margin-top: 16px; }
.followup .opt { color: var(--muted); font-weight: 600; }
.field-error {
  color: #ff7a6b;
  font-size: 13.5px;
  font-weight: 600;
  margin: 8px 2px 0;
  min-height: 18px;
}
.actions { margin-top: 22px; display: grid; gap: 10px; }

/* ---- Status screens (loading / unavailable / thanks) -------------------- */
.status { text-align: center; padding: 16px 0; }
.spinner {
  width: 46px; height: 46px;
  margin: 8px auto 20px;
  border-radius: 50%;
  border: 4px solid rgba(214,178,94,.22);
  border-top-color: var(--gold-2);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status-emoji {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(232,178,58,.12);
  border: 1px solid rgba(232,178,58,.3);
}
.status-emoji svg { width: 36px; height: 36px; }
.status-emoji--good { background: var(--good-tint); border-color: rgba(70,201,138,.35); }

/* ---- Footer (Powered by) ------------------------------------------------- */
.foot {
  text-align: center;
  padding: 22px 12px 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.foot a { color: var(--ink-soft); text-decoration: none; font-weight: 700; }
.foot a:hover { text-decoration: underline; }
.foot__dot { opacity: .4; margin: 0 8px; }
.secure { display: inline-flex; align-items: center; gap: 5px; }
.secure svg { width: 13px; height: 13px; opacity: .55; }

/* ---- Confetti canvas ----------------------------------------------------- */
#confetti {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 50;
}

.u-spacer { height: 26px; }
[hidden] { display: none !important; }
