/* Comité de Revisores — Horizontes Amazónicos
   Paleta de marca de la revista: NAVY #142A42 · TEAL #009B9B · GOLD #E4A722 */
:root {
  --navy: #142A42;
  --navy-2: #1d3a5a;
  --teal: #009B9B;
  --teal-osc: #007575;
  --teal-tinte: #eaf6f6;
  --gold: #E4A722;
  --gold-tinte: #fff6e0;
  --texto: #2a2a2a;
  --suave: #5b6b78;
  --borde: #dbe4e4;
  --fondo: #f5f8f8;
  --blanco: #ffffff;
  --error: #b3261e;
  --radio: 12px;
  --sombra: 0 10px 30px rgba(20, 42, 66, .10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Noto Sans', system-ui, sans-serif;
  color: var(--texto);
  background: var(--fondo);
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: var(--teal-osc); }
.contenedor { width: min(1040px, 100%); margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }

/* Cabecera */
.cabecera { background: var(--blanco); border-bottom: 1px solid var(--borde); }
.cabecera-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.marca span { display: flex; flex-direction: column; line-height: 1.2; }
.marca small { color: var(--suave); font-size: .75rem; }
.enlace-revista { font-weight: 600; font-size: .9rem; text-decoration: none; }
@media (max-width: 560px) { .enlace-revista { display: none; } }

/* Portada */
.portada {
  background:
    radial-gradient(circle at 85% 20%, rgba(228,167,34,.22), transparent 40%),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, #0d4f5c 100%);
  color: var(--blanco);
  padding: 40px 0 72px;
}
.portada-in { display: flex; align-items: center; gap: 32px; }
.portada .ha-marca { flex: 0 0 170px; background: var(--blanco); border-radius: 50%; padding: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.antetitulo { margin: 0; color: var(--gold); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; font-size: .8rem; }
.portada h1 { font-family: 'Noto Serif', Georgia, serif; font-size: clamp(1.8rem, 4.5vw, 2.7rem); line-height: 1.15; margin: 8px 0 12px; }
.portada h1 span { color: #7fd6d6; }
.bajada { margin: 0; max-width: 620px; color: #d7e3ec; }
@media (max-width: 640px) {
  .portada-in { flex-direction: column; text-align: center; gap: 18px; }
  .portada .ha-marca { flex-basis: auto; width: 130px; }
  .bajada { margin: 0 auto; }
}

/* Logo animado (copiado de la portada de la revista) */
.ha-logo { position: relative; width: 100%; aspect-ratio: 1; }
.ha-logo img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ha-logo .rayos { position: absolute; inset: 0; animation: ha-brillo 4s ease-in-out 2.6s infinite; }
.ha-logo .horizonte { position: absolute; inset: 0; clip-path: inset(0 0 48.5% 0); }
.ha-logo .sol { animation: ha-sol .8s cubic-bezier(.2,.8,.2,1) .35s both; }
.ha-logo .montes { animation: ha-montes .9s cubic-bezier(.2,.8,.2,1) .05s both; }
.ha-logo .agua { animation: ha-agua 1s cubic-bezier(.6,0,.2,1) .7s both; }
.ha-logo .rayo { transform-origin: 56.4% 51%; animation: ha-rayo .6s cubic-bezier(.2,1.4,.4,1) both; }
.ha-logo .rayo:nth-child(1) { animation-delay: 1.05s; }
.ha-logo .rayo:nth-child(2) { animation-delay: 1.13s; }
.ha-logo .rayo:nth-child(3) { animation-delay: 1.21s; }
.ha-logo .rayo:nth-child(4) { animation-delay: 1.29s; }
.ha-logo .rayo:nth-child(5) { animation-delay: 1.37s; }
.ha-logo .rayo:nth-child(6) { animation-delay: 1.45s; }
.ha-logo .rayo:nth-child(7) { animation-delay: 1.53s; }
@keyframes ha-montes { from { opacity: 0; transform: translateY(8%); } to { opacity: 1; transform: none; } }
@keyframes ha-sol { from { transform: translateY(9%); } to { transform: none; } }
@keyframes ha-agua { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes ha-rayo { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: none; } }
@keyframes ha-brillo { 0%, 100% { opacity: 1; } 50% { opacity: .82; } }

/* Indicador de pasos */
.pasos {
  list-style: none; margin: -44px 0 0; padding: 14px 16px 6px;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
  background: var(--blanco); border-radius: var(--radio) var(--radio) 0 0; box-shadow: var(--sombra);
  position: relative;
}
.pasos li { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: .78rem; color: var(--suave); }
.pasos li span {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--borde); font-weight: 700; background: var(--blanco); color: var(--suave);
  transition: all .25s ease;
}
.pasos li em { font-style: normal; }
.pasos li.activo span { border-color: var(--teal); background: var(--teal); color: var(--blanco); box-shadow: 0 0 0 5px var(--teal-tinte); }
.pasos li.activo { color: var(--navy); font-weight: 600; }
.pasos li.hecho span { border-color: var(--navy); background: var(--navy); color: var(--blanco); }
.pasos li.hecho { cursor: pointer; }
@media (max-width: 640px) { .pasos li em { display: none; } .pasos li.activo em { display: block; position: absolute; bottom: -1.6em; left: 0; right: 0; } }
.barra { height: 4px; background: var(--borde); position: relative; }
.barra div { height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--gold)); transition: width .35s ease; }

/* Tarjeta del formulario */
.tarjeta { background: var(--blanco); border-radius: 0 0 var(--radio) var(--radio); box-shadow: var(--sombra); padding: 28px clamp(16px, 4vw, 40px) 24px; margin-bottom: 40px; }
.paso { animation: aparecer .35s ease both; }
@keyframes aparecer { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.paso h2 { color: var(--navy); font-family: 'Noto Serif', Georgia, serif; font-size: 1.5rem; margin: 0 0 8px; }
.subtitulo { color: var(--navy); border-left: 4px solid var(--gold); padding-left: 10px; margin: 26px 0 14px; font-size: 1.05rem; }
.ayuda { color: var(--suave); margin-top: 0; }
.nota { font-size: .88rem; color: var(--suave); background: var(--fondo); border-radius: 8px; padding: 10px 14px; }
.req { color: var(--error); }

/* Beneficios */
.beneficios { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.beneficio { border: 1px solid var(--borde); border-top: 4px solid var(--teal); border-radius: 10px; padding: 16px; transition: transform .22s ease, box-shadow .22s ease; }
.beneficio:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(20,42,66,.12); }
.beneficio.dorado { border-top-color: var(--gold); background: var(--gold-tinte); }
.beneficio h4 { margin: 10px 0 4px; color: var(--navy); font-size: 1.05rem; }
.beneficio p { margin: 0; font-size: .92rem; }
.b-icono { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--teal-tinte); color: var(--teal-osc); }
.beneficio.dorado .b-icono { background: #fdebc0; color: #8a6210; }
.b-icono svg { width: 24px; height: 24px; }
.lista-check { list-style: none; padding: 0; margin: 0 0 16px; }
.lista-check li { position: relative; padding-left: 28px; margin-bottom: 8px; }
.lista-check li::before { content: ""; position: absolute; left: 4px; top: .45em; width: 12px; height: 7px; border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(-45deg); }

/* Campos */
.rejilla { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px 16px; margin-bottom: 8px; }
.c2 { grid-column: span 2; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; }
.c6 { grid-column: span 6; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
@media (max-width: 760px) { .rejilla > * { grid-column: span 12 !important; } }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .9rem; color: var(--navy); }
input, select {
  font: inherit; font-weight: 400; color: var(--texto);
  border: 1px solid #cbd5d5; border-radius: 8px; padding: 10px 12px; background: var(--blanco); width: 100%;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,155,155,.18); }
label small { font-weight: 400; color: var(--suave); font-size: .8rem; }
.invalido input, input.invalido, select.invalido { border-color: var(--error); box-shadow: 0 0 0 3px rgba(179,38,30,.12); }
.msg-error { color: var(--error); font-weight: 500; font-size: .8rem; }
.trampa { position: absolute; left: -9999px; }

.campo-orcid { position: relative; display: block; }
.campo-orcid .id-orcid { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; background: #a6ce39; color: #fff; font-size: .62rem; font-weight: 700; display: grid; place-items: center; }
.campo-orcid input { padding-left: 42px; font-family: ui-monospace, Menlo, monospace; letter-spacing: .04em; }
.estado { min-height: 1.2em; }
.estado.ok { color: var(--teal-osc); font-weight: 600; }
.estado.mal { color: var(--error); font-weight: 600; }
.orcid-lado { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.casilla { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--texto); margin: 10px 0; }
.casilla input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--teal); }
.boton-texto { background: none; border: none; padding: 0; font: inherit; color: var(--teal-osc); font-weight: 600; cursor: pointer; text-align: left; }
.boton-texto:hover { text-decoration: underline; }

.tutorial { border: 1px solid #cfe3e3; background: #f2fafa; border-radius: 10px; padding: 4px 18px; margin: 10px 0 22px; }
.tutorial summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: 10px 0; }
.tutorial[open] { padding-bottom: 14px; }
.tutorial-pasos { counter-reset: t; list-style: none; padding: 0; margin: 4px 0 12px; }
.tutorial-pasos li { counter-increment: t; position: relative; padding: 0 0 12px 44px; }
.tutorial-pasos li::before {
  content: counter(t); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%;
  background: #a6ce39; color: #fff; font-weight: 700; display: grid; place-items: center;
}
.tutorial-pasos li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 30px; bottom: 2px; width: 2px; background: #d5e8b4; }
.tutorial code { background: var(--blanco); border: 1px solid var(--borde); border-radius: 4px; padding: 1px 5px; }

/* Áreas */
.contador { display: inline-block; background: var(--teal-tinte); color: var(--teal-osc); font-weight: 700; border-radius: 999px; padding: 1px 10px; font-size: .85rem; }
.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 20px; }
.area { border: 1px solid var(--borde); border-radius: 10px; padding: 12px 14px 14px; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; transition: border-color .2s ease, background .2s ease; }
.area.con-seleccion { border-color: var(--teal); background: #fbfefe; }
.area legend { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--navy); padding: 0 6px; }
.a-icono { width: 30px; height: 30px; border-radius: 8px; background: var(--navy); color: var(--blanco); display: grid; place-items: center; }
.a-icono svg { width: 18px; height: 18px; }
.a-cuenta { background: var(--gold); color: var(--navy); border-radius: 999px; font-size: .72rem; padding: 0 7px; }
.a-cuenta:empty { display: none; }
.chip { display: inline-flex; font-weight: 400; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { border: 1px solid #cbd5d5; border-radius: 999px; padding: 5px 12px; font-size: .85rem; color: var(--texto); background: var(--blanco); transition: all .18s ease; }
.chip:hover span { border-color: var(--teal); }
.chip input:checked + span { background: var(--teal); border-color: var(--teal); color: var(--blanco); }
.chip input:checked + span::before { content: "✓ "; }
.chip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Resumen */
.resumen { display: grid; gap: 12px; margin-bottom: 18px; }
.r-bloque { border: 1px solid var(--borde); border-radius: 10px; padding: 12px 16px; }
.r-bloque header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.r-bloque h3 { margin: 0; font-size: 1rem; color: var(--navy); }
.r-bloque dl { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 4px 12px; margin: 0; font-size: .92rem; }
.r-bloque dt { color: var(--suave); }
.r-bloque dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .r-bloque dl { grid-template-columns: 1fr; } .r-bloque dd { margin-bottom: 6px; } }
.recordatorio { background: var(--gold-tinte); border-left: 4px solid var(--gold); border-radius: 8px; padding: 12px 16px; margin-bottom: 12px; }

/* Botones */
.acciones { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--borde); margin-top: 24px; padding-top: 18px; }
.espacio { flex: 1; }
.boton {
  display: inline-block; font: inherit; font-weight: 700; border: none; border-radius: 8px; padding: 11px 22px; cursor: pointer;
  background: var(--teal); color: var(--blanco); text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.boton:hover { background: var(--teal-osc); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,155,155,.28); }
.boton.secundario { background: var(--blanco); color: var(--navy); border: 1px solid #cbd5d5; }
.boton.secundario:hover { background: var(--fondo); box-shadow: none; }
.boton.dorado { background: var(--gold); color: var(--navy); }
.boton.dorado:hover { background: #cf951a; box-shadow: 0 4px 12px rgba(228,167,34,.35); }
.boton:disabled { opacity: .6; cursor: wait; transform: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.error-general { background: #fdecea; color: var(--error); border-radius: 8px; padding: 10px 14px; font-weight: 600; }

.fin { text-align: center; padding: 20px 0; }
.exito-icono { width: 72px; height: 72px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; margin: 0 auto 12px; box-shadow: 0 0 0 10px var(--teal-tinte); }
.exito-icono svg { width: 38px; height: 38px; }

.pie { background: var(--navy); color: #c9d6e0; font-size: .88rem; padding: 22px 0; text-align: center; }
.pie p { margin: 4px 0; }
.pie a { color: #7fd6d6; }

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

/* Invitación personal */
.saludo-portada { font-family: 'Noto Serif', Georgia, serif; font-size: 1.2rem; color: var(--gold); margin: 0 0 6px; }
.mensaje-personal { background: var(--teal-tinte); border-left: 4px solid var(--teal); border-radius: 8px; padding: 12px 16px; }
.boton.chico { padding: 7px 14px; font-size: .88rem; margin-top: 6px; }

/* Declaración y firma */
.declaracion { border: 1px solid var(--borde); border-radius: 10px; padding: 18px 22px; background: #fcfdfd; font-size: .93rem; max-height: 420px; overflow-y: auto; }
.declaracion h3 { margin: 0 0 12px; text-align: center; color: var(--navy); font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; }
.declaracion p, .declaracion li { text-align: justify; }
.declaracion ol { padding-left: 20px; }
.declaracion li { margin-bottom: 6px; }
.modo-firma { border: none; padding: 0; margin: 20px 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modo-firma legend { font-weight: 700; color: var(--navy); margin-bottom: 8px; }
@media (max-width: 560px) { .modo-firma { grid-template-columns: 1fr; } }
.opcion-firma { flex-direction: row; align-items: flex-start; gap: 10px; border: 1px solid var(--borde); border-radius: 10px; padding: 12px 14px; cursor: pointer; font-weight: 400; }
.opcion-firma input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--teal); flex: none; }
.opcion-firma span { display: flex; flex-direction: column; }
.opcion-firma b { color: var(--navy); }
.opcion-firma small { color: var(--suave); }
.opcion-firma:has(input:checked) { border-color: var(--teal); background: var(--teal-tinte); }
.lienzo-firma { position: relative; border: 2px dashed #b9cccc; border-radius: 10px; background: var(--blanco); }
.lienzo-firma.invalido { border-color: var(--error); }
.lienzo-firma canvas { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; }
.lienzo-guia { position: absolute; left: 16px; right: 16px; bottom: 36px; border-bottom: 1px solid #cbd5d5; color: #a0acb4; font-size: .85rem; pointer-events: none; padding-bottom: 2px; }
.lienzo-firma.firmado .lienzo-guia { color: transparent; }
.lienzo-firma .msg-error { position: absolute; top: 8px; left: 12px; }
.lienzo-pie { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; color: var(--suave); }
.firma-electronica { border: 1px solid #cfe3e3; background: #f2fafa; border-radius: 10px; padding: 16px 18px 4px; margin-bottom: 10px; }
.firma-electronica input[type="file"] { margin-top: 6px; background: var(--blanco); }
