/* ============================================
   THEME
   ============================================ */
:root {
  --black: #0a0a0a;
  --black-light: #111111;
  --cream: #f5f2eb;
  --gray-200: #e8e4db;
  --gray-300: #d4cfc3;
  --gray-400: #9c9588;
  --gray-500: #6b655a;
  --gray-600: #4a453b;
  --gray-700: #2d2a24;
  --gray-800: #1a1816;
  --gray-900: #0a0a0a;
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--black);
  color: var(--cream);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--black);
  border-bottom: 1px solid var(--gray-800);
}

.header-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-mark {
  width: 2rem;
  height: 2rem;
  background: var(--cream);
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 900;
  color: var(--black);
  letter-spacing: -0.05em;
}

.logo-mark.logo-img {
  object-fit: contain;
  padding: 0.3rem;
}

.logo-text {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.progress-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-text {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-500);
  min-width: 3rem;
  text-align: right;
}

.progress-track {
  display: flex;
  gap: 3px;
  align-items: center;
}

.progress-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-700);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-dot.active {
  width: 8px;
  height: 8px;
  background: var(--cream);
  box-shadow: 0 0 8px rgba(245, 242, 235, 0.4);
}

.progress-dot.completed {
  background: var(--gray-500);
}

.progress-bar-container {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gray-800);
}

.progress-bar-fill {
  height: 100%;
  background: var(--cream);
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   LAYOUT
   ============================================ */
.main {
  padding-top: 5rem;
  padding-bottom: 6rem;
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================
   STEPS
   ============================================ */
.step {
  display: none;
  opacity: 0;
  transform: translateX(20px);
}

.step.active {
  display: block;
  animation: stepIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.step.exiting {
  animation: stepOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes stepIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes stepOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-30px); }
}

/* ============================================
   STEP HEADER
   ============================================ */
.step-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-800);
}

.step-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.step-tag-line {
  width: 1.5rem;
  height: 2px;
  background: var(--gray-600);
}

.step-tag-text {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.step-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.375rem;
}

.step-subtitle {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* ============================================
   QUESTIONS
   ============================================ */
.question {
  margin-bottom: 1.75rem;
}

.question-label {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.875rem;
  color: var(--gray-200);
}

.question-followup {
  margin-top: 0.5rem;
}

.question-followup[hidden] {
  display: none;
}

/* ============================================
   OPTION CARDS
   ============================================ */
.option-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.125rem;
  background: var(--black-light);
  border: 1.5px solid var(--gray-800);
  border-radius: 0.625rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.option-card:hover {
  border-color: var(--gray-600);
  background: var(--gray-900);
}

.option-card:active { transform: scale(0.985); }

.option-card.selected {
  border-color: var(--cream);
  background: linear-gradient(135deg, rgba(245, 242, 235, 0.08) 0%, rgba(245, 242, 235, 0.03) 100%);
  box-shadow:
    0 0 0 1px var(--cream),
    inset 0 1px 0 rgba(245, 242, 235, 0.05);
}

.option-card.just-selected {
  animation: selectPulse 0.4s ease;
}

@keyframes selectPulse {
  0%   { transform: scale(0.985); }
  50%  { transform: scale(1.01); }
  100% { transform: scale(1); }
}

.option-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option-indicator {
  width: 1.375rem;
  height: 1.375rem;
  border: 2px solid var(--gray-600);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.option-card:hover .option-indicator { border-color: var(--gray-400); }
.option-card.selected .option-indicator { border-color: var(--cream); background: var(--cream); }

.option-card.selected .option-indicator::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0.5rem; height: 0.5rem;
  background: var(--black);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: indicatorIn 0.2s ease forwards;
}

@keyframes indicatorIn {
  to { transform: translate(-50%, -50%) scale(1); }
}

.option-card.checkbox .option-indicator { border-radius: 0.3rem; }
.option-card.checkbox.selected .option-indicator { background: var(--cream); }

.option-card.checkbox.selected .option-indicator::after {
  width: 0.375rem;
  height: 0.625rem;
  background: transparent;
  border: solid var(--black);
  border-width: 0 2px 2px 0;
  border-radius: 0;
  transform: translate(-50%, -60%) rotate(45deg) scale(0);
  animation: checkIn 0.2s ease forwards;
}

@keyframes checkIn {
  to { transform: translate(-50%, -60%) rotate(45deg) scale(1); }
}

.option-text {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-300);
  transition: color 0.2s ease;
}

.option-card.selected .option-text { color: var(--cream); }

.option-grid.cols-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.option-grid.cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.option-grid.cols-3 .option-card {
  flex-direction: column;
  text-align: center;
  padding: 1.25rem 1rem;
  gap: 0.75rem;
}

.option-grid.cols-3 .option-indicator { margin: 0 auto; }

.col-span-2 { grid-column: span 2; }

/* ============================================
   SCALE (1-10)
   ============================================ */
.scale-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.scale-numbers {
  display: flex;
  gap: 0.375rem;
}

.scale-btn {
  flex: 1;
  aspect-ratio: 1;
  min-width: 0;
  max-width: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black-light);
  border: 1.5px solid var(--gray-800);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray-400);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.scale-btn:hover { border-color: var(--gray-500); color: var(--gray-200); }
.scale-btn:active { transform: scale(0.9); }

.scale-btn:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}

.scale-btn.selected {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--black);
  box-shadow: 0 0 16px rgba(245, 242, 235, 0.3);
  transform: scale(1.05);
}

.scale-btn.just-selected {
  animation: scalePop 0.3s ease;
}

@keyframes scalePop {
  0%   { transform: scale(0.9); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1.05); }
}

/* ============================================
   TEXT INPUTS
   ============================================ */
.input {
  width: 100%;
  padding: 1rem 1.125rem;
  background: var(--black-light);
  border: 1.5px solid var(--gray-800);
  border-radius: 0.625rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--cream);
  transition: all 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: var(--cream);
  box-shadow: 0 0 0 3px rgba(245, 242, 235, 0.1);
}

.input::placeholder { color: var(--gray-600); }

textarea.input {
  resize: none;
  min-height: 8rem;
}

.input.input-invalid {
  border-color: #b86d6d;
}

.input.input-invalid:focus {
  box-shadow: 0 0 0 3px rgba(184, 109, 109, 0.15);
}

.field-error {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: #d4a3a3;
  font-weight: 500;
}

.field-error[hidden] { display: none; }

/* Honeypot: oculto a usuarios, visible/atractivo a bots */
.honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  tab-size: -1;
}

/* ============================================
   NAVIGATION FOOTER
   ============================================ */
.nav-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--black);
  border-top: 1px solid var(--gray-800);
  padding: 1rem 1.5rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

.nav-footer.hidden { display: none; }

.submit-error {
  max-width: 480px;
  margin: 0 auto 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(184, 109, 109, 0.12);
  border: 1px solid rgba(184, 109, 109, 0.35);
  border-radius: 0.5rem;
  color: #d4a3a3;
  font-size: 0.8125rem;
  text-align: center;
  font-weight: 500;
}

.nav-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  gap: 0.75rem;
}

.btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border: 1.5px solid var(--gray-700);
  border-radius: 0.625rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

.btn-ghost {
  background: transparent;
  color: var(--gray-500);
  border-color: transparent;
  flex: 0 0 auto;
  padding: 1rem;
  min-width: 3rem;
}

.btn-ghost:hover { color: var(--cream); }

.btn-primary {
  background: var(--cream);
  color: var(--black);
  border-color: var(--cream);
}

.btn-primary:hover { background: var(--gray-200); }

.btn-primary:disabled {
  background: var(--gray-800);
  border-color: var(--gray-800);
  color: var(--gray-600);
  cursor: not-allowed;
}

.btn-primary:disabled:active { transform: scale(1); }

/* ============================================
   WELCOME STEP
   ============================================ */
.welcome-content {
  text-align: center;
  padding: 4rem 0;
}

.welcome-logo {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 2rem;
  background: var(--cream);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: var(--black);
  letter-spacing: -0.05em;
}

.welcome-title {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 1rem;
}

.welcome-subtitle {
  font-size: 1rem;
  color: var(--gray-400);
  max-width: 280px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.welcome-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
  border-radius: 2rem;
}

.welcome-meta-dot {
  width: 6px;
  height: 6px;
  background: var(--gray-500);
  border-radius: 50%;
}

.welcome-meta-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.welcome-completed-msg {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.65rem 1rem;
  background: rgba(201, 228, 165, 0.1);
  border: 1px solid rgba(201, 228, 165, 0.35);
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #c9e4a5;
}

.welcome-completed-msg[hidden] {
  display: none;
}

.welcome-completed-msg::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c9e4a5;
  flex-shrink: 0;
}

/* ============================================
   SUCCESS STEP
   ============================================ */
.success-content {
  text-align: center;
  padding: 4rem 0;
}

.success-icon {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 2rem;
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-check {
  width: 2rem;
  height: 2rem;
  stroke: var(--cream);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-check path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: drawCheck 0.6s ease 0.3s forwards;
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.success-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.success-message {
  font-size: 0.9375rem;
  color: var(--gray-400);
  max-width: 280px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 640px) {
  .scale-numbers { gap: 0.5rem; }
  .scale-btn { max-width: 3rem; font-size: 1rem; }
}

@media (max-width: 380px) {
  .option-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .scale-numbers { gap: 0.25rem; }
  .scale-btn { font-size: 0.75rem; }
}
/* ============================================
   INTL-TEL-INPUT OVERRIDES (dark theme)
   ============================================ */
.iti {
  width: 100%;
  display: flex;
}
.iti__flag-container {
  background: var(--black-light);
  border: 1.5px solid var(--gray-800);
  border-right: none;
  border-radius: 0.625rem 0 0 0.625rem;
  height: auto;
}
.iti__selected-flag {
  padding: 0 0.5rem 0 0.875rem;
  height: 100%;
  display: flex;
  align-items: center;
}
.iti__selected-flag:hover,
.iti__selected-flag:focus {
  background: var(--gray-900);
}
.iti__selected-dial-code {
  color: var(--cream);
  font-size: 1rem;
  font-weight: 500;
}
.iti__tel-input {
  background: var(--black-light);
  color: var(--cream);
  border: 1.5px solid var(--gray-800);
  border-left: none;
  border-radius: 0 0.625rem 0.625rem 0;
  padding: 1rem 1.125rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  width: 100%;
}
.iti__tel-input:focus {
  outline: none;
  border-color: var(--cream);
  box-shadow: 0 0 0 3px rgba(245, 242, 235, 0.1);
}
.iti__tel-input::placeholder {
  color: var(--gray-600);
}
.iti__country-list {
  background: var(--black-light);
  border: 1px solid var(--gray-800);
  border-radius: 0.5rem;
  color: var(--cream);
  max-height: 220px;
  overflow-y: auto;
}
.iti__country {
  padding: 0.5rem 0.75rem;
  color: var(--cream);
}
.iti__country:hover,
.iti__country.iti__highlight {
  background: var(--gray-800);
}
.iti__country-name {
  color: var(--cream);
}
.iti__dial-code {
  color: var(--gray-400);
}

/* Modo demo (?demo=1) */
.demo-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
  padding: 0.45rem 1rem;
  background: #3d4a1f;
  color: #c9e4a5;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid rgba(201, 228, 165, 0.25);
}

body:has(.demo-banner) .header {
  top: 2rem;
}

body:has(.demo-banner) .main {
  padding-top: 7rem;
}
