/* Portada (views/default.handlebars) y página de error (views/error.handlebars).
   Mismo lenguaje visual que id.iesa.es y suite.iesa.es: Manrope, azul de marca y tarjetas blancas. */
:root{
  --brand: #1f334d;
  --brand-dark: #141f33;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #e8f0fe;
  --green: #0a9e6c;
  --green-soft: #e6f7ef;
  --amber: #d97706;
  --amber-soft: #fff3e6;
  --red: #dc2626;
  --red-soft: #fdecec;
  --text: #172033;
  --text-2: #49617d;
  --muted: #64748b;
  --line: #d5dfeb;
  --bg: #edf2f8;
  --radius: 1.5rem;
  --shadow: 0 24px 60px rgba(31, 51, 77, .14);
}

*,
*::before,
*::after{ box-sizing: border-box; }

html, body{ margin: 0; }
body{
  min-height: 100vh;
  font-family: "Manrope", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a{ color: var(--blue); }
a:hover{ color: var(--blue-dark); }
:focus-visible{ outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 3px; border-radius: .5rem; }

.portal-kicker{
  margin: 0 0 .4rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.portal-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .75rem 1.25rem;
  border-radius: .9rem;
  border: 1px solid transparent;
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.portal-btn--primary{ background: var(--blue); color: #fff; box-shadow: 0 10px 24px rgba(37, 99, 235, .28); }
.portal-btn--primary:hover{ background: var(--blue-dark); color: #fff; }
.portal-btn--ghost{ background: #fff; border-color: var(--line); color: var(--text); }
.portal-btn--ghost:hover{ border-color: #b8c7da; color: var(--text); }
.portal-actions{ display: flex; flex-wrap: wrap; gap: .6rem; }

.portal-mark{
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: var(--blue-soft);
  color: var(--blue);
}
.portal-mark--warning{ background: var(--amber-soft); color: var(--amber); }
.portal-mark--danger{ background: var(--red-soft); color: var(--red); }

/* =====================================================================
   Portada: panel de marca a la izquierda y tarjeta de acceso a la derecha
   ===================================================================== */
.landing{
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
}

/* ---------- Panel de marca ---------- */
.landing-side{
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  color: #fff;
  background:
    radial-gradient(circle at 50% 45%, rgba(37, 99, 235, .22), transparent 26rem),
    linear-gradient(160deg, #1f334d 0%, #172843 55%, #111c30 100%);
}
.landing-brand{
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 22rem;
}
.landing-brand img{ width: min(15rem, 70%); height: auto; }
.landing-brand__claim{ display: block; margin-top: .6rem; font-size: .95rem; color: rgba(255, 255, 255, .92); }
.landing-brand__bar{
  width: 3.5rem;
  height: 3px;
  margin: 2.25rem auto 1.75rem;
  border-radius: 3px;
  background: #3b82f6;
}
.landing-brand p{
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.55;
  color: rgba(226, 232, 240, .82);
}

/* Módulos del sitio flotando alrededor de la marca (decorativos) */
.landing-apps{ position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.landing-app{
  position: absolute;
  width: 6.75rem;
  padding: .7rem .5rem .6rem;
  border-radius: .9rem;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
  text-align: center;
  animation: landing-float 7s ease-in-out infinite;
}
.landing-app__icon{
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto .45rem;
  border-radius: .7rem;
  display: grid;
  place-items: center;
  font-size: .95rem;
  font-weight: 800;
  background: rgba(var(--c), .16);
  color: rgb(var(--c));
}
.landing-app__name{
  display: block;
  font-size: .68rem;
  font-weight: 700;
  color: rgba(226, 232, 240, .78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.landing-app:nth-child(1){ --c: 59, 130, 246;  top: 7%;  left: 8%;  animation-delay: -1s; }
.landing-app:nth-child(2){ --c: 167, 139, 250; top: 8%;  left: 37%; animation-delay: -3s; }
.landing-app:nth-child(3){ --c: 52, 211, 153;  top: 6%;  left: 66%; animation-delay: -5s; }
.landing-app:nth-child(4){ --c: 251, 191, 36;  top: 24%; left: 76%; animation-delay: -2s; }
.landing-app:nth-child(5){ --c: 248, 113, 113; top: 44%; left: 6%;  animation-delay: -4s; }
.landing-app:nth-child(6){ --c: 45, 212, 191;  top: 56%; left: 80%; animation-delay: -6s; }
.landing-app:nth-child(7){ --c: 129, 140, 248; top: 76%; left: 14%; animation-delay: -2.5s; }
.landing-app:nth-child(8){ --c: 74, 222, 128;  top: 80%; left: 44%; animation-delay: -4.5s; }
.landing-app:nth-child(9){ --c: 251, 146, 60;  top: 74%; left: 72%; animation-delay: -1.5s; }

@keyframes landing-float{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(-8px); }
}

/* ---------- Panel de acceso ---------- */
.landing-main{
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem 1.5rem;
  background:
    radial-gradient(circle at 85% 12%, rgba(37, 99, 235, .06), transparent 22rem),
    #f1f5fa;
}
/* Círculos decorativos del fondo */
.landing-main::before,
.landing-main::after{
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(203, 213, 225, .35);
  pointer-events: none;
}
.landing-main::before{ width: 18rem; height: 18rem; left: 12%; bottom: -9rem; }
.landing-main::after{ width: 14rem; height: 14rem; right: -6rem; top: 8%; }

.landing-card{
  position: relative;
  z-index: 1;
  width: min(36rem, 100%);
  padding: 3.5rem 3rem 3rem;
  background: rgba(255, 255, 255, .92);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* Línea de color en el borde superior */
.landing-card::before{
  content: "";
  position: absolute;
  top: -1px;
  left: 12%;
  right: 12%;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, #2563eb 25%, #3b82f6 75%, transparent);
}

.landing-pill{
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .9rem;
  border-radius: 999px;
  background: var(--blue-soft);
  border: 1px solid #cddcfb;
  color: var(--blue);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.landing-card h1{
  margin: 1.5rem 0 .5rem;
  font-size: clamp(2rem, 3.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.landing-lead{
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}
.landing-lead strong{ color: var(--blue); font-weight: 800; }

.landing-features{
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .75rem;
}
.landing-features li{
  display: flex;
  align-items: center;
  gap: .85rem;
  color: var(--text-2);
  font-size: .92rem;
}
.landing-features i{
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  border-radius: .7rem;
  display: grid;
  place-items: center;
  background: #eef3fa;
  color: var(--brand);
}

.landing-card .portal-btn--primary{ width: 100%; padding: 1.05rem 1.25rem; font-size: 1.05rem; border-radius: 1rem; }

.landing-status{
  margin: 1.5rem 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--muted);
  font-size: .8rem;
}
.landing-status__dot{
  flex: 0 0 auto;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(10, 158, 108, .15);
}

.landing-footer{
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  color: var(--muted);
  font-size: .78rem;
}

/* =====================================================================
   Página de error
   ===================================================================== */
.portal-topbar{ background: var(--brand); }
.portal-topbar__inner{
  width: min(72rem, 100%);
  margin: 0 auto;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
}
.portal-brand{ display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; }
.portal-brand:hover{ color: #fff; }
.portal-brand__badge{
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .75rem;
  background: rgba(255, 255, 255, .12);
  display: grid;
  place-items: center;
  padding: .4rem;
}
.portal-brand__badge img{ max-width: 100%; max-height: 100%; }
.portal-brand__text strong{ display: block; font-size: 1rem; font-weight: 800; }
.portal-brand__text span{ display: block; font-size: .75rem; color: rgba(219, 234, 254, .75); }

body.portal-error-page{
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 15% 10%, rgba(37, 99, 235, .09), transparent 30rem),
    var(--bg);
}
.portal-error{
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}
.portal-error .portal-card{
  width: min(34rem, 100%);
  padding: 2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  box-shadow: 0 18px 40px rgba(31, 51, 77, .12);
}
.portal-error .portal-mark{ margin-bottom: 1.1rem; }
.portal-error h1{ margin: 0 0 .7rem; font-size: 1.65rem; line-height: 1.15; letter-spacing: -.03em; font-weight: 800; }
.portal-error__message{ margin: 0 0 1.4rem; color: var(--text-2); line-height: 1.55; }
.portal-error__ref{ margin: 1.4rem 0 0; color: var(--muted); font-size: .78rem; }
.portal-footer{ padding: 1.25rem; text-align: center; color: var(--muted); font-size: .8rem; }

/* =====================================================================
   Pantallas estrechas y movimiento reducido
   ===================================================================== */
/* Con el panel estrecho, los mosaicos de los lados taparían la marca */
@media (max-width: 80rem){
  .landing-app:nth-child(4), .landing-app:nth-child(5), .landing-app:nth-child(6){ display: none; }
}
@media (max-width: 60rem){
  .landing{ grid-template-columns: 1fr; }
  .landing-side{ padding: 2.5rem 1.5rem; }
  .landing-apps{ display: none; }
  .landing-brand img{ width: 11rem; }
  .landing-brand__bar{ margin: 1.25rem auto 1rem; }
  .landing-brand p{ font-size: 1rem; }
  .landing-main{ padding-top: 2rem; }
}
@media (max-width: 30rem){
  .landing-card{ padding: 2.5rem 1.5rem 2rem; }
  .portal-brand__text span{ display: none; }
  .portal-actions .portal-btn{ flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce){
  .landing-app{ animation: none; }
  .portal-btn{ transition: none; }
}
