/* ═══════════════════════════════════════════════════════════════════════════
   Hayim School — Portal Institucional (portal.php)
   ───────────────────────────────────────────────────────────────────────────
   La puerta de entrada a los cuatro accesos del sistema. Habla el MISMO
   lenguaje que el portal HCT y que el CRM: aurora institucional azul + rojo
   sobre blanco, tarjetas "glass", Playfair para títulos e Inter para el resto.

   Antes esta página era oscura con acentos dorados. Se veía bien, pero era el
   único sitio del ecosistema con ese lenguaje: quien venía del sitio público
   (claro) o entraba al CRM (ahora claro) sentía que cambiaba de producto tres
   veces en dos clics.

   La aurora es 100 % CSS, sin JavaScript, para que pase la CSP del sitio.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --navy:    #012f65;
  --navy-dk: #011e42;
  --blue:    #2f6fd1;
  --red:     #c72629;
  --red-lt:  #e0555a;
  --ink:     #0d1b2e;
  --muted:   #5b6b82;
  --line:    rgba(1,47,101,.12);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: #fff;
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }

/* ─── Aurora institucional ────────────────────────────────────────────────
   Tres "hojas" difuminadas en azul y rojo, con blend multiply sobre blanco.
   Es el mismo fondo del portal HCT y de la pantalla de acceso al CRM.       */
.hy-aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: #fff; }
.hy-blade { position: absolute; border-radius: 50%; filter: blur(78px); mix-blend-mode: multiply; will-change: transform, opacity; }
.hy-blade--1 {
  width: 82vw; height: 34vw; left: -18vw; top: -6vh;
  background: radial-gradient(closest-side, rgba(47,111,209,.48), rgba(1,47,101,.20) 46%, rgba(255,255,255,0) 80%);
  transform: rotate(-20deg); animation: hyBlade1 18s ease-in-out infinite;
}
.hy-blade--2 {
  width: 74vw; height: 30vw; right: -20vw; top: 22vh;
  background: radial-gradient(closest-side, rgba(199,38,41,.40), rgba(224,85,90,.18) 48%, rgba(255,255,255,0) 82%);
  transform: rotate(-14deg); animation: hyBlade2 22s ease-in-out infinite;
}
.hy-blade--3 {
  width: 68vw; height: 28vw; left: 10vw; bottom: -10vh;
  background: radial-gradient(closest-side, rgba(47,111,209,.36), rgba(199,38,41,.16) 52%, rgba(255,255,255,0) 84%);
  transform: rotate(-24deg); animation: hyBlade3 20s ease-in-out infinite;
}
/* El fotograma 0 % es el más "florecido": si el navegador no anima, lo que
   queda en pantalla se ve igual de bien. */
@keyframes hyBlade1 {
  0%,100% { transform: translate3d(0,0,0) rotate(-20deg) scale(1.12); opacity: .9; }
  50%     { transform: translate3d(4%,3%,0) rotate(-12deg) scale(1);  opacity: .6; }
}
@keyframes hyBlade2 {
  0%,100% { transform: translate3d(0,0,0) rotate(-14deg) scale(1.15); opacity: .85; }
  50%     { transform: translate3d(-4%,3%,0) rotate(-22deg) scale(1); opacity: .55; }
}
@keyframes hyBlade3 {
  0%,100% { transform: translate3d(0,0,0) rotate(-24deg) scale(1.1);  opacity: .8; }
  50%     { transform: translate3d(5%,-3%,0) rotate(-16deg) scale(.98); opacity: .5; }
}
.hy-grain {
  position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .035; mix-blend-mode: multiply;
}
.hy-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(120% 92% at 50% 18%, rgba(255,255,255,0) 44%, rgba(255,255,255,.9) 100%);
}

/* ─── Página ──────────────────────────────────────────────────────────────── */
.page {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 52px 24px 44px;
}

/* ─── Encabezado ──────────────────────────────────────────────────────────── */
.header { text-align: center; margin-bottom: 40px; animation: hyFadeDown .7s cubic-bezier(.32,.72,0,1) both; }
.header__logo {
  display: grid; place-items: center;
  width: 74px; height: 74px; margin: 0 auto 20px; padding: 11px;
  background: #fff; border-radius: 18px;
  box-shadow: 0 8px 24px rgba(47,111,209,.2), 0 0 0 1px var(--line);
}
.header__logo img { width: 100%; height: 100%; object-fit: contain; }
.header__eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 10px;
  font-size: .64rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--blue);
}
.header__eyebrow::before, .header__eyebrow::after {
  content: ''; display: block; width: 32px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue));
}
.header__eyebrow::after { background: linear-gradient(90deg, var(--red), transparent); }
.header__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  font-weight: 800; color: var(--navy); line-height: 1.08; letter-spacing: -.01em;
  margin-bottom: 12px;
}
/* El degradado azul↔rojo que fluye: la firma del HCT. */
.header__title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--blue), var(--red) 55%, var(--blue));
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: hyFlow 6s ease-in-out infinite;
}
@keyframes hyFlow { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.header__sub {
  max-width: 46ch; margin: 0 auto;
  font-size: .9rem; line-height: 1.7; color: var(--muted);
}
.header__sub strong { color: var(--navy); font-weight: 600; }

/* ─── Rejilla de accesos ──────────────────────────────────────────────────── */
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(4, 1fr);
  width: 100%; max-width: 1240px;
}

/* ─── Tarjeta de acceso ───────────────────────────────────────────────────── */
.card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 430px;
  padding: 24px 22px 22px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 16px 44px rgba(1,47,101,.10), 0 1px 0 rgba(255,255,255,.85) inset;
  opacity: 0; transform: translateY(26px);
  animation: hyFadeUp .6s cubic-bezier(.32,.72,0,1) forwards;
  transition: transform .35s cubic-bezier(.32,.72,0,1), box-shadow .35s, border-color .35s;
}
.card:nth-child(1) { animation-delay: .16s; }
.card:nth-child(2) { animation-delay: .26s; }
.card:nth-child(3) { animation-delay: .36s; }
.card:nth-child(4) { animation-delay: .46s; }

.card:hover, .card:focus-visible {
  transform: translateY(-8px);
  box-shadow: 0 28px 64px rgba(1,47,101,.18);
  border-color: rgba(1,47,101,.2);
}

/* Barra de acento azul→rojo al borde superior, como en el HCT. */
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--red));
  opacity: .55; transition: opacity .35s;
}
.card:hover::before { opacity: 1; }

/* Halo de color detrás del león, distinto por tarjeta (ver .card--*). */
.card__glow {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%);
  width: 200px; height: 200px; border-radius: 50%;
  filter: blur(52px); opacity: .3;
  pointer-events: none; transition: opacity .4s;
}
.card:hover .card__glow { opacity: .5; }
.card--azul  .card__glow { background: rgba(47,111,209,.6); }
.card--rojo  .card__glow { background: rgba(199,38,41,.42); }
.card--navy  .card__glow { background: rgba(1,47,101,.5); }
.card--mixto .card__glow { background: radial-gradient(circle, rgba(47,111,209,.5), rgba(199,38,41,.35)); }

.card__num {
  position: relative; z-index: 2;
  font-size: .64rem; font-weight: 700; letter-spacing: .12em;
  color: rgba(1,47,101,.24); font-variant-numeric: tabular-nums;
}

/* El león ocupa el espacio libre entre el número y el texto. */
.card__lion {
  position: relative; z-index: 2;
  flex: 1;
  display: grid; place-items: end center;
  min-height: 150px; margin: 6px 0 14px;
}
.card__lion img {
  height: 210px; width: auto; object-fit: contain;
  filter: drop-shadow(0 14px 26px rgba(1,47,101,.28));
  transition: transform .5s cubic-bezier(.32,.72,0,1);
}
.card:hover .card__lion img { transform: translateY(-8px) scale(1.04); }

.card__body { position: relative; z-index: 2; }
.card__tag {
  margin-bottom: 5px;
  font-size: .6rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--red);
}
.card__title {
  margin-bottom: 7px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.32rem; font-weight: 700; color: var(--navy); line-height: 1.18;
}
.card__desc {
  margin-bottom: 16px;
  font-size: .79rem; line-height: 1.6; color: var(--muted);
}
.card__desc strong { color: var(--ink); font-weight: 600; }

/* Botón rojo del HCT. */
.card__cta {
  display: inline-flex; align-items: center; gap: 8px;
  width: fit-content; padding: 9px 18px;
  border-radius: 999px;
  font-size: .78rem; font-weight: 700; color: #fff; letter-spacing: .01em;
  background: linear-gradient(135deg, var(--red), var(--red-lt));
  box-shadow: 0 6px 16px rgba(199,38,41,.28), 0 1px 0 rgba(255,255,255,.3) inset;
  transition: gap .3s, box-shadow .3s, background .3s;
}
.card:hover .card__cta {
  gap: 12px;
  background: linear-gradient(135deg, #d92c2f, #e86a6e);
  box-shadow: 0 10px 24px rgba(199,38,41,.4), 0 1px 0 rgba(255,255,255,.35) inset;
}
.card__cta svg { flex-shrink: 0; transition: transform .3s; }
.card:hover .card__cta svg { transform: translateX(3px); }

/* ─── Nota de orientación ─────────────────────────────────────────────────── */
/* La pregunta que de verdad se hace quien llega aquí es "¿cuál me toca a mí?".
   Antes la página no la respondía en ningún lado. */
.nota {
  max-width: 1240px; width: 100%;
  margin-top: 22px; padding: 13px 20px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 14px;
  font-size: .8rem; line-height: 1.6; color: var(--muted); text-align: center;
  animation: hyFadeUp .5s .58s both;
}
.nota strong { color: var(--navy); font-weight: 600; }

/* ─── Pie ─────────────────────────────────────────────────────────────────── */
.foot {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center;
  margin-top: 26px;
  animation: hyFadeUp .5s .66s both;
}
.foot a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; color: var(--muted); transition: color .2s;
}
.foot a:hover { color: var(--navy); }
.foot__sep { width: 1px; height: 14px; background: var(--line); }
.foot__copy { font-size: .74rem; color: rgba(13,27,46,.35); }

/* ─── Animaciones ─────────────────────────────────────────────────────────── */
@keyframes hyFadeDown { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes hyFadeUp   { from { opacity: 0; transform: translateY(26px); }  to { opacity: 1; transform: none; } }

/* ─── Accesibilidad ───────────────────────────────────────────────────────── */
a:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 20px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .card { opacity: 1; transform: none; }
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1150px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .card { min-height: 400px; }
}
@media (max-width: 620px) {
  .page { padding: 34px 18px 32px; }
  .grid { grid-template-columns: 1fr; }
  /* En una sola columna la tarjeta se vuelve horizontal: el león a un lado y
     el texto al otro. Si no, hay que hacer scroll por cada acceso. */
  .card { min-height: 0; flex-direction: row; align-items: center; gap: 14px; padding: 18px; }
  .card__num { position: absolute; top: 14px; right: 16px; }
  .card__lion { flex: 0 0 96px; min-height: 0; margin: 0; }
  .card__lion img { height: 128px; }
  .card__glow { left: 58px; bottom: auto; top: 50%; transform: translateY(-50%); width: 150px; height: 150px; }
  .card__body { flex: 1; min-width: 0; }
  .card__desc { margin-bottom: 12px; }
  .card__cta { font-size: .72rem; padding: 8px 14px; white-space: nowrap; }
  .header__logo { width: 62px; height: 62px; }
  .foot { gap: 12px; }
}
