/* signal.css — Signal design system tokens, recreated from brief.
   Source of truth for the WhatsApp Revenue Audit prototype. */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700&family=Inter:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
  /* ── Surfaces ─────────────────────────────────────── */
  --paper:        #FAFAF7;   /* default background */
  --bone:         #F2F1EC;   /* secondary surface, input cards */
  --forest:       #1F4A37;   /* primary brand, inverse surface */
  --forest-2:     #173728;   /* deeper forest for hover/depth */
  --sage:         #8FA89A;   /* muted forest text on dark */
  --green-soft:   #E8EFE9;   /* selected card fill */
  --clay:         #D4956B;   /* accent — used ONCE per screen */
  --clay-deep:    #B8794D;

  /* aliases used throughout the app */
  --bg:           var(--paper);
  --bg-2:         var(--bone);
  --bg-inverse:   var(--forest);
  --brand:        var(--forest);
  --accent:       var(--clay);

  /* ── Ink scale ────────────────────────────────────── */
  --fg:           #1A1F1B;   /* primary ink */
  --fg-2:         #3D4640;
  --fg-3:         #6E7770;   /* secondary text, descriptions */
  --fg-4:         #9CA39E;   /* mono labels, hints */

  --paper-2:      rgba(247,243,237,0.82);  /* on-forest body */
  --paper-3:      rgba(247,243,237,0.62);  /* on-forest secondary */

  /* ── Lines ────────────────────────────────────────── */
  --border:       #DCD9D1;
  --border-2:     #C4C0B6;
  --hairline:     #E8E5DD;

  /* ── Type ─────────────────────────────────────────── */
  --font-display: 'Inter Tight', 'Inter Tight Fallback', system-ui, sans-serif;
  --font-body:    'Inter', 'Inter Tight Fallback', system-ui, sans-serif;
  --font-mono:    'Geist Mono', 'IBM Plex Mono', ui-monospace, monospace;

  /* ── Radii / motion ───────────────────────────────── */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --ease:         cubic-bezier(0.2, 0.6, 0.2, 1);
  --t-ui:         180ms;
  --t-reveal:     320ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

/* ── Type primitives ─────────────────────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.h-display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--fg);
  text-wrap: balance;
}
.h-headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--fg);
  text-wrap: balance;
}
.h-sub {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-3);
  text-wrap: pretty;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.025em;
  display: inline-flex;
  align-items: center;
  color: var(--fg);
}
.wordmark-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--clay);
  margin-left: 4px;
  position: relative;
  top: -1px;
}

/* ── Progress bar ────────────────────────────────────── */
.progress-track {
  height: 3px;
  background: var(--bone);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: var(--forest);
  border-radius: 999px;
  transition: width 380ms var(--ease);
}

/* ── Cards / pills ───────────────────────────────────── */
.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  transition: border var(--t-ui) var(--ease), background var(--t-ui) var(--ease), transform var(--t-ui) var(--ease);
}
.card-selectable { cursor: pointer; }
.card-selectable:hover { border-color: var(--border-2); }
.card-selected {
  border: 2px solid var(--brand) !important;
  background: var(--green-soft) !important;
}
.pill {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 16px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  color: var(--fg);
  transition: all var(--t-ui) var(--ease);
}
.pill:hover { border-color: var(--border-2); }
.pill-selected {
  border: 1.5px solid var(--brand);
  background: var(--green-soft);
  color: var(--forest);
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 52px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform var(--t-ui) var(--ease), background var(--t-ui) var(--ease), opacity var(--t-ui) var(--ease);
}
.btn-primary {
  background: var(--forest);
  color: var(--paper);
}
.btn-primary:not(:disabled):hover { background: var(--forest-2); }
.btn-primary:not(:disabled):active { transform: scale(0.985); }
.btn-final { height: 56px; font-size: 16px; }
.btn-paper {
  background: var(--paper);
  color: var(--forest);
}
.btn-paper:hover { background: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--fg-3);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bone); color: var(--fg); }

/* ── Slider ──────────────────────────────────────────── */
.signal-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  display: block;
}
.signal-slider::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(to right, var(--forest) 0% var(--fill, 0%), var(--bone) var(--fill, 0%) 100%);
  border-radius: 999px;
}
.signal-slider::-moz-range-track {
  height: 4px;
  background: var(--bone);
  border-radius: 999px;
}
.signal-slider::-moz-range-progress {
  height: 4px;
  background: var(--forest);
  border-radius: 999px;
}
.signal-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 24px; height: 24px;
  background: var(--forest);
  border: 3px solid var(--paper);
  border-radius: 50%;
  margin-top: -10px;
  box-shadow: 0 2px 8px rgba(31,74,55,0.3);
  cursor: grab;
}
.signal-slider::-moz-range-thumb {
  width: 22px; height: 22px;
  background: var(--forest);
  border: 3px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(31,74,55,0.3);
  cursor: grab;
}
.signal-slider:active::-webkit-slider-thumb { cursor: grabbing; }

/* ── Form ────────────────────────────────────────────── */
.form-label {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 8px;
}
.form-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--paper);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  color: var(--fg);
  transition: border var(--t-ui) var(--ease);
}
.form-input:focus { outline: none; border-color: var(--forest); }
.form-input::placeholder { color: var(--fg-4); font-weight: 400; }

/* ── Modal / gate ────────────────────────────────────── */
.gate-overlay {
  position: absolute;
  inset: 0;
  background: rgba(31,74,55,0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  animation: gate-fade var(--t-reveal) var(--ease);
}
.gate-card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: 28px 22px;
  width: 100%;
  max-width: 360px;
  animation: gate-rise var(--t-reveal) var(--ease);
}
@keyframes gate-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gate-rise { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Double-dot loading ──────────────────────────────── */
.double-dot {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  height: 14px;
}
.double-dot span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: dd 1.1s var(--ease) infinite;
}
.double-dot span:nth-child(2) { animation-delay: 0.15s; }
@keyframes dd {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

/* ── Step transition ─────────────────────────────────── */
.step-enter { animation: step-in var(--t-reveal) var(--ease); }
@keyframes step-in {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Report ──────────────────────────────────────────── */
.report-topbar {
  position: sticky; top: 0;
  background: var(--bone);
  padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--hairline);
  z-index: 4;
}
.report-stack { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.report-page {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 0;
  min-height: 580px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.report-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
}
.report-body { padding: 22px 18px; flex: 1; }
.report-footer {
  display: flex; justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-4);
}

.situation-block {
  background: var(--bone);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 18px;
}
.kv-grid { display: flex; flex-direction: column; }
.kv-row { display: flex; justify-content: space-between; padding: 8px 0; gap: 10px; }
.kv-label { font-size: 11.5px; color: var(--fg-3); }
.kv-value { font-family: var(--font-display); font-weight: 500; font-size: 12.5px; color: var(--fg); text-align: right; }

.forest-panel {
  background: var(--forest);
  color: var(--paper);
  border-radius: var(--r-md);
  padding: 18px;
}

.workflow-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 14px;
}
.workflow-start-here {
  border-left: 3px solid var(--forest);
  background: var(--bone);
  padding-left: 14px;
}
.start-here-tag {
  position: absolute;
  top: -8px; left: 14px;
  background: var(--clay);
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 8.5px;
  letter-spacing: 0.18em;
  padding: 3px 7px;
  border-radius: 4px;
}
.workflow-num {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--fg-4);
}
.workflow-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--fg-4);
}

.why-three {
  margin-top: 16px;
  background: var(--bone);
  border-radius: var(--r-md);
  padding: 14px;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.compare-table thead th {
  background: var(--forest);
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 12px;
  text-align: left;
}
.compare-table thead th:first-child { width: 32%; }
.compare-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
  color: var(--fg-2);
}
.compare-table tbody td:first-child { color: var(--fg-3); }
.compare-table tbody td.loss { color: var(--clay-deep); font-weight: 500; }
.compare-table tbody td.gain { color: var(--forest); font-weight: 500; }
.compare-table tr.net-row td { font-family: var(--font-display); font-weight: 600; font-size: 13px; }

.pilot-offer { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--hairline); }
.offer-cols {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 10px; margin-bottom: 18px;
}
.offer-cols > div {
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 14px 10px;
  text-align: center;
}
.offer-num { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--forest); letter-spacing: -0.02em; }
.offer-cap { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em; color: var(--fg-3); margin-top: 4px; text-transform: uppercase; }

.contact-block { background: var(--bone); border-radius: var(--r-md); padding: 14px; }
.contact-label {
  display: inline-block; width: 78px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em; color: var(--fg-3);
}

.report-actions {
  position: sticky;
  bottom: 0;
  display: flex; gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(to top, var(--bone) 60%, rgba(242,241,236,0));
  border-top: 1px solid var(--hairline);
}
.report-actions .btn { height: 46px; font-size: 14px; }

/* ── Print stylesheet ────────────────────────────────── */
@media print {
  body { background: white; }
  .no-print { display: none !important; }
  .report-stack { gap: 0; padding: 0; }
  .report-page {
    border: 0; border-radius: 0;
    width: 210mm; min-height: 297mm;
    page-break-after: always;
    padding: 0;
  }
  .report-body { padding: 28mm 22mm; }
  .report-header { padding: 14mm 22mm 8mm; }
  .report-footer { padding: 8mm 22mm 14mm; }
}
