/* Aura Rojo — UI principal */
:root {
  --bg-0: #fff7f8;           /* blanco con tinte rojo */
  --bg-1: #fff1f3;           /* capa intermedia */
  --primary: #d90429;        /* rojo vibrante */
  --primary-600: #b40321;    /* rojo más oscuro */
  --ink: #1d1b1b;            /* texto principal */
  --ink-muted: #6b6163;      /* texto secundario */
  --card: rgba(255, 255, 255, 0.5);
  --border: rgba(217, 4, 41, 0.2);
  --shadow: 0 10px 25px rgba(217, 4, 41, 0.12), 0 3px 8px rgba(0,0,0,0.06);
  --orb-blur: 20px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg-0);
  overflow-x: hidden;
}

/* Escenario fijo de una sola página */
main { position: relative; height: 100vh; overflow: hidden; z-index: 1; }
.panel { position: absolute; inset: 0; display: grid; place-items: center; }

/* Canvas y elementos decorativos */
#bg-canvas { position: fixed; inset: -4px; z-index: 0; pointer-events: none; will-change: transform; backface-visibility: hidden; transform: translateZ(0); }
.bg-tint { position: fixed; inset: -4px; z-index: 0; pointer-events: none; mix-blend-mode: multiply; background: rgba(217,4,41,0.10); backface-visibility: hidden; will-change: background-color; transform: translateZ(0); }
.bg-blur {
  position: fixed; z-index: 0; border-radius: 50%; filter: blur(60px);
  opacity: 0.7; mix-blend-mode: multiply; pointer-events: none; backface-visibility: hidden;
}
.bg-blur--1 { width: 420px; height: 420px; left: -100px; top: -60px;
  background: radial-gradient(circle at 30% 30%, rgba(217,4,41,0.45), rgba(255,197,206,0.65)); }
.bg-blur--2 { width: 520px; height: 520px; right: -120px; bottom: -80px;
  background: radial-gradient(circle at 70% 70%, rgba(217,4,41,0.35), rgba(255,197,206,0.55)); }
.bg-vignette { position: fixed; inset: -4px; z-index: 0; pointer-events: none; --vigA: 0.25; backface-visibility: hidden; will-change: background; transform: translateZ(0);
  background: radial-gradient(120% 80% at 50% 50%, rgba(0,0,0,0) 40%, rgba(0,0,0,var(--vigA)) 100%); }

/* Luces de contorno (rim lights) */
.rim-light {
  position: fixed; z-index: 0; pointer-events: none; mix-blend-mode: screen; opacity: 0.22;
  filter: blur(30px) saturate(120%);
  background: radial-gradient(closest-side, rgba(255, 110, 120, 0.55), rgba(217, 4, 41, 0.15) 60%, rgba(217, 4, 41, 0) 70%);
  will-change: transform, opacity; backface-visibility: hidden; transform: translateZ(0);
}
.rim-light--1 { width: 320px; height: 320px; top: -60px; left: -40px; border-radius: 50%; }
.rim-light--2 { width: 380px; height: 380px; bottom: -80px; right: -60px; border-radius: 50%; }
.rim-light--3 { width: 260px; height: 260px; top: 20%; right: -80px; border-radius: 50%; }

/* Orbiters: esferas de luz en movimiento */
.orbiter {
  position: fixed; z-index: 2; pointer-events: none; border-radius: 50%;
  width: 180px; height: 180px; opacity: 0.55;
  background: radial-gradient(closest-side,
    rgba(255, 110, 120, 0.90) 0%,
    rgba(255, 173, 183, 0.70) 45%,
    rgba(217, 4, 41, 0.35) 68%,
    rgba(217, 4, 41, 0) 85%
  );
  filter: blur(var(--orb-blur, 20px)) saturate(125%);
  mix-blend-mode: normal; will-change: transform, opacity; backface-visibility: hidden; transform: translateZ(0);
  box-shadow:
    0 0 24px rgba(255, 255, 255, 0.35),
    0 0 60px rgba(217, 4, 41, 0.25),
    0 0 120px rgba(217, 4, 41, 0.18);
}
.orbiter::after {
  content: "";
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 45% 38%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 55%);
  filter: blur( min(10px, var(--orb-blur, 20px)) );
  opacity: 0.65;
}
.orbiter--1 { top: 8%; left: 10%; }
.orbiter--2 { bottom: 12%; right: 14%; }
.orbiter--3 { top: 42%; right: 8%; width: 150px; height: 150px; }

/* Layout utilidades */
.container { width: min(1120px, 92%); margin-inline: auto; }
.display { font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1.05; letter-spacing: -0.02em; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-muted); }
.muted { color: var(--ink-muted); }

/* Header fijo */
.site-header { position: sticky; top: 0; z-index: 10; backdrop-filter: saturate(1.2) blur(10px);
  background: rgba(255, 255, 255, 0.55); border-bottom: 1px solid rgba(217,4,41,0.08); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; text-decoration: none; }
.brand__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px rgba(217,4,41,0.15);
  animation: pulse 2.8s ease-in-out infinite; }
@keyframes pulse { 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.25); } }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; margin-left: 18px; position: relative; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px; background: var(--primary); transition: width .25s ease; }
.nav a:hover::after, .nav a:focus-visible::after { width: 100%; }

/* Hero */
.hero { position: relative; padding: 120px 0 96px; min-height: 86vh; display: grid; place-items: center; text-align: center; }
.hero .lead { margin: 16px auto 28px; max-width: 62ch; }
.btn { display: inline-block; border: 1px solid transparent; padding: 12px 20px; border-radius: 14px; text-decoration: none; font-weight: 600; transition: all .25s ease; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--primary-600); transform: translateY(-1px); box-shadow: 0 14px 30px rgba(217,4,41,0.18), 0 4px 10px rgba(0,0,0,0.06); }

.scroll-indicator { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); background: transparent; border: 0; cursor: pointer; }
.scroll-indicator span { display: block; width: 26px; height: 42px; border-radius: 16px; border: 2px solid rgba(0,0,0,0.25); position: relative; }
.scroll-indicator span::after { content: ""; position: absolute; left: 50%; top: 8px; transform: translateX(-50%); width: 4px; height: 8px; border-radius: 2px; background: rgba(0,0,0,0.35); animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 0%{ transform: translate(-50%, 0); opacity: 1;} 90%{ transform: translate(-50%, 16px); opacity: 0;} 100%{ opacity: 0;} }

/* Secciones */
.section { padding: 84px 0; }
.section-muted { background: rgba(255, 255, 255, 0.5); backdrop-filter: blur(6px); border-top: 1px solid rgba(217,4,41,0.08); border-bottom: 1px solid rgba(217,4,41,0.08); }
.grid-2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }

.map { min-height: 260px; display: grid; place-items: center; }
.map__placeholder { font-weight: 600; color: var(--primary-600); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.9; }

/* Equipo */
.team { margin-top: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.member img { width: 100%; height: 220px; object-fit: cover; border-radius: 14px; }
.member h3 { margin: 12px 0 6px; }
.member p { margin: 0; color: var(--ink-muted); }

/* FAQ */
.faq { margin-top: 18px; display: grid; gap: 12px; }
.faq-item { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: rgba(255,255,255,0.6); backdrop-filter: blur(6px); box-shadow: var(--shadow); }
.faq-q { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 16px 18px; font-weight: 600; cursor: pointer; }
.faq-q[aria-expanded="true"] { color: var(--primary-600); }
.faq-a { padding: 0 18px 16px; color: var(--ink-muted); }

/* Footer */
.site-footer { border-top: 1px solid rgba(217,4,41,0.08); padding: 18px 0; background: rgba(255,255,255,0.7); backdrop-filter: blur(6px); opacity: 1; transform: none; }
.site-footer .container { display: flex; align-items: center; justify-content: space-between; }
.to-top { text-decoration: none; color: var(--primary-600); font-weight: 700; }

/* Animaciones reveal (estado inicial para no-paint) */
.reveal { will-change: transform, opacity; opacity: 0; transform: translateY(24px) scale(0.98); }

/* Hero logo/icon */
.hero-icon {
  width: clamp(120px, 18vw, 200px);
  height: auto;
  display: block;
  margin-inline: auto;
  margin-bottom: 2px;
  filter: drop-shadow(0 8px 20px rgba(217,4,41,0.20)) drop-shadow(0 2px 6px rgba(0,0,0,0.10));
}

/* Hero title/subtitle spacing */
.hero-brand h1 { margin: 2px 0 4px; }
.hero-sub { margin: 0 0 12px; font-weight: 300; color: var(--ink-muted); letter-spacing: 0.15px; }

/* Login screen overlay */
#login-screen {
  position: fixed; inset: 0; display: none; place-items: center; z-index: 30;
  background: radial-gradient(120% 120% at 50% 50%, rgba(255,255,255,0.85), rgba(255,255,255,0.65));
  backdrop-filter: blur(10px) saturate(1.1);
  pointer-events: none; /* activamos al mostrar */
}
#login-screen[aria-hidden="false"] { pointer-events: auto; }
.login-card { background: rgba(255,255,255,0.7); border: 1px solid var(--border); border-radius: 24px; padding: 36px; width: min(620px, 92vw); box-shadow: 0 20px 40px rgba(217,4,41,0.12), 0 6px 18px rgba(0,0,0,0.06); text-align: center; }
.login-card h2 { margin: 0 0 6px; font-size: clamp(1.3rem, 2vw, 1.6rem); }
.login-options { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 12px; margin-bottom: 1.5rem; }

.rector-login {
  text-align: center;
  margin-bottom: 2rem;
}

.rector-link {
  color: #6b7280;
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 400;
}

.rector-link:hover {
  color: #8b5cf6;
  text-decoration: underline;
}
.option-btn { padding: 14px 22px; border-radius: 16px; border: 1px solid var(--border); background: linear-gradient(180deg, #ffffff, #fff7f8); color: var(--ink); font-weight: 700; cursor: pointer; box-shadow: var(--shadow); transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.option-btn:hover { transform: translateY(-2px); background: linear-gradient(180deg, #fff7f8, #ffeef1); box-shadow: 0 14px 30px rgba(217,4,41,0.18), 0 4px 10px rgba(0,0,0,0.06); }
.option-btn:focus-visible { outline: 3px solid rgba(217,4,41,0.25); outline-offset: 2px; }

/* Auth form */
.auth-form { margin-top: 18px; display: grid; gap: 12px; text-align: left; }
.auth-form[aria-hidden="true"] { display: none; }
.auth-form .note { font-size: 0.95rem; color: var(--ink-muted); margin-bottom: 2px; }
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #fffafb); color: var(--ink); outline: none; box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.auth-form input:focus { border-color: rgba(217,4,41,0.45); box-shadow: 0 0 0 4px rgba(217,4,41,0.10); }
.auth-message { min-height: 1.25em; margin-top: 4px; font-size: 0.95rem; }
.auth-message[data-type="error"] { color: #b00020; }
.auth-message[data-type="success"] { color: #0a7a2f; }
.auth-message[data-type="info"] { color: var(--ink-muted); }

/* Auth submit button full-width */
.auth-form .btn-primary { width: 100%; padding: 14px 20px; border-radius: 14px; }

/* Accessibility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Responsivo */
@media (max-width: 960px) {
  .grid-2 { grid-template-columns: 1fr; }
  .team { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .nav { display: none; }
  .member img { height: 180px; }
  .team { grid-template-columns: 1fr; }
}

/* Preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none !important; animation: none !important; }
  .bg-blur, #bg-canvas { display: none; }
  main { height: auto; }
  .panel { position: static; }
  .site-footer { opacity: 1; transform: none; }
  .rim-light, .bg-tint, .bg-vignette { display: none; }
  .orbiter { display: none; }
}
