/* ===========================================================
   Login CEMINEM — split-screen moderno e institucional.
   Identidad UNIZAR: #223d71, Myriad Pro, emblema del Paraninfo.
   =========================================================== */

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

.login-page {
  margin: 0;
  min-height: 100vh;
  background: var(--bg, #f4f6f9);
  color: var(--fg, #101828);
  font-family: "Myriad Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

.login-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100vh;
  max-width: 100%;
}

/* ============ Panel de marca (izquierda) ============ */
.login-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 64px;
  color: #fff;
  background:
    radial-gradient(1200px 700px at 100% 0%, rgba(108, 142, 205, 0.28), transparent 55%),
    radial-gradient(900px 600px at 0% 100%, rgba(20, 37, 68, 0.55), transparent 60%),
    linear-gradient(155deg, #284780 0%, #223d71 42%, #16284a 100%);
}

/* Retícula sutil */
.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 30%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 30% 30%, #000 0%, transparent 75%);
  pointer-events: none;
}

.login-brand__top,
.login-brand__center,
.login-brand__foot { position: relative; z-index: 2; }

.login-brand__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
}
.login-brand__eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: rgba(255, 255, 255, 0.55);
  display: inline-block;
}

.login-brand__center { max-width: 460px; }
.login-brand__center h1 {
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.1;
  font-weight: bold;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.login-brand__center h1 span { color: #aac2f0; }
.login-brand__center p {
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.login-brand__foot {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
}
.login-brand__foot .dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}
.login-brand__heritage {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.85);
}

/* ============ Panel de formulario (derecha) ============ */
.login-form-side {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  overflow: hidden;
}
.login-form-side .login-bg {
  position: absolute;
  bottom: -30px;
  right: -30px;
  width: 440px;
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  animation: login-up 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes login-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo { height: 42px; width: auto; margin-bottom: 36px; }

.login-header { margin-bottom: 30px; }
.login-header h2 {
  font-size: 25px;
  font-weight: bold;
  color: #101828;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.login-header p { color: #5c6678; font-size: 15px; margin: 0; }

.login-field { margin-bottom: 20px; }
.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #344054;
  margin-bottom: 8px;
}
.login-input-wrap { position: relative; display: flex; align-items: center; }
.login-input-wrap svg {
  position: absolute;
  left: 15px;
  width: 18px;
  height: 18px;
  color: #98a2b3;
  pointer-events: none;
  transition: color 0.2s ease;
}
.login-field input {
  width: 100%;
  padding: 13px 16px 13px 46px;
  border: 1px solid #d4dae4;
  border-radius: 12px;
  font-size: 15px;
  color: #101828;
  background: #fbfcfe;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}
.login-field input::placeholder { color: #b3bccd; }
.login-field input:focus {
  outline: none;
  background: #fff;
  border-color: #223d71;
  box-shadow: 0 0 0 4px rgba(34, 61, 113, 0.12);
}
.login-input-wrap:focus-within svg { color: #223d71; }

.login-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: #223d71;
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  padding: 14px;
  cursor: pointer;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(34, 61, 113, 0.22);
  transition: background 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
}
.login-btn svg { width: 17px; height: 17px; transition: transform 0.2s ease; }
.login-btn:hover {
  background: #1a2f58;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(34, 61, 113, 0.3);
}
.login-btn:hover svg { transform: translateX(3px); }
.login-btn:active { transform: translateY(0); }

.login-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 22px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.login-alert svg { width: 18px; height: 18px; flex-shrink: 0; }

.login-foot {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid #eceff4;
  text-align: center;
  font-size: 12px;
  color: #98a2b3;
}

/* ============ Acceso institucional (SIR) ============ */
.login-sso {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px 14px 14px;
  border-radius: 14px;
  background: #223d71;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(34, 61, 113, 0.22);
  transition: background 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
}
.login-sso:hover {
  background: #1a2f58;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(34, 61, 113, 0.3);
}
.login-sso:active { transform: translateY(0); }
.login-sso:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(34, 61, 113, 0.25); }
.login-sso__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.login-sso__icon svg { width: 22px; height: 22px; }
.login-sso__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.login-sso__text strong { font-size: 16px; font-weight: bold; }
.login-sso__text small { font-size: 13px; color: rgba(255, 255, 255, 0.72); }
.login-sso__arrow { width: 18px; height: 18px; flex-shrink: 0; transition: transform 0.2s ease; }
.login-sso:hover .login-sso__arrow { transform: translateX(3px); }

.login-hint {
  margin: 16px 2px 0;
  font-size: 13px;
  line-height: 1.55;
  color: #5c6678;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #98a2b3;
}
.login-divider::before,
.login-divider::after { content: ""; flex: 1; height: 1px; background: #e4e8ef; }

.login-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border: 1px dashed #d4dae4;
  border-radius: 12px;
  background: transparent;
  color: #5c6678;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.login-btn-secondary svg { width: 16px; height: 16px; }
.login-btn-secondary:hover { border-color: #223d71; color: #223d71; background: #fbfcfe; }

.login-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 600;
  color: #223d71;
  text-decoration: none;
}
.login-back svg { width: 15px; height: 15px; transition: transform 0.2s ease; }
.login-back:hover svg { transform: translateX(-3px); }

/* ============ Stack de pruebas: identidades a un clic ============ */
.login-pruebas { margin-top: 28px; padding-top: 20px; border-top: 1px solid #e3e8f0; }
.login-pruebas h3 { margin: 0 0 4px; font-size: 15px; color: #223d71; }
.login-pruebas-grupo {
  margin: 14px 0 6px; font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: #5c6678;
}
.login-pruebas ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.login-pruebas form { margin: 0; }
.login-pruebas-btn {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 12px; border: 1px solid #d9dfe9; border-radius: 10px;
  background: #fff; text-align: left; cursor: pointer; font: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.login-pruebas-btn:hover, .login-pruebas-btn:focus-visible { border-color: #223d71; background: #f6f8fc; }
.login-pruebas-nombre { font-size: 14px; font-weight: 600; color: #1f2937; }
.login-pruebas-nombre code { font-size: 12px; color: #5c6678; margin-left: 4px; }
.login-pruebas-papel { font-size: 12.5px; color: #5c6678; }

/* ============ Páginas de error (403) ============ */
/* Mismo split que el acceso: el número grande vive en el panel de marca. */
.error-code {
  display: block;
  margin: 0 0 8px -6px;
  font-size: clamp(120px, 14vw, 190px);
  line-height: 0.9;
  font-weight: bold;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 2px rgba(170, 194, 240, 0.55);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
  -webkit-background-clip: text;
  background-clip: text;
  user-select: none;
}

.error-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.error-badge__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(34, 61, 113, 0.08);
  border: 1px solid rgba(34, 61, 113, 0.14);
  color: #223d71;
}
.error-badge__icon svg { width: 20px; height: 20px; }
.error-badge__text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5c6678;
}
.login-header p strong { color: #344054; }

.error-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin: -8px 0 22px;
  border-radius: 12px;
  background: #f6f8fc;
  border: 1px solid #dfe5f0;
  color: #344054;
  font-size: 13.5px;
  line-height: 1.5;
}
.error-note svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: #223d71; }

/* El botón principal reutiliza .login-sso; si es <button>, se le quita el aspecto nativo. */
button.login-sso { border: 0; font: inherit; text-align: left; cursor: pointer; }

.error-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
  margin-top: 18px;
}
.error-actions form { margin: 0; }
.error-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #223d71;
  text-decoration: none;
  cursor: pointer;
}
.error-link svg { width: 15px; height: 15px; transition: transform 0.2s ease; }
.error-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.error-link:hover svg { transform: translateX(-2px); }
.error-link:focus-visible { outline: none; border-radius: 6px; box-shadow: 0 0 0 4px rgba(34, 61, 113, 0.18); }

.error-page .login-hint a { color: #223d71; font-weight: 600; }
.error-path {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f1f4f9;
  border: 1px solid #e4e8ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #344054;
  word-break: break-all;
}

/* ============ Responsive ============ */
@media (max-width: 920px) {
  .login-split { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-form-side { min-height: 100vh; }
}
