/* ============================================================
   Censo Estudiantil UEC 2026 · Universidad Externado de Colombia
   Estilo: editorial / académico — papel cálido, verde institucional,
   acento dorado. Tipografía serif de display + sans humanista.
   ============================================================ */

:root {
  /* Verde institucional Externado */
  --green-900: #0e2f21;
  --green-800: #123a28;
  --green-700: #184c34;   /* primario */
  --green-600: #1f6042;
  --green-500: #2c7a55;
  --green-tint: #e7eee7;

  /* Papel cálido + dorado */
  --paper:   #f3efe5;
  --paper-2: #ece5d5;
  --surface: #fffdf8;
  --gold:      #b0863a;
  --gold-soft: #d8c48a;

  --ink: #22271e;
  --ink-soft: #4d5347;
  --muted: #8b8a79;
  --line: #ddd5c3;
  --line-soft: #e9e2d2;
  --danger: #a33227;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(18,58,40,.05), 0 4px 16px rgba(18,58,40,.06);
  --shadow-md: 0 20px 60px rgba(18,58,40,.16);
  --ring: 0 0 0 3px rgba(31,96,66,.16);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { margin: 0; line-height: 1.12; font-family: var(--font-display); font-weight: 600; }
p { margin: 0 0 .8em; }
em { color: var(--green-700); font-style: italic; }
::selection { background: var(--green-700); color: #fff8; color: #fff; }

/* Textura de grano sutil sobre todo el fondo */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}

/* ============ Pantallas ============ */
.screen { display: none; position: relative; z-index: 2; }
.screen.is-active { display: block; }
.screen[hidden] { display: none !important; }

/* Barra de marca superior (verde con filo dorado) */
.brandbar { position: fixed; top: 0; left: 0; right: 0; height: 6px; z-index: 5;
  background: var(--green-800); box-shadow: inset 0 -2px 0 var(--gold); }

/* ============ Botones ============ */
.btn {
  font: 600 1rem/1 var(--font-sans);
  border: 1px solid transparent; border-radius: 999px;
  padding: .82rem 1.7rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: .5rem;
  transition: background .18s, color .18s, box-shadow .18s, transform .06s, border-color .18s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn--primary { background: var(--green-700); color: #fdfbf4; box-shadow: 0 6px 18px rgba(18,58,40,.18); }
.btn--primary:hover { background: var(--green-800); }
.btn--primary:disabled { background: #b7bcae; box-shadow: none; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--green-700); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface); border-color: var(--green-600); }
.btn--ghost:disabled { color: var(--muted); opacity: .45; cursor: not-allowed; }
.btn--outline { background: var(--surface); color: var(--green-700); border-color: var(--green-600); }
.btn--outline:hover { background: var(--green-tint); }
.btn--lg { padding: 1.05rem 2.6rem; font-size: 1.08rem; }
.btn__arrow { transition: transform .2s; }
.btn--primary:hover .btn__arrow { transform: translateX(4px); }

.eyebrow { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: .24em;
  font-size: .72rem; font-weight: 600; color: var(--gold); margin: 0 0 .9rem; }

/* Divisor decorativo (rombo dorado) */
.rule { display: flex; align-items: center; justify-content: center; gap: 1.1rem; margin: 1.8rem 0; }
.rule::before, .rule::after { content: ""; height: 1px; width: 64px; background: linear-gradient(90deg, transparent, var(--line)); }
.rule::after { background: linear-gradient(90deg, var(--line), transparent); }
.rule span { width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); box-shadow: 0 0 0 4px var(--paper); }

/* ============ Portada ============ */
.cover { min-height: 100vh; }
.cover__bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1100px 520px at 78% -12%, rgba(31,96,66,.14), transparent 62%),
    radial-gradient(820px 460px at -8% 108%, rgba(176,134,58,.12), transparent 58%);
}
.cover__inner {
  position: relative; z-index: 1;
  max-width: 720px; margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) 1.4rem 4rem; text-align: center;
}
.cover__logo {
  width: clamp(260px, 52vw, 360px); height: auto; margin-bottom: 1.9rem;
  filter: drop-shadow(0 8px 24px rgba(18,58,40,.14));
  animation: pop .8s cubic-bezier(.2,.8,.2,1) both;
}
.cover__title {
  font-size: clamp(2.7rem, 9vw, 4.6rem); color: var(--green-800);
  font-weight: 600; letter-spacing: -.015em; line-height: .98;
  animation: rise .8s cubic-bezier(.2,.8,.2,1) .06s both;
}
.cover__subtitle {
  font-family: var(--font-sans); color: var(--ink-soft); font-size: clamp(1rem, 2.5vw, 1.18rem);
  margin: 1rem auto 0; max-width: 34ch;
  animation: rise .8s cubic-bezier(.2,.8,.2,1) .12s both;
}

/* Tarjeta tipo documento (con doble filo dorado) */
.doc {
  position: relative; text-align: left; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.6rem, 4.5vw, 2.6rem);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(255,255,255,.6);
  animation: rise .8s cubic-bezier(.2,.8,.2,1) .18s both;
}
.doc::before {
  content: ""; position: absolute; inset: 10px; border: 1px solid var(--line-soft);
  border-radius: calc(var(--radius) - 6px); pointer-events: none;
}
.doc__h { font-size: clamp(1.3rem, 3.4vw, 1.65rem); color: var(--green-800); margin-bottom: .8rem; }
.doc__sub { font-size: 1.08rem; color: var(--green-700); margin: 1.6rem 0 .6rem;
  padding-top: 1.3rem; border-top: 1px solid var(--line-soft); }
.doc p { color: var(--ink-soft); font-size: .97rem; }
.doc__last { margin-bottom: 0; font-weight: 500; color: var(--ink); }

.cover__note { color: var(--muted); font-size: .85rem; margin-top: 1.1rem; }
#startBtn { margin-top: 2.2rem; animation: rise .8s cubic-bezier(.2,.8,.2,1) .24s both; }

/* ============ Topbar / progreso ============ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { max-width: 860px; margin: 0 auto; padding: .75rem 1.4rem;
  display: flex; align-items: center; gap: 1rem; }
.topbar__logo { height: 40px; width: auto; }
.topbar__meta { display: flex; flex-direction: column; line-height: 1.25;
  padding-left: 1rem; border-left: 1px solid var(--line); }
.topbar__part { font-size: .68rem; text-transform: uppercase; letter-spacing: .18em; color: var(--gold); font-weight: 600; }
.topbar__section { font-size: .92rem; color: var(--ink); font-weight: 500; }
.progress { height: 3px; background: var(--line-soft); }
.progress__bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--green-600), var(--gold)); transition: width .45s cubic-bezier(.4,0,.2,1); }

/* ============ Formulario ============ */
.form__main { min-height: calc(100vh - 60px - 76px); }
.form__container { max-width: 720px; margin: 0 auto; padding: clamp(1.8rem, 5vw, 3rem) 1.4rem 3rem; }

.section-head { margin-bottom: 2rem; }
.section-head__kicker { display: flex; align-items: center; gap: .65rem;
  text-transform: uppercase; letter-spacing: .2em; font-size: .74rem; color: var(--gold); font-weight: 600; margin: 0 0 .6rem; }
.section-head__kicker::before { content: ""; width: 22px; height: 2px; background: var(--gold); flex: none; }
.section-head__title { font-size: clamp(1.7rem, 5vw, 2.4rem); color: var(--green-800); font-weight: 600; letter-spacing: -.01em; }
.section-head__desc { font-family: var(--font-sans); color: var(--ink-soft); margin-top: .7rem; }
.section-head { animation: rise .55s cubic-bezier(.2,.8,.2,1) both; }

/* ============ Preguntas ============ */
.q {
  position: relative; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm); scroll-margin-top: 84px;
  transition: border-color .2s, box-shadow .2s;
}
.q:focus-within { border-color: var(--green-500); box-shadow: var(--shadow-sm), var(--ring); }
.q.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(163,50,39,.1); }
.q__label { font-size: 1.06rem; font-weight: 500; color: var(--ink); line-height: 1.4; }
.q__num { font-family: var(--font-display); font-weight: 600; color: var(--gold); font-size: 1rem; margin-right: .3rem; }
.q__label .req { color: var(--danger); margin-left: .2rem; }
.q__help { font-family: var(--font-sans); font-size: .87rem; color: var(--muted); margin: .5rem 0 0; white-space: pre-line; line-height: 1.5; }
.q__hint { display: inline-block; font-size: .76rem; color: var(--green-700); font-weight: 600; margin-top: .6rem;
  background: var(--green-tint); padding: .22rem .6rem; border-radius: 999px; }
.q__body { margin-top: 1rem; }
.q__error { display: none; color: var(--danger); font-size: .82rem; font-weight: 600; margin: .7rem 0 0; }
.q.is-invalid .q__error { display: block; }

/* Inputs de texto */
.field {
  width: 100%; font: 400 1rem var(--font-sans); color: var(--ink);
  padding: .78rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fffefb; transition: border-color .16s, box-shadow .16s;
}
.field::placeholder { color: #b3b09f; }
.field:focus { outline: none; border-color: var(--green-600); box-shadow: var(--ring); background: #fff; }
textarea.field { min-height: 90px; resize: vertical; line-height: 1.5; }

/* Opciones */
.opt {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .78rem .95rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: .55rem; cursor: pointer; background: #fffefb;
  transition: border-color .14s, background .14s, box-shadow .14s, transform .06s;
}
.opt:hover { border-color: var(--green-500); background: var(--green-tint); }
.opt:active { transform: scale(.995); }
.opt input { margin-top: .16rem; accent-color: var(--green-700); width: 1.1rem; height: 1.1rem; flex: none; cursor: pointer; }
.opt--checked { border-color: var(--green-600); background: var(--green-tint);
  box-shadow: inset 3px 0 0 var(--green-700); }
.opt__text { font-family: var(--font-sans); font-size: .96rem; color: var(--ink); }
.opt input:disabled + .opt__text { color: var(--muted); }
.opt:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.opt__other { margin: -.1rem 0 .7rem 2.5rem; max-width: calc(100% - 2.5rem); }

/* Escala 0-10 */
.scale__row { display: flex; flex-wrap: wrap; gap: .4rem; }
.scale__btn {
  flex: 1 1 auto; min-width: 42px; text-align: center;
  border: 1px solid var(--line); background: #fffefb; color: var(--ink-soft);
  border-radius: var(--radius-sm); padding: .6rem .2rem; cursor: pointer;
  font: 600 1rem var(--font-sans); transition: all .13s;
}
.scale__btn:hover { border-color: var(--green-500); background: var(--green-tint); }
.scale__btn.is-on { background: var(--green-700); color: #fff; border-color: var(--green-700);
  box-shadow: 0 4px 12px rgba(24,76,52,.28); transform: translateY(-1px); }
.scale__legend { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-top: .55rem; gap: .5rem; }
.scale__na { margin-top: .7rem; }

/* Matriz Likert */
.matrix { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); }
.matrix table { border-collapse: collapse; width: 100%; min-width: 480px; }
.matrix th, .matrix td { padding: .6rem .55rem; text-align: center; font-size: .82rem; }
.matrix thead th { font-family: var(--font-sans); color: var(--green-700); font-weight: 600;
  background: var(--green-tint); border-bottom: 1px solid var(--line); vertical-align: bottom; position: sticky; top: 0; }
.matrix tbody th { text-align: left; font-family: var(--font-sans); font-weight: 500; color: var(--ink); font-size: .9rem; padding-right: 1rem; }
.matrix tbody tr + tr { border-top: 1px solid var(--line-soft); }
.matrix tbody tr:hover { background: var(--green-tint); }
.matrix input { accent-color: var(--green-700); width: 1.15rem; height: 1.15rem; cursor: pointer; }

/* ============ Navbar inferior ============ */
.navbar {
  position: sticky; bottom: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--line);
}
.navbar__inner { max-width: 720px; margin: 0 auto; padding: .8rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.navbar__count { font-family: var(--font-sans); font-size: .82rem; color: var(--muted); font-weight: 500; }

/* ============ Pantalla final ============ */
.result { min-height: 100vh; padding: 2rem 1.4rem;
  background:
    radial-gradient(900px 460px at 50% -12%, rgba(31,96,66,.16), transparent 62%),
    var(--paper); }
.result.is-active { display: grid; place-items: center; }
.result__inner { max-width: 560px; text-align: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md);
  padding: clamp(2.2rem, 6vw, 3.4rem); animation: pop .6s cubic-bezier(.2,.8,.2,1) both; }
.result__logo { width: 220px; height: auto; margin-bottom: 1.7rem; }
.result__seal {
  width: 74px; height: 74px; margin: 0 auto 1.4rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 2.1rem; color: #fff;
  background: var(--green-600); box-shadow: 0 0 0 6px var(--green-tint), 0 10px 24px rgba(24,76,52,.3);
}
.result__seal.is-stop { background: var(--danger); box-shadow: 0 0 0 6px #f2dcd7, 0 10px 24px rgba(163,50,39,.28); }
.result__title { font-size: clamp(1.6rem, 5vw, 2.1rem); color: var(--green-800); margin-bottom: .8rem; }
.result__msg { font-family: var(--font-sans); color: var(--ink-soft); }
.result__actions { margin-top: 1.8rem; display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

a { color: var(--green-700); text-underline-offset: 3px; }

/* Honeypot anti-bots: fuera de pantalla, sin foco, invisible para lectores humanos */
.hp-field { position: absolute !important; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.turnstile-slot { margin: 0 0 1.2rem; display: flex; justify-content: center; }

/* Evitar desbordes de texto largo (URLs, palabras largas) */
.q__label, .q__help, .opt__text, .section-head__desc, .doc, .doc p,
.result__msg, .field, .cover__subtitle { overflow-wrap: break-word; }
.q__help a, .doc a { color: var(--green-700); font-weight: 600;
  overflow-wrap: anywhere; word-break: break-word; }
.field { max-width: 100%; }

/* ============ Animaciones ============ */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop  { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes qin  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

#questionsHost.is-entering .q { animation: qin .5s cubic-bezier(.2,.8,.2,1) both; }
#questionsHost.is-entering .q:nth-child(1){animation-delay:.02s}
#questionsHost.is-entering .q:nth-child(2){animation-delay:.06s}
#questionsHost.is-entering .q:nth-child(3){animation-delay:.10s}
#questionsHost.is-entering .q:nth-child(4){animation-delay:.14s}
#questionsHost.is-entering .q:nth-child(5){animation-delay:.18s}
#questionsHost.is-entering .q:nth-child(6){animation-delay:.22s}
#questionsHost.is-entering .q:nth-child(7){animation-delay:.26s}
#questionsHost.is-entering .q:nth-child(n+8){animation-delay:.30s}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; }
}

/* ============ Responsive ============ */
@media (max-width: 620px) {
  .cover__inner { padding-top: 2.6rem; }
  .q { padding: 1.2rem 1.15rem; }
  .scale__btn { min-width: 32px; padding: .55rem .1rem; font-size: .9rem; }
  .navbar__count { display: none; }
  .btn { padding: .8rem 1.3rem; }
  .btn--lg { width: 100%; justify-content: center; }
  .topbar__logo { height: 26px; }
  .opt__other { margin-left: 0; max-width: 100%; }
}
