/* =========================================================================
   OIKOS · Páginas de entrada: inicio (index.php) y acceso (acceso.php)
   Requiere oikos.css
   ========================================================================= */

/* ── Logo animado (se dibuja como un plano) ────────────────────────────── */
.logo-anim { display: block; height: 36px; width: auto; overflow: visible; }
.logo-anim .trazo {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: dibuja .9s var(--ease-io) forwards;
  animation-delay: calc(var(--t) * 160ms + 100ms);
}
.logo-anim .ventanas rect { opacity: 0; animation: aparece .3s ease-out forwards; }
.logo-anim .ventanas rect:nth-child(1)  { animation-delay: .55s; }
.logo-anim .ventanas rect:nth-child(2)  { animation-delay: .6s; }
.logo-anim .ventanas rect:nth-child(3)  { animation-delay: .65s; }
.logo-anim .ventanas rect:nth-child(4)  { animation-delay: .7s; }
.logo-anim .ventanas rect:nth-child(5)  { animation-delay: .75s; }
.logo-anim .ventanas rect:nth-child(6)  { animation-delay: .8s; }
.logo-anim .ventanas rect:nth-child(7)  { animation-delay: .95s; }
.logo-anim .ventanas rect:nth-child(8)  { animation-delay: 1s; }
.logo-anim .ventanas rect:nth-child(9)  { animation-delay: 1.05s; }
.logo-anim .ventanas rect:nth-child(10) { animation-delay: 1.1s; }
.logo-anim .palabra { opacity: 0; transform: translate(244px, 19px) scale(.62); animation: palabra .7s var(--ease-out) .9s forwards; }
.logo-visto .logo-anim .trazo,
.logo-visto .logo-anim .ventanas rect,
.logo-visto .logo-anim .palabra { animation: none; stroke-dashoffset: 0; opacity: 1; }
.logo-visto .logo-anim .palabra { transform: translate(236px, 19px) scale(.62); }

@keyframes dibuja { to { stroke-dashoffset: 0; } }
@keyframes aparece { to { opacity: 1; } }
@keyframes palabra { to { opacity: 1; transform: translate(236px, 19px) scale(.62); } }

@media (prefers-reduced-motion: reduce) {
  .logo-anim .trazo { stroke-dashoffset: 0; }
  .logo-anim .ventanas rect, .logo-anim .palabra { opacity: 1; }
  .logo-anim .palabra { transform: translate(236px, 19px) scale(.62); }
}

/* ── Enlace de soporte ─────────────────────────────────────────────────── */
.soporte {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px 0 12px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 500; color: var(--t2); text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--l1); background: rgba(255, 255, 255, .02);
  transition: color .2s ease, box-shadow .2s ease, background-color .2s ease, transform .16s var(--ease-out);
}
.soporte i { font-size: 18px; color: var(--rojo-txt); }
.soporte strong { color: var(--t1); font-weight: 600; }
.soporte:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .soporte:hover { color: var(--t1); box-shadow: inset 0 0 0 1px var(--l3); background: rgba(255, 255, 255, .04); }
}

/* =========================================================================
   INICIO
   ========================================================================= */
.portal {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
}
.lado {
  display: flex; flex-direction: column;
  padding: 28px clamp(20px, 5vw, 80px);
}
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.contenido {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  max-width: 540px; padding: clamp(36px, 7vh, 80px) 0 clamp(28px, 5vh, 56px);
}
.pg-inicio h1 { font-size: clamp(40px, 4.6vw, 64px); line-height: 1.02; letter-spacing: -0.04em; font-weight: 700; }
.bajada { margin-top: 18px; max-width: 44ch; font-size: clamp(16px, 1.2vw, 17.5px); line-height: 1.6; color: var(--t2); }

.opciones { margin-top: clamp(30px, 5vh, 48px); display: grid; gap: 14px; }

.opcion {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px;
  padding: 20px 20px 20px 18px;
  text-decoration: none; color: inherit;
  transition: transform .3s var(--ease-out), box-shadow .3s ease;
}
.opcion::after {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(360px circle at var(--x) var(--y), rgba(var(--rojo-rgb), .1), transparent 60%);
  opacity: 0; transition: opacity .3s ease;
}
.opcion:active { transform: scale(.985); }

.opcion__icono {
  width: 56px; height: 56px; border-radius: var(--r-lg);
  display: grid; place-items: center; font-size: 28px;
  color: var(--rojo-txt);
  background: rgba(var(--rojo-rgb), .1);
  box-shadow: inset 0 0 0 1px rgba(var(--rojo-rgb), .28);
  transition: transform .4s var(--ease-out), background-color .25s ease;
}
.opcion__cuerpo { display: grid; gap: 4px; min-width: 0; }
.opcion__titulo { font-family: var(--f-titulo); font-size: 21px; font-weight: 700; letter-spacing: -0.015em; color: var(--t1); }
.opcion__desc { font-size: 14.5px; line-height: 1.5; color: var(--t2); }
.opcion__meta {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: 12px; color: var(--t3);
}
.opcion__meta i { font-size: 15px; color: var(--t2); }
.opcion__ir {
  width: 44px; height: 44px; border-radius: var(--r-md);
  display: grid; place-items: center; font-size: 19px;
  color: var(--t1); background: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1px var(--l2);
  transition: background-color .25s ease, color .25s ease, transform .35s var(--ease-out), box-shadow .25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .opcion:hover { transform: translateY(-2px); }
  .opcion:hover::after { opacity: 1; }
  .opcion:hover .opcion__icono { transform: rotate(-6deg) scale(1.05); background: rgba(var(--rojo-rgb), .16); }
  .opcion:hover .opcion__ir { background: var(--rojo); color: #fff; box-shadow: none; transform: translateX(3px); }
}

.pie { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--t3); }

/* Escena fotográfica */
.escena {
  position: relative; margin: 14px 14px 14px 0; border-radius: 26px; overflow: hidden;
  background:
    radial-gradient(80% 60% at 70% 20%, rgba(var(--rojo-rgb), .18), transparent 60%),
    linear-gradient(160deg, var(--s2), var(--s0));
  box-shadow: inset 0 0 0 1px var(--l1);
  clip-path: inset(0 0 0 0 round 26px);
  animation: revela 1.1s var(--ease-io) both;
}
.escena__respaldo { position: absolute; left: 50%; top: 50%; width: min(70%, 520px); transform: translate(-50%, -50%); opacity: .14; }
.escena__capa { position: absolute; inset: -3%; transition: transform .9s var(--ease-out); }
.escena__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.06);
  transition: opacity 1.2s ease, transform 8s linear;
}
.escena__img.is-activa { opacity: 1; transform: scale(1); }
.escena::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(9, 9, 11, .35) 0%, transparent 28%, transparent 60%, rgba(9, 9, 11, .85) 100%),
    linear-gradient(90deg, rgba(9, 9, 11, .5), transparent 30%);
}
.escena__barras { position: absolute; right: 22px; bottom: 22px; z-index: 2; display: flex; gap: 6px; }
.escena__barras button {
  width: 36px; height: 4px; padding: 0; border: 0; border-radius: 4px; cursor: pointer;
  background: rgba(255, 255, 255, .28); position: relative; overflow: hidden;
}
.escena__barras button::before { content: ''; position: absolute; inset: -10px 0; } /* área táctil */
.escena__barras button::after { content: ''; position: absolute; inset: 0; background: var(--rojo); transform: scaleX(0); transform-origin: left; }
.escena__barras button.is-activa::after { animation: avance var(--dur, 6s) linear forwards; }

/* Cortina de salida */
.cortina {
  position: fixed; inset: 0; z-index: var(--z-cortina); pointer-events: none;
  display: grid; place-items: center; background: var(--s0);
  clip-path: circle(0 at var(--cx, 50%) var(--cy, 50%));
  transition: clip-path .5s var(--ease-io);
}
.cortina.is-activa { clip-path: circle(150% at var(--cx, 50%) var(--cy, 50%)); pointer-events: auto; }
.cortina__txt {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--f-titulo); font-size: 19px; font-weight: 600; color: var(--t1);
  opacity: 0; transform: translateY(8px); transition: opacity .3s ease .2s, transform .4s var(--ease-out) .2s;
}
.cortina.is-activa .cortina__txt { opacity: 1; transform: none; }
.cortina .giro { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--rojo); border-right-color: transparent; animation: giro .7s linear infinite; }

@keyframes revela { from { clip-path: inset(0 0 0 100% round 26px); } to { clip-path: inset(0 0 0 0 round 26px); } }
@keyframes avance { to { transform: scaleX(1); } }

@media (max-width: 960px) {
  .portal { grid-template-columns: 1fr; }
  .escena { order: -1; margin: 12px 12px 0; height: 32vh; min-height: 210px; border-radius: 22px; clip-path: inset(0 0 0 0 round 22px); animation: none; }
  .lado { padding: 20px 16px 22px; }
  .contenido { padding-top: 28px; max-width: none; }
}
@media (max-width: 560px) {
  .soporte__txt { display: none; }
  .opcion { grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 16px; }
  .opcion__ir { display: none; }
  .opcion__icono { width: 48px; height: 48px; font-size: 24px; }
  .opcion__titulo { font-size: 19px; }
  .escena__barras { display: none; }
}

/* =========================================================================
   ACCESO AL SISTEMA
   ========================================================================= */
.pg-acceso { display: flex; flex-direction: column; }
.barra {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding: 22px clamp(16px, 3vw, 28px) 0;
}
.volver {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 500; color: var(--t2); text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--l1);
  transition: color .2s ease, box-shadow .2s ease, transform .16s var(--ease-out);
}
.volver i { font-size: 16px; transition: transform .25s var(--ease-out); }
.volver:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .volver:hover { color: var(--t1); box-shadow: inset 0 0 0 1px var(--l3); }
  .volver:hover i { transform: translateX(-3px); }
}

.escenario {
  position: relative; z-index: 1; flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(20px, 4vh, 44px) clamp(12px, 3vw, 28px) clamp(24px, 4vh, 40px);
}
.pieza {
  width: 100%; max-width: 1080px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  padding: 10px;
  animation: sube .7s var(--ease-out) both;
}

.acceso { padding: clamp(26px, 4vw, 52px) clamp(20px, 4vw, 52px) clamp(22px, 3vw, 32px); display: flex; flex-direction: column; }
.saludo {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 18px; font-family: var(--f-mono); font-size: 12.5px; color: var(--t2);
}
.saludo i { font-size: 16px; color: var(--rojo-txt); }
.pg-acceso h1 { font-size: clamp(32px, 3.3vw, 44px); letter-spacing: -0.035em; }
.acceso .sub { margin-top: 10px; font-size: 15.5px; color: var(--t2); }
.acceso .aviso { margin-top: 20px; }
.acceso form { margin-top: 26px; display: grid; gap: 18px; }
.mayus { display: none; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--aviso); }
.mayus.is-on { display: inline-flex; }

.separador { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; font-size: 12.5px; color: var(--t3); }
.separador::before, .separador::after { content: ''; flex: 1; height: 1px; background: var(--l1); }
.acceso__pie { margin-top: auto; padding-top: 28px; font-size: 12.5px; color: var(--t3); }

.equipo {
  position: relative; overflow: hidden; min-height: 580px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(70% 55% at 85% 10%, rgba(var(--rojo-rgb), .26), transparent 60%),
    linear-gradient(165deg, var(--s3), var(--s0));
  isolation: isolate;
  clip-path: inset(0 0 0 0 round 14px);
  animation: revelaEquipo 1s .1s var(--ease-io) both;
}
.equipo__respaldo { position: absolute; left: 50%; top: 42%; width: 70%; transform: translate(-50%, -50%); opacity: .16; z-index: -3; }
.equipo__foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transform: scale(1.06); animation: acerca 1.6s .1s var(--ease-out) forwards; }
.equipo::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(9, 9, 11, 0) 35%, rgba(9, 9, 11, .6) 65%, rgba(9, 9, 11, .94) 100%); }
.equipo__texto { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(22px, 3vw, 34px); }
.equipo__texto > * { opacity: 0; transform: translateY(12px); animation: sube .7s var(--ease-out) forwards; }
.equipo__texto > :nth-child(1) { animation-delay: .5s; }
.equipo__texto > :nth-child(2) { animation-delay: .6s; }
.equipo h2 { font-size: clamp(24px, 2.3vw, 31px); line-height: 1.14; max-width: 20ch; }
.equipo p { margin-top: 10px; font-size: 15px; color: var(--t2); max-width: 40ch; }

.aviso-rol { display: none; }
.aviso-rol.show { display: grid; gap: 16px; }

@keyframes revelaEquipo { from { clip-path: inset(0 0 100% 0 round 14px); } to { clip-path: inset(0 0 0 0 round 14px); } }
@keyframes acerca { to { transform: scale(1); } }

@media (max-width: 900px) {
  .pieza { grid-template-columns: 1fr; max-width: 520px; }
  .equipo { order: -1; min-height: 210px; }
  .equipo p { display: none; }
}
@media (max-width: 480px) {
  .barra { padding-top: 16px; }
  .volver span { display: none; }
  .pieza { padding: 8px; }
  .acceso { padding: 24px 14px 18px; }
  .equipo { min-height: 180px; }
  .modal__cab { padding: 22px 18px 16px; }
  .modal__cuerpo { padding: 18px 18px 22px; }
}
