/* Public layer: gateway (/), access (/login) and request access (/request-access).
   Strategic glass is most expressive here; the product shell keeps it subtle (product-shell.css). */

.public-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}

.public-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.public-nav a:hover {
  color: var(--bp-brand-emerald);
}

.public-nav a.cta {
  white-space: nowrap;
  color: var(--text-inverse);
  background: var(--action-primary);
  padding: 0px 18px;
  border-radius: var(--bp-radius-pill);
  font-weight: 650;
}

.public-nav a.cta:hover {
  background: var(--action-primary-hover);
  color: var(--text-inverse);
}

/* Gateway hero */

.hero {
  position: relative;
  min-height: calc(-76px + 100vh);
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  isolation: isolate;
}

.hero-art {
  position: absolute;
  inset: 0px;
  z-index: -2;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
  display: block;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0px;
  z-index: -1;
  background: linear-gradient(90deg,color-mix(in srgb,var(--bp-brand-ivory) 94%,transparent) 0%,color-mix(in srgb,var(--bp-brand-ivory) 82%,transparent) 36%,transparent 62%);
}

.hero-copy {
  align-self: center;
  max-width: 640px;
  padding: 72px 0px 48px 7vw;
}

.hero-copy .eyebrow {
  width: fit-content;
}

.hero-copy h1 {
  font-size: clamp(32px, 3.9vw, 50px);
  line-height: 1.02;
  margin: 12px 0px 24px;
  color: var(--bp-brand-charcoal);
}

.hero-copy h1 em {
  font-style: italic;
  color: var(--bp-divider-gold);
}

.lead {
  font-size: clamp(16px, 1.3vw, 19px);
  color: var(--text-secondary);
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.hero-principle {
  font-family: var(--font-display);
  font-size: clamp(15px, 1.15vw, 17px);
  color: var(--bp-brand-emerald);
  width: fit-content;
  max-width: 520px;
  margin: 22px 0px 0px;
  padding-left: 14px;
  border-left: 1px solid var(--bp-divider-gold);
}

.hero-secondary {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 14px 0px 0px;
}

.pillars {
  list-style: none;
  margin: 0px 7vw 40px;
  padding: 18px 24px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  background: var(--surface-glass-elevated);
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--bp-radius-xl);
  -webkit-backdrop-filter: blur(var(--blur-glass));
  backdrop-filter: blur(var(--blur-glass));
  box-shadow: var(--shadow-glass),inset 0 1px 0 var(--highlight-glass);
}

.pillars li {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--bp-divider-gold);
}

.pillars li:first-child {
  border-left: 0px;
  padding-left: 0px;
}

/* Decorative line icons: one visual family, stroked in emerald, never carrying meaning on their own. */

.pillar-icon {
  width: 22px;
  height: 22px;
  margin-bottom: 8px;
  color: var(--bp-brand-emerald);
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pillars span {
  color: var(--text-secondary);
}

/* How it works + Brandopolis Flow video (poster first; motion is an enhancement) */

.how {
  display: grid;
  grid-template-columns: minmax(0px, 1fr) minmax(0px, 1.1fr);
  gap: 56px;
  align-items: center;
  max-width: 1280px;
  margin: 88px auto;
  padding: 0px 32px;
}

.steps {
  padding-left: 20px;
  display: grid;
  gap: 14px;
  color: var(--text-secondary);
}

.steps strong {
  color: var(--text-primary);
}

.principle {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--bp-brand-emerald);
  margin-top: 24px;
}

.how-art {
  position: relative;
  border-radius: var(--bp-radius-2xl);
  overflow: hidden;
  border: 1px solid var(--border-glass-strong);
  box-shadow: var(--shadow-glass-elevated);
  aspect-ratio: 16 / 9;
  background: var(--surface-muted) url('/brand/web/flow-loop-poster.webp') center/cover;
}

.flow-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* "Cómo funciona" construction: five strategic planes assemble over the composition and a green path
   connects them. The unanimated state below is the completed structure, so reduced motion (which drops
   every animation) shows the finished build rather than an empty panel. */

.flow-build {
  position: absolute;
  inset: 0px;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.flow-plane {
  fill: none;
  stroke: var(--bp-brand-emerald-deep);
  stroke-width: 1.6;
  stroke-linejoin: round;
  opacity: 0.55;
}

.flow-node {
  fill: var(--bp-brand-emerald);
}

.flow-link {
  fill: none;
  stroke: var(--bp-brand-emerald);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  animation: flow-draw 7s var(--bp-ease) infinite;
}

.flow-layer {
  animation: flow-rise 7s var(--bp-ease) infinite;
}

.flow-layer:nth-of-type(2) {
  animation-delay: 0.55s;
}

.flow-layer:nth-of-type(3) {
  animation-delay: 1.1s;
}

.flow-layer:nth-of-type(4) {
  animation-delay: 1.65s;
}

.flow-layer:nth-of-type(5) {
  animation-delay: 2.2s;
}


/* Paused by the visible control, and whenever the panel is off screen, so the build starts when seen. */

.how-art.is-paused .flow-layer, .how-art.is-paused .flow-link {
  animation-play-state: paused;
}

@keyframes flow-rise {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  10% {
    opacity: 1;
    transform: none;
  }
  74% {
    opacity: 1;
    transform: none;
  }
  88% {
    opacity: 0;
    transform: translateY(-8px);
  }
  100% {
    opacity: 0;
    transform: translateY(20px);
  }
}

@keyframes flow-draw {
  0%, 8% {
    stroke-dashoffset: 100;
    opacity: 1;
  }
  62%, 80% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  92%, 100% {
    stroke-dashoffset: 0;
    opacity: 0;
  }
}

.how-media {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.how-media .how-art {
  width: 100%;
}

#motion-toggle {
  font-size: 13px;
}

/* What Brandopolis holds, and how it differs: editorial rails, never a grid of feature cards. */

.reality, .distinction {
  max-width: 1280px;
  margin: 88px auto;
  padding: 0px 32px;
}

.reality-intro {
  max-width: 760px;
}

.reality-list {
  position: relative;
  list-style: none;
  margin: 40px 0px 0px;
  padding: 0px;
  border-top: 1px solid var(--border-glass-strong);
  --rail: 68px;
}

/* A spine between the numbers and the text: the emerald segment grows as the reader moves through
   context → evidencia → decisiones → memoria → aprendizaje. --progress is set from app.js. */

.reality-list::before, .reality-list::after {
  content: "";
  position: absolute;
  top: 0px;
  left: var(--rail);
  width: 1px;
}

.reality-list::before {
  bottom: 0px;
  background: var(--border-glass-strong);
}

.reality-list::after {
  width: 2px;
  margin-left: -0.5px;
  height: var(--progress, 0px);
  background: var(--bp-brand-emerald);
  transition: height 620ms var(--bp-ease);
}

/* Applied by app.js only when motion is allowed; without it every step is simply visible. */

.reality-list.reveal-ready li {
  opacity: 0.32;
  transform: translateY(14px);
  transition: opacity 560ms var(--bp-ease), transform 560ms var(--bp-ease);
}

.reality-list.reveal-ready li:nth-child(2) {
  transition-delay: 70ms;
}

.reality-list.reveal-ready li:nth-child(3) {
  transition-delay: 140ms;
}

.reality-list.reveal-ready li:nth-child(4) {
  transition-delay: 210ms;
}

.reality-list.reveal-ready li:nth-child(5) {
  transition-delay: 280ms;
}

.reality-list.reveal-ready li:nth-child(6) {
  transition-delay: 350ms;
}

.reality-list.reveal-ready li.is-revealed {
  opacity: 1;
  transform: none;
}

.reality-list.reveal-ready .reality-number {
  color: var(--text-muted);
  transition: color 560ms var(--bp-ease);
}

.reality-list.reveal-ready li.is-revealed .reality-number {
  color: var(--bp-brand-emerald);
}

.reality-list li {
  display: grid;
  grid-template-columns: 56px minmax(0px, 300px) minmax(0px, 1fr);
  gap: 8px 24px;
  align-items: baseline;
  padding: 26px 0px;
  border-bottom: 1px solid var(--border-glass-strong);
}

.reality-number {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--bp-brand-emerald);
}

.reality-list h3 {
  margin: 0px;
}

.reality-list p {
  margin: 0px;
  max-width: 62ch;
  color: var(--text-secondary);
}

.reality-close {
  margin: 28px 0px 0px;
  font-family: var(--font-display);
  font-size: clamp(16px, 1.15vw, 19px);
  color: var(--bp-brand-emerald);
}

.distinction-copy {
  max-width: 760px;
  padding: 36px 40px;
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--bp-radius-xl);
  background: var(--surface-glass-elevated);
  box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(var(--blur-glass));
  backdrop-filter: blur(var(--blur-glass));
}

.distinction-copy > p {
  max-width: 62ch;
  color: var(--text-secondary);
}

.distinction-copy > .distinction-tags {
  max-width: none;
  margin-bottom: 0px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--bp-brand-emerald);
}

/* Access (login / request access) */

.welcome {
  max-width: 1160px;
  margin: 6vh auto;
  padding: 0px;
  border: 1px solid var(--border-glass-strong);
  background: var(--surface-glass-hero);
  box-shadow: var(--shadow-glass-elevated);
  display: grid;
  grid-template-columns: minmax(0px, 0.9fr) minmax(0px, 1fr) minmax(0px, 1fr);
  overflow: hidden;
  -webkit-backdrop-filter: blur(var(--blur-glass));
  backdrop-filter: blur(var(--blur-glass));
  border-radius: 18px;
}

.access-art {
  background: var(--surface-muted) url('/brand/web/access-panel.webp') center/cover;
  min-height: 520px;
}

.access-logo {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  margin: 0px 0px 36px;
}

.access-copy {
  padding: 40px 32px;
}

.access-copy h1 {
  font-size: 34px;
  line-height: 1.15;
}

.access-copy > .eyebrow {
  font-size: 10px;
}

.access-copy > p {
  font-size: 14px;
}

.access-copy > .access-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 18px;
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.welcome form, #pilot-entry {
  align-self: center;
  margin: 32px;
  padding: 32px;
  background: var(--surface-glass-modal);
  border: 1px solid var(--border-glass);
  border-radius: var(--bp-radius-xl);
  box-shadow: var(--bp-shadow-md);
}

.welcome form {
  border-radius: 12px;
}

.welcome form button, #pilot-entry .button {
  width: 100%;
}

.welcome form button {
  font-size: 13px;
}

.welcome .hint {
  font-size: 11px;
}

#request-access-view.welcome {
  grid-template-columns: minmax(0px, 0.9fr) minmax(0px, 2fr);
}

#request-access-view .access-copy {
  max-width: 620px;
  align-self: center;
}

#gateway + #login {
  margin-top: 24px;
  margin-bottom: 88px;
}

/* Legal documents: a single readable column, same editorial system as the rest of the public site. */

.legal {
  max-width: 820px;
  margin: 48px auto 88px;
  padding: 0px 32px;
}

.legal-copy h1 {
  font-size: clamp(28px, 3vw, 40px);
}

.legal-copy h2 {
  margin-top: 32px;
  font-size: clamp(18px, 1.6vw, 22px);
}

.legal-copy p {
  color: var(--text-secondary);
  max-width: 68ch;
}

.legal-updated {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links a {
  white-space: nowrap;
}

/* Participant intake: one concise screen, never a wizard. */

/* .welcome declares three column tracks for the access cards, which have three children. Intake also
   has three (art, copy, form) but only two tracks, so the form wrapped to row 2 of the FIRST column:
   352px minus its 32px margins, with 103px fields, while the right half sat empty. Placing the three
   children explicitly keeps the art full-height on the left and gives copy and form the whole right
   column. */

#intake.welcome {
  grid-template-columns: minmax(0px, 0.62fr) minmax(0px, 1.38fr);
  grid-template-rows: auto 1fr;
  align-items: start;
}

#intake .access-art {
  grid-column: 1;
  grid-row: 1 / -1;
  height: 100%;
}

#intake .access-copy {
  grid-column: 2;
  grid-row: 1;
  padding-bottom: 0px;
}

#intake-form {
  grid-column: 2;
  grid-row: 2;
  margin-top: 8px;
}

.intake-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0px, 1fr));
  gap: 0px 16px;
}

.intake-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0px 0px;
  font-weight: 500;
  line-height: 1.45;
}

.intake-consent input {
  width: auto;
  min-height: 0px;
  margin: 2px 0px 0px;
  flex: 0 0 auto;
}

#intake-form button[type="submit"] {
  margin-top: 22px;
}

/* Administration: an operational surface. Clarity over decoration. */

.admin {
  max-width: 1280px;
  margin: 32px auto 80px;
  padding: 0px 24px;
}

.admin-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.admin-subtitle {
  color: var(--text-secondary);
  margin: 4px 0px 0px;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0px;
  border-bottom: 1px solid var(--border-glass-strong);
  padding-bottom: 12px;
}

.admin-nav button {
  background: none;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-secondary);
  padding: 8px 14px;
}

.admin-nav button[aria-current="page"] {
  background: var(--surface-card);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.admin-panel {
  padding: 4px 0px;
}

.admin-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin: 16px 0px;
}

.admin-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--bp-radius-lg);
  background: var(--surface-card);
}

.admin-tile span {
  font-size: 12px;
  color: var(--text-muted);
}

.admin-tile strong {
  font-family: var(--font-display);
  font-size: 26px;
}

.admin-tile em {
  font-size: 11px;
  font-style: normal;
  color: var(--text-muted);
}

.admin-scroll {
  overflow-x: auto;
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--bp-radius-lg);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

.admin-table th, .admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-default);
}

.admin-table th {
  background: var(--surface-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.admin-dists {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0px;
}

.admin-dist ul {
  list-style: none;
  margin: 8px 0px 0px;
  padding: 0px;
}

.admin-dist li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0px;
  border-bottom: 1px solid var(--border-default);
  font-size: 13px;
}

/* Administration owns its own header, so the product shell header stays out of the way entirely. */

body.admin-mode > header, body.admin-mode > footer {
  display: none;
}

body.admin-mode .admin-head > a {
  flex: 0 0 auto;
}

/* Survey thank-you (/gracias-encuesta). A closing moment, not a "form submitted" screen: one column,
   generous air, one action. The H1 uses the sans at hero scale so the page belongs to the landing,
   and the closing line takes the display serif in emerald, the same voice as the principle lines. */
.gratitude {
  max-width: 900px;
  margin: 0px auto;
  padding: clamp(56px, 9vh, 120px) 32px clamp(72px, 12vh, 140px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 48px;
}

.gratitude-copy {
  max-width: 62ch;
}

.gratitude-copy h1 {
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.08;
  margin: 14px 0px 28px;
  color: var(--bp-brand-charcoal);
  text-wrap: balance;
}

.gratitude-copy > p {
  color: var(--text-secondary);
  max-width: 62ch;
  margin: 0px 0px 18px;
}

.gratitude-closing {
  font-family: var(--font-display);
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--bp-brand-emerald) !important;
  margin: 30px 0px 0px !important;
}

.gratitude-actions {
  margin: 36px 0px 0px !important;
}

.gratitude-actions .cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0px 26px;
  border-radius: var(--bp-radius-pill);
  background: var(--action-primary);
  color: var(--text-inverse);
  font-weight: 650;
  text-decoration: none;
  transition: background var(--bp-motion-normal) var(--bp-ease);
}

.gratitude-actions .cta:hover {
  background: var(--action-primary-hover);
  color: var(--text-inverse);
}

/* The canonical symbol, decorative only: a quiet mark, never a redrawn Ribbon B. */
.gratitude-mark {
  opacity: 0.5;
  margin-top: 6px;
}

@media (prefers-reduced-motion: no-preference) {
  .gratitude-copy {
    animation: gratitude-settle 520ms var(--bp-ease) both;
  }
}

@keyframes gratitude-settle {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 767px) {
  .gratitude {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 40px 22px 72px;
  }

  .gratitude-mark {
    order: -1;
    margin-top: 0px;
    width: 42px;
    height: 52px;
  }
}
