/* Proceso de selección */
#seleccion {
  --selection-header: var(--header-h);
  --selection-sticky-gap: clamp(.55rem, 1.6svh, 1rem);
  --selection-step-size: clamp(2.2rem, 3vw, 2.85rem);
  --selection-line: #aeb4cd;
  --selection-note: #454d69;
  --stage-secondary: #c7d1ec;
  color: var(--ink);
  padding-block: clamp(68px, 8vw, 144px);
  scroll-margin-top: max(0px, calc(var(--selection-header) + 14px - clamp(68px, 8vw, 144px)));
}

#seleccion .selection-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, .55fr);
  gap: clamp(18px, 4vw, 64px);
  align-items: end;
  margin-bottom: clamp(25px, 4vw, 55px);
}

#seleccion .selection-intro .eyebrow { color: #44496a; }

#seleccion .selection-intro h2 {
  margin-top: clamp(.75rem, 1.65vw, 1.65rem);
  font-size: clamp(2.2rem, 5.35vw, 6rem);
  font-weight: 800;
  letter-spacing: -.069em;
  line-height: .98;
  text-wrap: balance;
}

#seleccion .selection-lead {
  max-width: 34ch;
  color: var(--selection-note);
  font-size: clamp(.96rem, 1.24vw, 1.2rem);
  line-height: 1.6;
}

#seleccion .selection-layout {
  display: grid;
  align-items: start;
  gap: clamp(22px, 4.6vw, 76px);
}

#seleccion.has-selection-scroll .selection-layout {
  grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
}

#seleccion .selection-aside {
  display: none;
  min-width: 0;
  border: 1px solid #545a87;
  border-radius: clamp(13px, 1.5vw, 20px);
  background:
    radial-gradient(ellipse at 94% 4%, #39426f, transparent 65%),
    radial-gradient(ellipse at 7% 100%, #274f534d, transparent 65%),
    #171c36;
  color: #f4f6ff;
}

#seleccion.has-selection-scroll .selection-aside {
  display: block;
  position: sticky;
  z-index: 2;
  top: calc(var(--selection-header) + var(--selection-sticky-gap));
}

#seleccion .selection-guide-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 1.3vw, 18px);
  min-height: 2.85rem;
  padding: .55rem clamp(.9rem, 2vw, 1.6rem);
  border-bottom: 1px solid #8e9ad64c;
  color: var(--stage-secondary);
  font-size: .7rem;
  font-weight: 600;
}

#seleccion .selection-guide-count {
  color: var(--mint-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#seleccion .selection-guide-progress {
  min-width: 0;
  height: 2px;
  background: #aab9f147;
}

#seleccion .selection-guide-progress span {
  display: block;
  width: var(--selection-progress, 20%);
  height: 100%;
  background: var(--mint-soft);
  transition: width .25s var(--ease);
}

#seleccion .official-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: selection-step;
}

#seleccion .official-steps > li {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: var(--selection-step-size) minmax(0, 1fr);
  align-items: center;
  gap: clamp(.65rem, 1.45vw, 1.2rem);
  min-height: 7.75rem;
  counter-increment: selection-step;
}

#seleccion.has-selection-scroll .official-steps > li {
  min-height: clamp(8.25rem, 27svh, 15rem);
}

#seleccion .official-steps > li::before {
  content: counter(selection-step, decimal-leading-zero);
  display: grid;
  width: var(--selection-step-size);
  height: var(--selection-step-size);
  place-items: center;
  border: 1px solid var(--selection-line);
  border-radius: 50%;
  background: var(--paper);
  color: #464e6e;
  font-size: .76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: color .25s, border-color .25s, background-color .25s;
}

#seleccion .official-steps > li::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 auto 0 calc(var(--selection-step-size) / 2);
  width: 1px;
  background: var(--selection-line);
}

#seleccion .official-steps > li:first-child::after { top: 50%; }
#seleccion .official-steps > li:last-child::after { bottom: 50%; }
#seleccion .official-steps > li.is-past::before {
  border-color: #76a89d;
  background: #ddf2ec;
  color: #285d53;
}
#seleccion .official-steps > li.is-past::after { background: #76a89d; }
#seleccion .official-steps > li[aria-current="step"]::before {
  border-color: var(--indigo);
  background: var(--indigo);
  color: #fff;
}

#seleccion .selection-step-body {
  min-width: 0;
  padding: clamp(.82rem, 2vw, 1.75rem);
  border: 1px solid transparent;
  border-radius: clamp(11px, 1.4vw, 19px);
  transition: background-color .25s, border-color .25s;
}

#seleccion .official-steps > li[aria-current="step"] .selection-step-body {
  border-color: #d6d9ea;
  background: #fdfdff;
}

#seleccion .official-steps h3 {
  margin-bottom: .35rem;
  font-size: clamp(1.14rem, 1.75vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -.044em;
  line-height: 1.15;
  text-wrap: balance;
}

#seleccion .official-steps > li[aria-current="step"] h3 { color: var(--indigo); }

#seleccion .official-steps p {
  max-width: 53ch;
  color: var(--selection-note);
  font-size: clamp(.9rem, 1.07vw, 1.12rem);
  line-height: 1.58;
}

#seleccion .official-steps .selection-example-note {
  margin-top: .65rem;
  color: var(--indigo);
  font-size: .86em;
  font-weight: 600;
}

#seleccion.has-selection-scroll .official-steps {
  padding-bottom: clamp(3.6rem, 22svh, 12rem);
}

#seleccion.has-selection-scroll .selection-example-note {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Escenas del ejemplo */
#seleccion .selection-stage {
  block-size: clamp(21.5rem, 52svh, 27rem);
  padding: clamp(1rem, 2.4vw, 1.75rem);
}

#seleccion .story-panel[hidden], #seleccion .candidate-criteria[hidden] { display: none; }
#seleccion .story-panel.is-entering { animation: selection-scene-in .28s ease-out both; }

@keyframes selection-scene-in {
  from { opacity: .25; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

#seleccion .scene-head { margin-bottom: clamp(.75rem, 1.75vw, 1.15rem); }

#seleccion .scene-head p {
  margin-bottom: .45rem;
  color: var(--mint-soft);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
}

#seleccion .scene-head h3 {
  font-size: clamp(1.3rem, 2.9vw, 2.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.045em;
}

#seleccion .scene-head h3:has(.scene-count) {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px .52rem;
}

#seleccion .scene-count {
  color: var(--mint-soft);
  font-size: 1.62em;
  font-weight: 800;
  letter-spacing: -.075em;
  line-height: .96;
}

#seleccion .brief-fields { border-top: 1px solid #8e9ad64c; }

#seleccion .brief-fields > div {
  display: grid;
  grid-template-columns: minmax(5.3rem, .63fr) minmax(0, 1.18fr);
  align-items: center;
  gap: .5rem 1rem;
  min-height: clamp(2.85rem, 6svh, 3.7rem);
  padding: .4rem 0;
  border-bottom: 1px solid #8e9ad64c;
}

#seleccion .brief-fields dt,
#seleccion .chosen-role,
#seleccion .onboarding-role {
  display: flex;
  align-items: center;
  gap: .57em;
}

#seleccion .brief-fields dt {
  color: var(--stage-secondary);
  font-size: clamp(.73rem, 1.08vw, .91rem);
  font-weight: 600;
}

#seleccion .brief-fields dd {
  color: #f4f6ff;
  font-size: clamp(.84rem, 1.3vw, 1.05rem);
  font-weight: 700;
  line-height: 1.28;
}

#seleccion :is(.brief-fields, .candidate-criteria, .chosen-role, .onboarding-role, .onboarding-timeline) svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--mint-soft);
  stroke-width: 1.6;
}

#seleccion .pool-composition {
  display: flex;
  flex-direction: column;
  gap: .42rem;
}

#seleccion .candidate-map {
  position: relative;
  width: min(100%, 15.6rem, 28svh);
  aspect-ratio: 1;
  margin-inline: auto;
  background:
    repeating-linear-gradient(0deg, #9aabdc1f 0 1px, transparent 1px 10%),
    repeating-linear-gradient(90deg, #9aabdc1f 0 1px, transparent 1px 10%);
  border: 1px solid #9aabdc3e;
  border-radius: 6px;
}

#seleccion .candidate-map[data-mode="validated"] {
  background-size: 100% 200%, 200% 100%;
}

#seleccion .candidate-slot {
  position: absolute;
  left: var(--pool-x);
  top: var(--pool-y);
  width: 6.6%;
  aspect-ratio: 1 / 1.04;
  transform: translate(-50%, -50%);
  color: #c3c9f2;
  opacity: .82;
  transition: left .42s cubic-bezier(.22,.8,.18,1), top .42s cubic-bezier(.22,.8,.18,1), opacity .22s, color .28s, width .38s;
}

#seleccion .candidate-slot::before, #seleccion .candidate-slot::after {
  content: "";
  position: absolute;
  background: currentColor;
}

#seleccion .candidate-slot::before {
  inset: 6% 28% auto;
  aspect-ratio: 1;
  border-radius: 50%;
}

#seleccion .candidate-slot::after { inset: 57% 6% 5%; border-radius: 99px 99px 30% 30%; }
#seleccion [data-mode="validated"] .candidate-slot:not(.will-pass) { opacity: 0; }
#seleccion [data-mode="validated"] .candidate-slot.will-pass {
  left: var(--short-x);
  top: var(--short-y);
  width: 10.2%;
  color: var(--mint-soft);
  opacity: 1;
}

#seleccion .candidate-criteria {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .35rem;
  width: 100%;
  padding: 0;
  list-style: none;
}

#seleccion .candidate-criteria li {
  display: flex;
  align-items: start;
  gap: .3em;
  color: var(--stage-secondary);
  font-size: clamp(.69rem, .96vw, .82rem);
  line-height: 1.3;
}

#seleccion .choice-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(.5rem, 1.3vw, 1rem);
  min-height: clamp(6.5rem, 22svh, 11rem);
}

#seleccion .choice-visual > span {
  display: grid;
  flex: 0 1 min(27%, 7.45rem);
  align-content: center;
  justify-items: center;
  row-gap: .4rem;
  aspect-ratio: .83;
  border: 1px solid #8399c86b;
  border-radius: .55rem;
  background: #29334d;
  color: #bac9ee;
}

#seleccion .choice-visual > span svg { width: 44%; height: auto; max-height: 32px; stroke-width: 1.5; }
#seleccion .choice-visual > span i { width: 55%; height: 2px; background: currentColor; opacity: .6; }
#seleccion .choice-visual > span i:last-child { width: 34%; }
#seleccion .choice-visual .choice-alternate { opacity: .46; }
#seleccion .choice-visual .choice-selected {
  border-color: #88d4bf;
  background: #285853;
  color: var(--mint-soft);
  transform: translateY(-5px);
}

#seleccion .chosen-role {
  margin-top: .8rem;
  padding-top: .8rem;
  border-top: 1px solid #8e9ad64c;
}

#seleccion .chosen-role strong, #seleccion .onboarding-timeline strong {
  font-size: clamp(.8rem, 1.2vw, .99rem);
  font-weight: 700;
}

#seleccion :is(.chosen-role, .onboarding-timeline) p {
  margin-top: .24rem;
  color: var(--stage-secondary);
  font-size: clamp(.71rem, 1vw, .89rem);
  line-height: 1.43;
}

#seleccion .onboarding-role {
  margin-bottom: .65rem;
  color: var(--mint-soft);
  font-size: clamp(.73rem, 1.06vw, .9rem);
  font-weight: 700;
}

#seleccion .onboarding-timeline { display: grid; padding: 0; list-style: none; }
#seleccion .onboarding-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: .58rem;
  align-items: start;
  padding: .47rem 0 .55rem;
}

#seleccion .onboarding-timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 7.5px;
  top: 28px;
  bottom: -4px;
  width: 1px;
  background: #81cfc280;
}

@media (max-width: 810px) {
  #seleccion { padding-block: clamp(44px, 8vw, 70px); scroll-margin-top: var(--selection-header); }

  #seleccion .selection-intro {
    grid-template-columns: minmax(0, 1fr);
    gap: .75rem;
    margin-bottom: clamp(.95rem, 4vw, 1.65rem);
  }

  #seleccion .selection-intro h2 {
    max-width: 21ch;
    margin-top: .65rem;
    font-size: clamp(2.02rem, 6.75vw, 3.25rem);
    text-wrap: initial;
  }

  #seleccion .selection-lead { max-width: 48ch; font-size: .89rem; }
  #seleccion .selection-layout { gap: .5rem; }
  #seleccion.has-selection-scroll .selection-layout { grid-template-columns: minmax(0, 1fr); }
  #seleccion .selection-aside { box-shadow: 0 12px 24px -18px #171c36b8; }

  #seleccion .selection-guide-head {
    min-height: 2.1rem;
    padding: .34rem .75rem;
    font-size: .64rem;
  }

  #seleccion .selection-stage {
    block-size: clamp(16rem, 49svh, 18rem);
    padding: .65rem .76rem .75rem;
  }

  #seleccion .scene-head { margin-bottom: .61rem; }
  #seleccion .scene-head p { margin-bottom: .32rem; font-size: .61rem; }
  #seleccion .scene-head h3 { font-size: clamp(1.04rem, 4.4vw, 1.4rem); }
  #seleccion .scene-count { font-size: 1.48em; }
  #seleccion .brief-fields > div { min-height: 2.17rem; padding-block: .23rem; gap: .25rem .5rem; }
  #seleccion .brief-fields dt { font-size: .69rem; }
  #seleccion .brief-fields dd { font-size: .74rem; }
  #seleccion .candidate-map { width: min(100%, 10rem, 24svh); }
  #seleccion .candidate-criteria { gap: .2rem; }
  #seleccion .candidate-criteria li { gap: .17rem; font-size: .67rem; }
  #seleccion .candidate-criteria svg { width: 12px; height: 12px; }
  #seleccion .choice-visual { min-height: 5.45rem; }
  #seleccion .choice-visual > span { flex-basis: min(26%, 4.15rem); }
  #seleccion .chosen-role { margin-top: .5rem; padding-top: .45rem; }
  #seleccion .onboarding-role { margin-bottom: .3rem; }
  #seleccion .onboarding-timeline li { padding: .24rem 0 .3rem; gap: .33rem; }
  #seleccion .onboarding-timeline li:not(:last-child)::after { top: 22px; }
  #seleccion .onboarding-timeline strong { font-size: .73rem; }
  #seleccion .onboarding-timeline p { margin-top: .12rem; font-size: .69rem; line-height: 1.28; }
  #seleccion.has-selection-scroll .official-steps > li { min-height: clamp(7.75rem, 25svh, 12rem); }
  #seleccion.has-selection-scroll .official-steps { padding-bottom: clamp(5rem, 25svh, 9rem); }
}

@media (max-height: 460px) {
  #seleccion.has-selection-scroll .selection-layout { grid-template-columns: minmax(0, 1fr); }
  #seleccion.has-selection-scroll .selection-aside { display: none; }
  #seleccion.has-selection-scroll .official-steps { padding-bottom: 0; }
  #seleccion.has-selection-scroll .selection-example-note {
    position: static;
    width: auto;
    height: auto;
    margin: .65rem 0 0;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  #seleccion .story-panel.is-entering { animation: none; }
  #seleccion :is(.candidate-slot, .selection-step-body, .selection-guide-progress span),
  #seleccion .official-steps > li::before {
    transition: none;
  }
}
