/* Quero te ouvir — Typeform-style UI */

:root {
  --bg: #ffffff;
  --bg-soft: #fdf8f3;
  --fg: #1a1a1a;
  --fg-mute: #6b6b6b;
  --accent: #ea580c;
  --accent-soft: #fff4ec;
  --accent-fg: #ffffff;
  --border: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.22);
  --shadow: 0 12px 40px rgba(234, 88, 12, 0.12);
  --radius: 14px;
  --max-w: 720px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Progress bar */
.progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(0,0,0,0.06);
  z-index: 20;
}
.progress-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  transition: width 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Top header */
.top {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 22px 28px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 10;
}
.brand {
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.back-btn {
  background: rgba(0,0,0,0.04);
  border: 1px solid var(--border);
  color: var(--fg);
  height: 36px;
  padding: 0 14px 0 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}
.back-btn:hover { background: rgba(0,0,0,0.08); border-color: var(--border-strong); }
.back-btn:active { transform: scale(0.96); }

/* Stage (question container) */
.stage {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 28px 100px;
  position: relative;
}

/* Slide animation */
.slide {
  width: 100%;
  max-width: var(--max-w);
  animation: slideIn 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.slide.out-up { animation: slideOutUp 280ms cubic-bezier(0.4, 0, 1, 1) forwards; }
.slide.out-down { animation: slideOutDown 280ms cubic-bezier(0.4, 0, 1, 1) forwards; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideOutUp {
  to { opacity: 0; transform: translateY(-28px); }
}
@keyframes slideOutDown {
  to { opacity: 0; transform: translateY(28px); }
}

/* Question text */
.q-num {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--accent); font-weight: 600;
  margin-bottom: 18px;
}
.q-num svg { width: 12px; height: 12px; }
.q-title {
  font-size: clamp(26px, 4.2vw, 38px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.q-sub {
  color: var(--fg-mute);
  font-size: 16px;
  margin-bottom: 32px;
  line-height: 1.5;
}

/* Text input */
.text-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border-strong);
  font: inherit;
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 500;
  color: var(--fg);
  padding: 14px 0;
  outline: none;
  caret-color: var(--accent);
  transition: border-color 200ms ease;
}
.text-input:focus { border-bottom-color: var(--accent); }
.text-input::placeholder { color: var(--fg-mute); opacity: 0.5; }

.textarea-input {
  width: 100%;
  background: rgba(0,0,0,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 18px;
  color: var(--fg);
  padding: 18px 20px;
  outline: none;
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
  transition: border-color 200ms ease, background 200ms ease;
}
.textarea-input:focus {
  border-color: var(--accent);
  background: rgba(0,0,0,0.06);
}

/* Choice options */
.choices {
  display: flex; flex-direction: column; gap: 10px;
}
.choice {
  display: flex; align-items: center; gap: 14px;
  background: rgba(0,0,0,0.04);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  text-align: left;
  font: inherit;
  color: var(--fg);
  font-size: 17px;
  font-weight: 500;
}
.choice:hover {
  border-color: var(--border-strong);
  background: rgba(0,0,0,0.07);
  transform: translateX(2px);
}
.choice .key {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: rgba(0,0,0,0.08);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px; font-weight: 700;
  color: var(--fg-mute);
  flex-shrink: 0;
  transition: all 180ms ease;
}
.choice:hover .key {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.choice.selected {
  border-color: var(--accent);
  background: rgba(234, 88, 12, 0.08);
}
.choice.selected .key {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.choice .check {
  margin-left: auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 180ms ease;
}
.choice.selected .check {
  background: var(--accent);
  border-color: var(--accent);
}
.choice .check svg { opacity: 0; transition: opacity 180ms ease; }
.choice.selected .check svg { opacity: 1; }

/* Slider */
.slider-wrap {
  margin-top: 8px;
}
.slider-track {
  position: relative;
  height: 56px;
  display: flex; align-items: center;
}
.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(0,0,0,0.1);
  border-radius: 999px;
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
}
.slider::-moz-range-thumb {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
}
.slider-labels {
  display: flex; justify-content: space-between;
  margin-top: 12px;
  color: var(--fg-mute);
  font-size: 14px;
}
.slider-value {
  font-size: 48px;
  font-weight: 800;
  color: var(--accent);
  text-align: center;
  letter-spacing: -0.02em;
  margin-top: 8px;
}

/* Action area */
.action {
  margin-top: 28px;
  display: flex; align-items: center; gap: 14px;
}
.btn-ok {
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: var(--radius);
  padding: 14px 28px;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.28);
}
.btn-ok:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(234, 88, 12, 0.38); }
.btn-ok:active { transform: translateY(0); }
.btn-ok:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-ok .enter-hint {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; opacity: 0.7; font-weight: 500;
}
.skip-btn {
  background: transparent;
  border: none;
  color: var(--fg-mute);
  font: inherit;
  cursor: pointer;
  padding: 14px 8px;
  font-size: 14px;
  text-decoration: underline;
}
.skip-btn:hover { color: var(--fg); }

.q-error {
  margin-top: 14px;
  color: #ff7676;
  font-size: 14px;
  min-height: 18px;
}

/* Footer */
.foot {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 14px 28px 18px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
  color: var(--fg-mute);
  z-index: 10;
  gap: 12px;
}
.foot-keys kbd {
  background: rgba(0,0,0,0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  margin: 0 2px;
}
.foot-legal { opacity: 0.7; text-align: right; }

@media (max-width: 640px) {
  .top { padding: 16px 18px; }
  .stage { padding: 70px 20px 110px; }
  .foot { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 18px 16px; }
  .foot-legal { text-align: left; }
  .foot-keys { display: none; }
  .q-title { font-size: 24px; }
}

/* Numbered check (multi click order) */
.choice .check.numbered {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-fg);
}

/* Autocomplete */
.autocomplete-wrap {
  position: relative;
}
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  margin-top: 6px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  max-height: 280px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}
.autocomplete-item {
  padding: 12px 18px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  transition: background 120ms ease, color 120ms ease;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Battery (likert pills) */
.slide-wide { max-width: 820px; }

.battery {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.battery-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 160ms ease;
}
.battery-row:hover { border-color: var(--border-strong); }
.battery-text {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--fg);
}
.battery-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.battery-pill {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 6px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 140ms ease;
}
.battery-pill:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.battery-pill.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.18);
}

@media (max-width: 640px) {
  .battery-row { padding: 12px 12px; }
  .battery-text { font-size: 14px; }
  .battery-options { gap: 4px; }
  .battery-pill {
    font-size: 11px;
    padding: 8px 2px;
    min-height: 56px;
    border-radius: 8px;
  }
}

/* Final / thank you */
.thanks {
  text-align: center;
  padding: 20px;
}
.thanks-icon {
  width: 84px; height: 84px;
  margin: 0 auto 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  display: flex; align-items: center; justify-content: center;
}
.thanks h1 {
  font-size: clamp(28px, 4.6vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.thanks p {
  color: var(--fg-mute);
  font-size: 17px;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.5;
}
