/* AVA v1.0.8 | Paridad visual PRE-AR. Reproducción acotada de la
   referencia histórica (public/activar/activar.css + #startScreen en public/styles.css).
   Prohibido definir reglas para #camera, #hud, .hud, .actions o canvas/video/tracking. */

/* El fondo claro solo existe antes de que se abra la cámara. */
#prearBackdrop {
  position: fixed; inset: 0; z-index: 4;
  background: radial-gradient(circle at 10% 10%, #f1eaf7, transparent 40%),
              radial-gradient(circle at 96% 90%, #f0e6f2, transparent 37%), #faf8f6;
}
#panel[hidden] + #prearBackdrop { display: none !important; }

/* Pantalla histórica de activación: tarjeta blanca, lila, bordes y tipografía. */
#panel.panel {
  position: fixed; inset: 0; margin: auto;
  width: min(440px, calc(100% - 36px)); height: fit-content;
  max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px);
  overflow-y: auto; padding: clamp(26px, 6vw, 40px);
  border: 1px solid #e7dfea; border-radius: 24px; background: #fff;
  color: #291f34; text-align: center;
  box-shadow: 0 20px 55px rgba(57,32,78,.08), 0 2px 10px rgba(57,32,78,.03);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
#panel .brand { font-size: .8rem; font-weight: 650; letter-spacing: .2em; color: #76518c; margin: 0 0 24px; }
#panel .brand strong { color: #573670; }
#panel h1 { font-size: clamp(1.7rem, 6vw, 2rem); line-height: 1.17;
  letter-spacing: -.035em; text-align: center; margin: 0 0 19px; font-weight: 780; }
#panel .description { color: #605667; text-align: center; line-height: 1.6;
  font-size: .96rem; margin: 0 0 25px; }
#panel #pinForm { display: grid; gap: 12px; }
#panel #pinForm label { margin: 0; text-align: left; font-size: .9rem; font-weight: 700; color: #44324d; }
#panel #pinForm input { width: 100%; min-height: 54px; padding: 14px 16px;
  background: white; color: #291f34; border: 1px solid #b8a8c4; border-radius: 12px;
  font-weight: 700; font-size: 1.4rem; letter-spacing: .35em; text-align: center; }
#panel #pinForm input::placeholder { color: #b4a5bf; }
#panel #pinForm input:focus-visible { outline: 3px solid #d2b8e2; outline-offset: 2px; border-color: #785592; }
#panel #validate { margin: 0; min-height: 51px; padding: 12px 17px;
  background: #65427f; color: #fff; font-size: 1rem; font-weight: 700; border-radius: 12px; }
#panel #validate:hover:not(:disabled) { background: #523368; }
#panel #validate:focus-visible { outline: 3px solid #c7a7e0; outline-offset: 3px; }
#panel .message { color: #6b6171; min-height: 23px; margin: 18px 0 0;
  font-size: .92rem; text-align: center; line-height: 1.55; }
#panel .test-note { padding-top: 17px; margin-top: 22px; border-top: 1px solid #eee7f0;
  color: #857988; font-size: .75rem; line-height: 1.6; }
#panel .activation-copyright { margin: 9px 0 0; color: #817586; font-size: .7rem; line-height: 1.5; }

/* Pantalla histórica "Experiencia interactiva" y "Iniciar experiencia".
   Overlay solo mientras #readyPanel está visible. No alcanza a la cámara ni HUD. */
#panel #readyPanel:not([hidden]) {
  position: fixed; inset: 0; z-index: 6; overflow-y: auto;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  gap: 14px; padding: 28px 24px; text-align: center;
  color: #fff;
  background: radial-gradient(ellipse at 50% 0%, #332246 0%, #151020 56%, #09090f 100%);
}
#panel #readyPanel .brand-mark {
  width: 62px; height: 62px; display: grid; place-items: center;
  border: 1px solid #9575af; border-radius: 19px; color: #e2c9f0;
  background: rgba(153,113,185,.10); box-shadow: 0 12px 32px rgba(0,0,0,.2);
  font-size: 1.5rem; font-weight: 800; letter-spacing: -.06em;
}
#panel #readyPanel h2 {
  font-size: clamp(1.55rem, 6vw, 2.2rem); line-height: 1.15;
  font-weight: 750; letter-spacing: -.04em; color: #fff; margin: 8px 0 0;
}
#panel #readyPanel .intro { max-width: 30rem; color: #dfd5e7; line-height: 1.5; margin: 0 0 8px; }
#panel #readyPanel #begin { width: auto; min-height: 48px; padding: 13px 18px;
  background: #e9d7f3; color: #2c1c38; border: 0; border-radius: 13px;
  font-size: 1rem; font-weight: 700; }
#panel #readyPanel #begin:focus-visible { outline: 3px solid #be92d8; outline-offset: 3px; }
#panel #readyPanel .small { max-width: 32rem; color: #b9aebe; font-size: .86rem; line-height: 1.5; margin: 0; }

@media (max-width: 420px) { #panel.panel { padding: 27px 22px; } }
@media (prefers-reduced-motion: reduce) {
  #panel, #panel * { scroll-behavior: auto !important; }
}

/* B02: enlace institucional, inicialmente deshabilitado. */
#panel #readyPanel #avaInstitutionalLink:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid #bda2d1;
  border-radius: 12px;
  color: #f1e7f6;
  background: transparent;
  text-decoration: none;
  font-size: .94rem;
  font-weight: 650;
}
#panel #readyPanel #avaInstitutionalLink:focus-visible {
  outline: 3px solid #d6b5ed;
  outline-offset: 3px;
}
#panel #readyPanel #avaInstitutionalLink[hidden] {
  display: none !important;
}
/* B02: enlace institucional secundario. */
#panel #readyPanel #avaInstitutionalLink:not([hidden]) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  margin-top: 12px;
  padding: 10px 18px;
  border: 1px solid #baa1cf;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: #f0e2f8;
  font-size: .92rem;
  font-weight: 650;
  text-decoration: none;
}
#panel #readyPanel #avaInstitutionalLink:hover {
  background: rgba(233,215,243,.15);
}
#panel #readyPanel #avaInstitutionalLink:focus-visible {
  outline: 3px solid #c99be5;
  outline-offset: 3px;
}