:root {
  /* Marikaf AI — tokens reales extraídos de marikafai.com */
  --bg: #080808;
  --surface: #121212;
  --surface-2: #1a1a1a;
  --fg: #fafafa;
  --muted: #262626;
  --muted-fg: #999999;
  --border: #242424;
  --accent: #f2b10d;
  --accent-fg: #1a1a1a;
  --destructive: #ef4444;
  --success: #22c55e;

  --r-sm: 8px;
  --r-md: 12px;
  --r-pill: 9999px;

  --topbar-h: 64px;

  --font: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */

.page-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  max-width: 1180px;
  margin: 0 auto;
}

.main {
  padding: clamp(32px, 5vw, 56px) clamp(20px, 4vw, 48px) 96px;
  min-width: 0;
}

/* ---------- Rail ---------- */

.rail {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  padding: 2.5rem 1.75rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.rail-current { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }

.rail-eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

.rail-num {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}

.rail-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
}

.rail-bottom { display: flex; flex-direction: column; gap: 0.9rem; }

.rail-dots { display: flex; gap: 6px; }

.rail-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.25s ease;
}

.rail-dots span.active { background: var(--accent); }
.rail-dots span.done { background: var(--muted-fg); }

.progress-track {
  height: 3px;
  background: var(--border);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.progress-count {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted-fg);
  letter-spacing: 0.03em;
}

/* ---------- Top bar ---------- */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.top-bar-inner {
  height: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.top-bar-brand { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }

.brand-logo { width: 32px; height: 32px; flex-shrink: 0; display: block; border-radius: 50%; }

.brand-word {
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: var(--fg);
  white-space: nowrap;
}

.top-bar-badge {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.4rem 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- Hero band ---------- */

.hero-band {
  position: relative;
  overflow: hidden;
  background: var(--accent);
  color: var(--accent-fg);
  padding: clamp(40px, 6vw, 72px) clamp(20px, 4vw, 48px);
  text-align: center;
}

.waves { position: absolute; inset: 0; pointer-events: none; }
.waves-canvas { display: block; width: 100%; height: 100%; }
.hero-content { position: relative; z-index: 1; }

.onboarding-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-fg);
  background: rgba(26, 26, 26, 0.07);
  border: 1px solid rgba(26, 26, 26, 0.28);
  border-radius: var(--r-pill);
  padding: 0.42rem 0.9rem 0.42rem 0.7rem;
  margin-bottom: 1.3rem;
}

.onboarding-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--success);
}

.hero-band h1 {
  font-weight: 800;
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 auto 1rem;
  max-width: 18ch;
}

.hero-sub {
  font-size: 1rem;
  line-height: 1.45;
  color: rgba(26, 26, 26, 0.75);
  max-width: 56ch;
  margin: 0 auto;
}

/* ---------- Índice de áreas (portada) ---------- */

.area-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.area-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: clamp(20px, 3vw, 26px);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.area-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.area-num {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.area-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0.5rem 0 0.45rem;
}

.area-card p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted-fg);
  margin: 0 0 1.2rem;
}

.area-go {
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.info-steps {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted-fg);
  font-size: 0.92rem;
  line-height: 1.65;
}

.info-steps code,
.info-card code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.08em 0.4em;
  font-size: 0.88em;
  color: var(--fg);
}

/* ---------- Form card ---------- */

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: clamp(24px, 5vw, 56px);
}

/* ---------- Info band (qué información necesitamos) ---------- */

.info-band {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 44px) clamp(20px, 4vw, 48px) 0;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: clamp(22px, 4vw, 32px) clamp(22px, 4vw, 36px);
}

.info-card-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.info-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 0.82rem;
}

.info-card-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fg);
}

.info-card > p {
  font-size: 0.88rem;
  color: var(--muted-fg);
  margin: 0 0 1.1rem;
  max-width: 72ch;
}

.info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.55rem 1.5rem;
}

.info-list li {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--fg);
}

.info-list li::before {
  content: '\2192';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* ---------- Sections ---------- */

.dossier-section {
  padding: 2.2rem 0;
  border-top: 1px solid var(--border);
}

.dossier-section:first-of-type { border-top: none; padding-top: 0; }

.section-head { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1.7rem; }

.section-num {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.section-head h2 {
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
  color: var(--fg);
}

.section-sub {
  font-size: 0.88rem;
  color: var(--muted-fg);
  margin: 0.25rem 0 0;
}

.info-note {
  font-size: 0.88rem;
  color: var(--muted-fg);
  border-left: 2px solid var(--accent);
  padding: 0.15rem 0 0.15rem 1rem;
  margin-bottom: 1.8rem;
  max-width: 60ch;
}

/* ---------- Fields ---------- */

.field { margin-bottom: 1.7rem; max-width: 640px; }

.field-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.25rem;
}

.req { color: var(--accent); }

.fixed-badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-fg);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.1rem 0.5rem;
  margin-left: 0.4rem;
}

.field-hint {
  display: block;
  font-size: 0.82rem;
  color: var(--muted-fg);
  margin-bottom: 0.5rem;
}

.input,
.select,
.textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--fg);
  font-family: var(--font);
  font-size: 0.94rem;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input.readonly { color: var(--muted-fg); background: var(--muted); border-color: var(--muted); }

.textarea { resize: vertical; min-height: 5.4em; }

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(242, 177, 13, 0.18);
}

.input::placeholder,
.textarea::placeholder { color: #4d4d4d; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f2b10d' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.2rem;
}

.select option { background: var(--surface-2); color: var(--fg); }

/* ---------- Checkboxes (multi-select) — real checkbox rows ---------- */

.chip-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.1rem 1.5rem;
}

.chip {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.88rem;
  color: var(--fg);
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}

.chip::before {
  content: '';
  flex-shrink: 0;
  margin-top: 0.15rem;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background-color: var(--surface-2);
  background-repeat: no-repeat;
  background-position: center;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.chip:has(input:checked)::before {
  background-color: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.3l3.2 3.2L13 4.7' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.chip:has(input:focus-visible)::before { outline: 2px solid var(--accent); outline-offset: 2px; }

.chip-desc { display: block; font-size: 0.76rem; color: var(--muted-fg); margin-top: 0.1rem; }

/* ---------- Pills (radio) — big grid cards ---------- */

.pill-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.7rem;
}

.pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 68px;
  padding: 1.5rem 1rem 1rem;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.3;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--muted-fg);
  background: var(--surface-2);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pill input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}

.pill:has(input:checked) {
  border-color: var(--accent);
  background: rgba(242, 177, 13, 0.1);
  color: var(--fg);
}

.pill:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Small dot centered above the label — en todas las opciones */
.pill::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4d4d4d;
  transition: background 0.15s ease;
}

.pill:has(input:checked)::before { background: var(--accent); }

/* Semantic tone: el punto lleva el color del tono */
.pill[data-tone="pos"]::before { background: var(--success); }
.pill[data-tone="warn"]::before { background: var(--accent); }
.pill[data-tone="neg"]::before { background: var(--destructive); }

.pill[data-tone="pos"]:has(input:checked) { border-color: var(--success); background: rgba(34, 197, 94, 0.1); color: var(--success); }
.pill[data-tone="warn"]:has(input:checked) { border-color: var(--accent); background: rgba(242, 177, 13, 0.1); color: var(--accent); }
.pill[data-tone="neg"]:has(input:checked) { border-color: var(--destructive); background: rgba(239, 68, 68, 0.1); color: var(--destructive); }

/* ---------- Number grid ---------- */

.number-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.number-item { display: flex; flex-direction: column; gap: 0.25rem; }

.number-label { font-size: 0.75rem; color: var(--muted-fg); }

/* ---------- Slider ---------- */

.slider-wrap { max-width: 480px; }

.range-input {
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: var(--r-pill);
  outline: none;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.range-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted-fg);
  margin-top: 0.6rem;
}

.slider-value { font-weight: 600; color: var(--accent); }

/* ---------- Prefix input ---------- */

.prefix-input { display: flex; align-items: center; gap: 0.5rem; }
.prefix-input .prefix { color: var(--muted-fg); font-weight: 600; }
.prefix-input .input { flex: 1; }

/* ---------- Conditional reveal ---------- */

.conditional {
  display: none;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
  margin-top: 0.5rem;
}

.conditional.visible { display: block; }

/* ---------- Honeypot ---------- */

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Submit ---------- */

.submit-wrap { padding-top: 1.25rem; }

.submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.94rem;
  padding: 0.85rem 1.7rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.submit-btn:hover { background: #ffc23a; }
.submit-btn:active { transform: translateY(1px); }

/* ---------- Confirmation ---------- */

.confirmation { max-width: 480px; padding: 3.5rem 0; }

.confirmation-seal { color: var(--accent); margin-bottom: 1rem; }

.confirmation h2 {
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--fg);
  margin: 0 0 0.6rem;
}

.confirmation p { color: var(--muted-fg); margin: 0; }


.ghost-btn {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 0.85rem 1.7rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.ghost-btn:hover { border-color: var(--accent); color: var(--accent); }


/* ---------- Page loader ---------- */

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.35s ease;
}

.page-loader.loader-hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-ring {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loaderSpin 0.8s linear infinite;
}

@keyframes loaderSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .loader-ring { animation-duration: 2s; }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  :root { --topbar-h: 52px; }

  .page-grid { grid-template-columns: 1fr; }

  .rail {
    position: sticky;
    top: var(--topbar-h);
    height: auto;
    padding: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    z-index: 10;
  }

  .rail-bottom { order: -1; gap: 0; }
  .progress-track { border-radius: 0; }
  .rail-dots { display: none; }
  .progress-count { display: none; }

  .rail-current {
    flex-direction: row;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1.1rem;
    min-width: 0;
  }

  .rail-eyebrow { display: none; }

  .rail-num { font-size: 1.15rem; flex-shrink: 0; }

  .rail-title {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  .main { padding: 1.75rem 1.1rem 4rem; }

  .form-card { padding: 1.5rem 1.1rem; border-radius: var(--r-sm); }

  .top-bar-inner { padding: 0 1.1rem; }
  .brand-word { font-size: 0.82rem; }
  .top-bar-badge { font-size: 0.6rem; padding: 0.35rem 0.65rem; }

  .info-band { padding: 1.75rem 1.1rem 0; }
  .info-card { padding: 1.35rem 1.1rem; border-radius: var(--r-sm); }

  .section-head h2 { font-size: 1.3rem; }

  .number-grid { grid-template-columns: 1fr; }
  .chip-group { grid-template-columns: 1fr; }
}

.info-card--spaced { margin-top: clamp(28px, 5vw, 44px); }
.info-note { margin-top: 0.9rem; }

/* ---------- Acceso ---------- */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.login-wrap { width: 100%; max-width: 420px; }

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: clamp(28px, 6vw, 44px);
  text-align: center;
}

.login-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: block;
  margin: 0 auto 1rem;
}

.login-card h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 1.4rem 0 0.6rem;
}

.login-sub {
  color: var(--muted-fg);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 1.8rem;
}

.login-card form { text-align: left; }
.login-card .field-label { display: block; margin-bottom: 0.5rem; }

.login-error {
  margin: 0.9rem 0 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--destructive);
  border-radius: var(--r-sm);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  font-size: 0.88rem;
  line-height: 1.5;
}

.login-submit {
  width: 100%;
  justify-content: center;
  margin-top: 1.4rem;
}

.login-submit:disabled { opacity: 0.6; cursor: progress; }

.login-foot {
  margin: 1.6rem 0 0;
  font-size: 0.8rem;
  color: var(--muted-fg);
}

.login-noscript {
  position: fixed;
  bottom: 1rem;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--destructive);
  font-size: 0.9rem;
}





.login-areas {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.login-areas a {
  display: block;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--fg);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.login-areas a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Aviso de error al enviar ---------- */

.envio-error {
  margin-bottom: 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--destructive);
  border-radius: var(--r-sm);
  background: rgba(239, 68, 68, 0.08);
}

.envio-error p {
  margin: 0 0 1rem;
  color: #fca5a5;
  font-size: 0.92rem;
  line-height: 1.6;
}
