/* ============================================================================
   Click Sales — Diagnóstico de e-commerce
   Estilo ancorado no Design System V2 (Archivo display, verde-petróleo,
   two-mode surface, camada cinematográfica controlada).
   ========================================================================== */

/* ---- Tokens ------------------------------------------------------------- */
:root {
  --primary:        #0D4D3F;
  --primary-dark:   #093A30;
  --primary-pale:   #E8F0EE;
  --primary-light:  #2E9C82;
  --primary-cta:    #107A5E;
  --primary-cta-hover: #127E60;

  --canvas:         #FAFAF7;
  --canvas-pure:    #FFFFFF;
  --surface-soft:   #F2F2EE;
  --surface-dark:   #0A0E1A;
  --surface-elev-dark: #1A1F2E;
  --cine:           #05110C;
  --hairline:       #E5E7EB;
  --hairline-strong:#5A6478;

  --ink:    #0A0E1A;
  --body:   #1A1F2E;
  --mute:   #5A6478;
  --stone:  #8A91A0;
  --on-dark:#FFFFFF;
  --on-dark-mute: rgba(255,255,255,0.70);

  --warning:#B8732D;
  --error:  #C44826;

  --r-sm: 4px;
  --r-md: 6px;
  --r-cine: 16px;
  --r-cine-inner: 8px;

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

  --display: 'Archivo', system-ui, sans-serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--sans);
  background: var(--canvas);
  color: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  letter-spacing: -0.022em;
  line-height: 1.08;
  font-weight: 800;
}

/* ---- Shell ------------------------------------------------------------- */
.app {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  position: relative;
  overflow: hidden;
}

/* topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px 14px;
  position: relative;
}
.topbar.hidden { display: none; }
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand .wedge { width: 22px; height: 22px; flex-shrink: 0; }
.brand-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 3px 7px;
  margin-left: 4px;
}
.btn-back {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--canvas-pure);
  color: var(--mute);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn-back.visible { display: flex; }
.btn-back:hover { border-color: var(--primary); color: var(--primary); }

/* progress */
.progress {
  height: 3px;
  background: var(--hairline);
  position: relative;
  overflow: hidden;
}
.progress.hidden { display: none; }
.progress-bar {
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width .5s var(--ease);
}

/* content area */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ---- Step base --------------------------------------------------------- */
.step { display: none; padding: 26px 22px 36px; }
.step.active { display: block; animation: stepIn .42s var(--ease); }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .step.active { animation: none; }
}

.q-head { margin-bottom: 22px; }
.q-title { font-size: clamp(24px, 6vw, 30px); }
.q-title strong { color: var(--primary); font-weight: 800; }
.q-sub {
  margin-top: 9px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--mute);
}

/* ---- Capa (cinematográfica) -------------------------------------------- */
.cover {
  padding: 0;
  background: var(--surface-dark);
  min-height: calc(100dvh - 0px);
}
.cover-inner {
  position: relative;
  padding: 40px 24px 32px;
  background:
    radial-gradient(120% 80% at 78% 8%, rgba(46,156,130,0.20), transparent 55%),
    radial-gradient(90% 60% at 12% 100%, rgba(13,77,63,0.30), transparent 60%),
    var(--cine);
  overflow: hidden;
}
.cover-inner::after {
  /* grão sutil */
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
}
.cover-brand {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 30px;
  position: relative; z-index: 1;
}
.cover-brand .brand-name { color: var(--on-dark); }
.cover-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--primary-light);
  margin-bottom: 16px;
  position: relative; z-index: 1;
}
.cover-kicker .tick {
  width: 9px; height: 9px;
  background: var(--primary-light);
  clip-path: polygon(0 0, 0 100%, 100% 50%);
}
.cover h1 {
  color: var(--on-dark);
  font-size: clamp(30px, 8.5vw, 42px);
  line-height: 1.04;
  font-weight: 800;
  position: relative; z-index: 1;
}
.cover .punch {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(16px, 4.4vw, 20px);
  color: var(--primary-light);
  margin-top: 14px;
  line-height: 1.3;
  position: relative; z-index: 1;
}
.cover-cards {
  margin-top: 26px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative; z-index: 1;
}
.anchor-card {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(5px) saturate(140%);
  -webkit-backdrop-filter: blur(5px) saturate(140%);
  border-radius: var(--r-cine);
  padding: 16px 17px;
  position: relative;
  overflow: hidden;
}
.anchor-card .ac-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 7px;
}
.anchor-card .ac-num {
  font-family: var(--mono);
  font-size: 11px; font-weight: 700;
  color: var(--surface-dark);
  background: var(--primary-light);
  border-radius: var(--r-cine-inner);
  padding: 3px 7px;
  letter-spacing: 0.04em;
}
.anchor-card .ac-title {
  font-family: var(--display);
  font-weight: 700; font-size: 16px;
  color: var(--on-dark);
}
.anchor-card p {
  font-size: 13.5px; line-height: 1.5;
  color: var(--on-dark-mute);
}
.cover-cta-wrap {
  margin-top: 24px;
  position: relative; z-index: 1;
}
.cover .micro {
  text-align: center;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-mute);
}

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 22px;
  font-family: var(--sans);
  font-weight: 600; font-size: 15px;
  border: none; border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary-cta);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover { background: var(--primary-cta-hover); }
.btn-primary[disabled] {
  background: #C7CBD1; color: #fff; cursor: not-allowed; box-shadow: none;
}
.btn-primary .arrow {
  width: 26px; height: 26px; border-radius: var(--r-sm);
  background: rgba(255,255,255,0.16);
  display: flex; align-items: center; justify-content: center;
}
/* primário sobre dark ganha o anel light */
.cover .btn-primary,
.cine-band .btn-primary {
  box-shadow: inset 0 0 0 1px rgba(46,156,130,0.40), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--hairline);
}
.btn-ghost:hover { border-color: var(--primary); }

/* ---- Options (single-select) ------------------------------------------- */
.options { display: flex; flex-direction: column; gap: 11px; }
.option-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 16px 16px;
  background: var(--canvas-pure);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: left;
  transition: border-color .18s, background .18s, transform .12s var(--ease);
  position: relative;
}
.option-btn:hover { border-color: var(--primary-light); transform: translateX(2px); }
.option-btn.selected {
  border-color: var(--primary);
  background: var(--primary-pale);
}
.option-emoji {
  font-size: 19px; width: 26px; text-align: center; flex-shrink: 0;
  filter: saturate(0.92);
}
.option-label {
  flex: 1;
  font-size: 15px; font-weight: 500; color: var(--ink);
  line-height: 1.3;
}
.option-arrow {
  width: 26px; height: 26px; border-radius: 999px;
  background: var(--surface-soft);
  color: var(--mute);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .18s, color .18s;
}
.option-btn:hover .option-arrow { background: var(--primary); color: #fff; }
.option-btn.selected .option-arrow { background: var(--primary); color: #fff; }

/* ---- Chips (multi-select) ---------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 15px;
  background: var(--canvas-pure);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--primary-light); }
.chip .chip-emoji { font-size: 15px; }
.chip.selected {
  border-color: var(--primary);
  background: var(--primary-pale);
  color: var(--primary);
}
.chip.selected::before {
  content: '✓';
  font-weight: 700; color: var(--primary);
}
.step-actions { margin-top: 26px; }

/* ---- URL input --------------------------------------------------------- */
.field-label {
  display: block;
  font-size: 13px; font-weight: 600; color: var(--ink);
  margin-bottom: 8px;
}
.text-input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--canvas-pure);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  transition: border-color .18s, box-shadow .18s;
}
.text-input::placeholder { color: var(--stone); }
.text-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,77,63,0.12);
}
.text-input.input-error { border-color: var(--error); }
.hint {
  display: flex; align-items: center; gap: 7px;
  margin: 12px 0;
  padding: 11px 13px;
  font-size: 13px; line-height: 1.4;
  background: rgba(184,115,45,0.08);
  border: 1px solid rgba(184,115,45,0.25);
  border-radius: var(--r-sm);
  color: var(--warning);
}
.hint.error { background: rgba(196,72,38,0.08); border-color: rgba(196,72,38,0.3); color: var(--error); }
.field-error { font-size: 12.5px; color: var(--error); margin-top: 6px; display: none; }
.field-error.visible { display: block; }

/* ---- Loading (scan honesto) -------------------------------------------- */
.loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh;
  text-align: center;
}
.scan { width: 200px; height: 200px; position: relative; }
.scan-label {
  margin-top: 26px;
  font-size: 15px; color: var(--mute);
}
.scan-sub {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--stone);
  min-height: 14px;
}

/* ---- Gate (lead form) -------------------------------------------------- */
.gate-fields { display: flex; flex-direction: column; gap: 16px; margin-top: 6px; }
.gate-field { display: flex; flex-direction: column; }
.gate .lock {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 16px;
  font-size: 12px; color: var(--stone);
}
.honey { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

/* ---- Resultado --------------------------------------------------------- */
.result-headline { margin-bottom: 4px; }

/* faixa cinematográfica do gargalo (1 momento cinematográfico do resultado) */
.cine-band {
  position: relative;
  margin: 0 -22px 24px;
  padding: 28px 22px;
  background:
    radial-gradient(110% 80% at 85% 0%, rgba(46,156,130,0.18), transparent 55%),
    var(--cine);
  overflow: hidden;
}
.cine-band .gargalo-kicker {
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--primary-light);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.cine-band .gargalo-kicker .dot {
  width: 7px; height: 7px; border-radius: 999px; background: var(--primary-light);
  box-shadow: 0 0 0 0 rgba(46,156,130,0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46,156,130,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(46,156,130,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,156,130,0); }
}
.cine-band .gargalo-name {
  color: var(--on-dark);
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.06;
}
.cine-band .gargalo-name em {
  font-style: normal; color: var(--primary-light);
}
.cine-band .gargalo-desc {
  color: var(--on-dark-mute);
  font-size: 14px; line-height: 1.55;
  margin-top: 12px;
  max-width: 92%;
}

/* maturidade */
.maturity { margin: 8px 0 28px; }
.maturity-title { font-size: 17px; margin-bottom: 4px; }
.maturity-cap { font-size: 13.5px; color: var(--mute); margin-bottom: 16px; }
.maturity-track {
  position: relative; height: 7px; border-radius: 999px;
  background: linear-gradient(90deg, #C44826 0%, #B8732D 38%, #2E9C82 100%);
}
.maturity-marker {
  position: absolute; top: 50%;
  width: 20px; height: 20px; border-radius: 999px;
  background: #fff; border: 3px solid var(--ink);
  transform: translate(-50%, -50%);
  left: 0;
  transition: left 1s var(--ease);
}
.maturity-scale {
  display: flex; justify-content: space-between;
  margin-top: 10px;
  font-size: 11px; color: var(--stone);
}
.maturity-scale span.on { color: var(--ink); font-weight: 600; }

/* radar */
.section-title { font-size: 19px; margin-bottom: 4px; text-align: center; }
.section-cap { font-size: 13.5px; color: var(--mute); text-align: center; margin-bottom: 8px; }
.radar-wrap { display: flex; justify-content: center; margin: 4px 0 18px; }
.radar-wrap svg { width: 100%; max-width: 420px; height: auto; }

/* pilares */
.pillars { display: flex; flex-direction: column; gap: 11px; }
.pillar {
  border: 1px solid var(--hairline);
  border-left-width: 3px;
  border-radius: var(--r-sm);
  background: var(--canvas-pure);
  padding: 14px 15px;
}
.pillar-head {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 6px;
}
.pillar-dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.pillar-name { flex: 1; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.pillar-badge {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; border: 1px solid;
}
.pillar-obs { font-size: 13px; line-height: 1.5; color: var(--body); }

.ticket-callout {
  margin: 22px 0 4px;
  padding: 16px 17px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--surface-soft);
}
.ticket-callout .tc-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mute); margin-bottom: 6px;
}
.ticket-callout .tc-value {
  font-family: var(--mono); font-weight: 700; font-size: 26px;
  color: var(--primary); letter-spacing: -1px;
}
.ticket-callout .tc-value small {
  font-family: var(--sans); font-weight: 500; font-size: 12px; color: var(--mute);
  letter-spacing: 0; margin-left: 6px;
}
.ticket-callout .tc-note { font-size: 12.5px; color: var(--mute); margin-top: 6px; line-height: 1.45; }

/* observações reais do site (Gemini) */
.site-obs {
  margin: 18px 0 4px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--canvas-pure);
  padding: 15px 16px;
}
.site-obs .so-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--ink);
  margin-bottom: 11px;
}
.site-obs .so-icon { color: var(--primary); display: flex; }
.so-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.so-list li {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13px; line-height: 1.5; color: var(--body);
}
.so-list li::before {
  content: ''; width: 6px; height: 6px; margin-top: 6px; flex-shrink: 0;
  background: var(--primary-light); clip-path: polygon(0 0, 0 100%, 100% 50%);
}

/* ---- Tela de roteamento (CTA final) ------------------------------------ */
.route { padding-top: 8px; }
.route .next-tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--primary); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.route .next-tag .tick { width: 8px; height: 8px; background: var(--primary); clip-path: polygon(0 0,0 100%,100% 50%); }
.route h2 { font-size: clamp(23px, 6vw, 29px); }
.route .route-lead { font-size: 15px; line-height: 1.55; color: var(--mute); margin-top: 10px; }
.route-list { list-style: none; margin: 20px 0; display: flex; flex-direction: column; gap: 11px; }
.route-list li {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: 14.5px; color: var(--body); line-height: 1.4;
}
.route-list .ck {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px;
  border-radius: 999px; background: var(--primary-pale); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.route-card {
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: 20px;
}
.route-card .rc-head {
  background: var(--surface-soft);
  padding: 12px 15px;
  font-size: 13px; font-weight: 600; color: var(--ink);
  border-bottom: 1px solid var(--hairline);
}
.route-card .rc-body { padding: 15px; }

/* ---- Confirmação ------------------------------------------------------- */
.confirm { text-align: center; padding-top: 24px; }
.confirm .check {
  width: 56px; height: 56px; margin: 0 auto 18px;
  border-radius: 999px; background: var(--primary-pale);
  display: flex; align-items: center; justify-content: center;
}
.confirm h2 { font-size: 25px; }
.confirm p { font-size: 14.5px; color: var(--mute); margin-top: 10px; line-height: 1.55; }

/* ---- Footer ------------------------------------------------------------ */
.foot {
  text-align: center;
  padding: 22px;
  font-size: 11px; color: var(--stone);
  line-height: 1.5;
}
.foot.on-dark { color: var(--on-dark-mute); }

/* ---- Util -------------------------------------------------------------- */
.hidden { display: none !important; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 600px) {
  .app { box-shadow: 0 0 0 1px var(--hairline); }
  .step { padding: 30px 30px 40px; }
  .cine-band { margin-left: -30px; margin-right: -30px; padding-left: 30px; padding-right: 30px; }
  .cover-inner { padding: 48px 34px 36px; }
}
