:root {
  --brand: #7c5cfc;
  --brand-hover: #6b48e0;
  --brand-deep: #5a3ecf;
  --brand-soft: #efecff;
  --brand-soft-2: #f5f3ff;
  --ink: #1a1c26;
  --ink-soft: #555b6b;
  --ink-faint: #8b92a3;
  --surface: #ffffff;
  --surface-muted: #f7f7fb;
  --surface-soft: #fbfbfe;
  --border: #eceaf2;
  --border-strong: #ddd9ea;
  --success: #16a34a;
  --success-soft: #e6f6ec;
  --danger: #dc2626;
  --danger-soft: #fdeaea;
  --warning: #d97706;
  --warning-soft: #fdf3e2;
  --info: #4cd7f6;
  --radius-card: 20px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --shadow-card: 0 1px 2px rgba(16, 16, 30, 0.04), 0 10px 30px -14px rgba(16, 16, 30, 0.14);
  --shadow-card-hover: 0 2px 4px rgba(16, 16, 30, 0.05), 0 16px 40px -16px rgba(16, 16, 30, 0.2);
  --shadow-modal: 0 24px 70px -24px rgba(16, 16, 30, 0.4);
  --font-display: 'Sora', 'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-label: 'Geist', ui-sans-serif, system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  color: var(--ink);
  background: linear-gradient(180deg, #fbfaff 0%, #f4f2fd 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px 0 48px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

.muted {
  color: var(--ink-soft);
}

.label {
  font-family: var(--font-label);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.05em;
  font-weight: 500;
  text-transform: uppercase;
}

.small {
  font-size: 14px;
  line-height: 20px;
}

/* ─────────────────────────── Header ─────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 6px 16px -6px rgba(124, 92, 252, 0.55);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a {
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 999px;
  transition: all 0.18s ease;
}

.nav a:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.nav a.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

.nav form { display: inline-flex; align-items: center; }

.nav-logout {
  border: 0;
  background: transparent;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-logout:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* ─────────────────────────── Progress ─────────────────────────── */

.progress-wrap {
  padding: 10px 0 0;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--info) 160%);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ─────────────────────────── Buttons ─────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(124, 92, 252, 0.6);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -8px rgba(124, 92, 252, 0.7);
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--brand);
  background: var(--brand-soft-2);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-block {
  width: 100%;
}

/* ─────────────────────────── Cards ─────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.card-pad {
  padding: 28px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.pulse-enter {
  animation: pulse-in 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pulse-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────── Options ─────────────────────────── */

.option-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  text-align: left;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.15s ease;
}

.option:hover {
  border-color: var(--brand);
  background: var(--brand-soft-2);
}

.option.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 4px rgba(124, 92, 252, 0.12);
}

.option .radio-dot {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
  background: #fff;
}

.option.selected .radio-dot {
  border-color: var(--brand);
  background: var(--brand);
}

.option.selected .radio-dot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.option .check-box {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 7px;
  border: 2px solid var(--border-strong);
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
  background: #fff;
  color: transparent;
}

.option.selected .check-box {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.option .check-box svg {
  width: 14px;
  height: 14px;
}

.option .opt-title {
  font-weight: 600;
  font-size: 16px;
}

.option .opt-desc {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 20px;
  margin-top: 2px;
  font-weight: 400;
}

/* ─────────────────────────── Forms ─────────────────────────── */

.field {
  margin-bottom: 18px;
}

.field:last-child {
  margin-bottom: 0;
}

.field-label {
  display: block;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 8px;
}

.field-label .req {
  color: var(--brand);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(124, 92, 252, 0.12);
}

.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 24px;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-faint);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24' stroke='%238b92a3' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ─────────────────────────── Chips / tags ─────────────────────────── */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.chip.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 600;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
}

/* ─────────────────────────── Banner / notes ─────────────────────────── */

.note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--brand-soft-2);
  border: 1px solid rgba(124, 92, 252, 0.16);
  font-size: 14px;
  line-height: 21px;
  color: var(--ink-soft);
}

.note strong { color: var(--ink); }

.note .emoji { font-size: 18px; line-height: 1; }

.note-warning {
  background: var(--warning-soft);
  border-color: rgba(217, 119, 6, 0.22);
}

.note-warning strong { color: var(--warning); }

.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ─────────────────────────── Pitch slide ─────────────────────────── */

.pitch-hero {
  text-align: center;
  padding: 40px 32px;
  background:
    radial-gradient(120% 160% at 50% 0%, rgba(124, 92, 252, 0.12) 0%, rgba(76, 215, 246, 0.05) 45%, transparent 70%),
    #fff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}

.pitch-hero .orb {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  font-size: 30px;
  box-shadow: 0 14px 30px -10px rgba(124, 92, 252, 0.6);
}

/* ─────────────────────────── Recap / conclusion ─────────────────────────── */

.recap-list {
  display: grid;
  gap: 10px;
}

.recap-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: 14px;
}

.recap-item .re-q {
  flex: 0 0 auto;
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 2px;
  width: 86px;
}

.recap-item .re-a {
  font-weight: 500;
  color: var(--ink);
}

/* ─────────────────────────── Step nav ─────────────────────────── */

.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.step-nav .spacer { flex: 1; }

.page-head {
  padding: 32px 0 22px;
}

.page-head h1 {
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.15;
  line-height: 1.1;
  font-weight: 800;
}

.page-head p {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 17px;
  max-width: 640px;
}

/* ─────────────────────────── Dashboard / resultados ─────────────────────────── */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
}

.kpi .k-label {
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}

.kpi .k-value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 4px;
  color: var(--ink);
}

.kpi .k-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.kpi.k-primary .k-value { color: var(--brand); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 22px;
  margin-bottom: 18px;
}

.panel h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.panel .panel-sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 16px;
}

.bar-line {
  margin-bottom: 14px;
}

.bar-line:last-child { margin-bottom: 0; }

.bar-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 14px;
}

.bar-label { font-weight: 500; }

.bar-pct { color: var(--ink-faint); font-family: var(--font-label); font-size: 13px; }

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand) 0%, #a78bfa 100%);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-fill.green { background: linear-gradient(90deg, #22c55e, #86efac); }
.bar-fill.cyan { background: linear-gradient(90deg, #06b6d4, #67e8f9); }
.bar-fill.amber { background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.bar-fill.rose { background: linear-gradient(90deg, #ef4444, #fca5a5); }
.bar-fill.gray { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 18px;
}

/* Tabla */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.toolbar .grow { flex: 1; }

.toolbar .search {
  max-width: 260px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}

table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
  min-width: 980px;
}

table.results thead th {
  text-align: left;
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
  white-space: nowrap;
}

table.results tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--ink);
}

table.results tbody tr:last-child td { border-bottom: 0; }

table.results tbody tr:hover { background: var(--brand-soft-2); }

table.results .strong { font-weight: 600; }

table.results .faded { color: var(--ink-faint); }

table.results .ellipsis {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-green { background: var(--success-soft); color: #15803d; }
.badge-amber { background: var(--warning-soft); color: #b45309; }
.badge-gray { background: var(--surface-muted); color: var(--ink-soft); border: 1px solid var(--border); }
.badge-brand { background: var(--brand-soft); color: var(--brand-deep); }
.badge-rose { background: var(--danger-soft); color: #b91c1c; }

.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--ink-soft);
}

.empty .e-emoji { font-size: 44px; margin-bottom: 12px; }
.empty h3 { font-size: 20px; margin-bottom: 6px; color: var(--ink); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-faint);
  transition: all 0.15s ease;
}

.icon-btn:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

/* Toast */

.toast {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #11131a;
  color: #fff;
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: var(--shadow-modal);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: min(92vw, 380px);
}

.toast.show { opacity: 1; transform: translateY(0); }

.toast .t-ico { font-size: 18px; }

.toast.success .t-ico { color: #4ade80; }
.toast.error .t-ico { color: #f87171; }

/* Footer */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--ink-faint);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.5);
}

/* Responsive */

@media (max-width: 640px) {
  .card-pad { padding: 20px; }
  .step-card { border-radius: var(--radius-lg); }
  .row-2 { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
  .chart-grid { grid-template-columns: 1fr; }
  .step-nav { flex-wrap: wrap; }
  .step-nav .btn { flex: 1; }
  .toolbar .search { max-width: 100%; }
}