/* Intranet Ozanam · Acceso (diseño de TechOzanam con los colores del escudo)
   Lenguaje visual: claridad tipográfica de Apple, componentes de Google. */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --border: #e3e3e6;
  --border-strong: #d2d2d7;
  --text: #1d1d1f;
  --muted: #5f6368;
  --dim: #80868b;
  --accent: #33366a;
  --accent-hover: #2a2d5c;
  --accent-soft: #ecedf6;
  --accent-ink: #1b1d3d;
  --brand: #33366a;
  --brand-gradient: linear-gradient(135deg, #2c2f5e 0%, #33366a 55%, #42468a 100%);
  --ok: #137333;
  --ok-bg: #e6f4ea;
  --ok-border: #b7e1c4;
  --err: #c5221f;
  --err-bg: #fce8e6;
  --err-border: #f6aea9;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* ── Cuerpo: panel partido izquierda/derecha ── */
.lg-main {
  flex: 1; display: flex; align-items: stretch; min-height: 0;
}

/* ── Lado izquierdo: video de fondo + tinte de marca (esquema SchoolNet) ── */
.lg-hero {
  position: relative; overflow: hidden; isolation: isolate;
  flex: 0 0 40%; max-width: 40%; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: clamp(1.75rem, 3vw, 2.75rem);
  background: #24274f url('/assets/img/login-poster.jpg') center / cover no-repeat;
  color: #fff;
}
.lg-left-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: -3; pointer-events: none;
}
/* Tinte de marca sobre el video (equivalente al azul translúcido de SchoolNet) */
.lg-hero-tint {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(160deg, rgba(44, 47, 94, .9) 0%, rgba(51, 54, 106, .84) 55%, rgba(66, 70, 138, .8) 100%);
  box-shadow: inset 0 -5px 0 #e2332b;
}
/* Textura de puntos en los bordes + viñeta inferior para relieve y contraste del pie */
.lg-hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.16) 1px, transparent 1.4px);
  background-size: 18px 18px; opacity: .55;
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 30%, #000 85%);
          mask-image: radial-gradient(ellipse at center, transparent 30%, #000 85%);
}
.lg-hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(0deg, rgba(8, 10, 40, .55) 0%, rgba(8, 10, 40, 0) 32%);
}

.lg-hero-center {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: .15rem;
}
.lg-hero-logo {
  width: clamp(110px, 11vw, 160px); height: auto; margin-bottom: 1rem;
  filter: drop-shadow(0 14px 28px rgba(8, 10, 50, .45));
  animation: lgFloat 6s ease-in-out infinite;
}
@keyframes lgFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.lg-hero-name {
  font-size: clamp(2rem, 3.2vw, 2.9rem); font-weight: 800; letter-spacing: -.035em; line-height: 1;
  text-shadow: 0 4px 18px rgba(8, 10, 50, .35);
}
.lg-hero-school {
  font-size: .82rem; font-weight: 700; letter-spacing: .28em; text-transform: uppercase;
  color: rgba(255,255,255,.82); margin-top: .55rem;
}
.lg-hero-tagline {
  margin-top: 1.1rem; font-size: .92rem; color: rgba(255,255,255,.9);
  padding: .4rem 1rem; border-radius: 999px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

.lg-hero-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem 1.25rem; flex-wrap: wrap;
  font-size: .76rem; color: rgba(255,255,255,.8);
}
.lg-hero-dev {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem .85rem .35rem .4rem; border-radius: 999px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.26);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff;
}
.lg-hero-dev::before {
  content: ''; width: 20px; height: 20px; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2332b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 18 6-6-6-6M8 6l-6 6 6 6'/%3E%3C/svg%3E") center / 12px no-repeat;
}

@media (max-width: 1280px) {
  .lg-hero { flex-basis: 46%; max-width: 46%; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-hero-logo { animation: none; }
}

/* ── Lado derecho: formulario ── */
/* ══════════════════════════════════════════════════════════════
   Lado derecho: formulario sobrio, al estilo de las pantallas de
   acceso de Apple / Google. Sin tarjetas ni degradados: tipografía,
   espacio en blanco, campos con etiqueta flotante y un botón sólido.
   ══════════════════════════════════════════════════════════════ */
.lg-right {
  position: relative;
  flex: 1 1 60%; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 5vw, 4rem) 4.5rem;
  background: #f5f5f7;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', var(--font);
}
/* Recuadro del formulario: borde fino y sombra apenas perceptible (patrón Google/Apple) */
.lg-right-inner {
  width: 100%; max-width: 448px;
  background: #fff; border: 1px solid #e3e3e8; border-radius: 24px;
  padding: 2.75rem 2.5rem 2.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.lg-logo { display: block; width: 46px; height: auto; margin-bottom: 1.6rem; }
.lg-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', var(--font);
  font-size: 2rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; color: #1d1d1f;
}
.lg-sub { margin: .55rem 0 2rem; font-size: 1rem; line-height: 1.45; color: #6e6e73; letter-spacing: -0.01em; }

/* ── Campo con etiqueta flotante ── */
.lg-fl { position: relative; margin-bottom: .85rem; }
.lg-fl input {
  display: block; width: 100%; height: 56px;
  padding: 1.35rem 1rem .45rem;
  font: inherit; font-size: 1rem; letter-spacing: -0.01em; color: #1d1d1f;
  background: #fff; border: 1px solid #c7c7cc; border-radius: 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none; appearance: none;
}
.lg-fl input:hover { border-color: #a1a1a6; }
.lg-fl input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(51, 54, 106, .16); }
.lg-fl label {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  font-size: 1rem; color: #86868b; pointer-events: none; letter-spacing: -0.01em;
  transition: top .15s ease, font-size .15s ease, color .15s ease, transform .15s ease;
}
.lg-fl input:focus + label,
.lg-fl input:not(:placeholder-shown) + label,
.lg-fl input:-webkit-autofill + label {
  top: .62rem; transform: none; font-size: .72rem; color: #6e6e73;
}
.lg-fl input:focus + label { color: var(--accent); }
.lg-fl input.is-invalid { border-color: #d70015; box-shadow: 0 0 0 4px rgba(215, 0, 21, .1); }
.lg-fl input.is-invalid + label { color: #d70015; }
.lg-fl-pwd input { padding-right: 5.25rem; }
.lg-show {
  position: absolute; right: .55rem; top: 50%; transform: translateY(-50%);
  padding: .4rem .6rem; border: none; background: none; border-radius: 8px;
  font: inherit; font-size: .85rem; font-weight: 500; color: var(--accent); cursor: pointer;
}
.lg-show:hover { background: #eeeff7; }
.lg-show:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lg-caps { margin: -.35rem 0 .8rem .15rem; font-size: .8rem; color: #b25000; }
.lg-hint { margin: -.3rem 0 1.5rem .15rem; font-size: .8rem; line-height: 1.45; color: #86868b; }

.lg-remember {
  display: inline-flex; align-items: center; gap: .55rem; margin: .35rem 0 0;
  font-size: .9rem; color: #424245; cursor: pointer; user-select: none;
}
.lg-remember input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }

/* ── Acciones: enlace a la izquierda, botón a la derecha (patrón Google) ── */
.lg-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.lg-link {
  background: none; border: none; padding: .45rem .1rem; border-radius: 6px;
  font: inherit; font-size: .9rem; font-weight: 500; color: var(--accent); cursor: pointer;
}
.lg-link:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.lg-link:disabled { color: #86868b; cursor: default; }
.lg-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lg-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-width: 120px; height: 44px; padding: 0 1.6rem;
  font: inherit; font-size: .95rem; font-weight: 600; letter-spacing: -0.01em;
  color: #fff; background: #33366a; border: none; border-radius: 999px; cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}
.lg-btn:hover:not(:disabled) { background: #2a2d5c; box-shadow: 0 1px 3px rgba(20, 30, 90, .25); }
.lg-btn:active:not(:disabled) { background: #23264f; }
.lg-btn:disabled { background: #8b8db3; cursor: default; }
.lg-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(51, 54, 106, .3); }
.lg-btn-block { width: 100%; margin-top: 1.4rem; }
.lg-btn.is-busy::before {
  content: ''; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: lgspin .7s linear infinite;
}

.lg-note { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid #e8e8ed; font-size: .85rem; line-height: 1.5; color: #86868b; }

/* Error: texto en rojo con barra fina, sin caja llamativa */
.lg-alert { margin: -.75rem 0 1.25rem; padding: .1rem 0 .1rem .8rem; font-size: .88rem; line-height: 1.45; border-left: 3px solid; }
.lg-alert-error { color: #d70015; border-color: #d70015; }
.lg-alert-ok { color: #1d7d32; border-color: #1d7d32; }

/* Contraseña incorrecta: sacudida corta, como macOS */
.lg-shake { animation: lgShake .38s ease; }
@keyframes lgShake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* ── Pie del panel derecho ── */
.lg-bottom {
  position: absolute; left: 0; right: 0; bottom: 1.4rem;
  display: flex; justify-content: center; flex-wrap: wrap; gap: .25rem .5rem;
  font-size: .78rem; color: #86868b;
}
.lg-bottom strong { font-weight: 600; color: #424245; }
.lg-bottom-sep { color: #c7c7cc; }
/* En escritorio el crédito ya aparece al pie del panel del video */
@media (min-width: 941px) { .lg-bottom { display: none; } }
.lg-nowrap { white-space: nowrap; }

/* ── Modales: hoja blanca simple ── */
.lg-modal {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .38); padding: 1rem; opacity: 0; transition: opacity .18s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', var(--font);
}
.lg-modal.is-open { opacity: 1; }
.lg-modal-card {
  position: relative; background: #fff; border-radius: 18px;
  width: 100%; max-width: 420px; max-height: calc(100vh - 2rem); overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
  transform: scale(.97); transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}
.lg-modal.is-open .lg-modal-card { transform: none; }
body.lg-modal-lock { overflow: hidden; }
.lg-modal-hero { padding: 2rem 1.75rem 0; }
.lg-modal-card h3 {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', var(--font);
  font-size: 1.45rem; font-weight: 600; letter-spacing: -0.025em; color: #1d1d1f; padding-right: 2rem;
}
.lg-modal-sub { margin-top: .45rem; font-size: .92rem; line-height: 1.45; color: #6e6e73; }
.lg-modal-body { padding: 1.5rem 1.75rem 1.75rem; }
.lg-modal-body .lg-actions { margin-top: 1.25rem; }
.lg-modal-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #f2f2f7; border: none; color: #6e6e73; cursor: pointer;
}
.lg-modal-close svg { width: 13px; height: 13px; }
.lg-modal-close:hover { background: #e5e5ea; color: #1d1d1f; }
.lg-modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Progreso en 3 tramos (línea + etiqueta) */
.lg-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: 1.4rem; }
.lg-steps li { padding-top: .5rem; border-top: 3px solid #e5e5ea; font-size: .74rem; color: #86868b; transition: border-color .2s, color .2s; }
.lg-steps li span { display: none; }
.lg-steps li.done { border-color: var(--accent); color: #6e6e73; }
.lg-steps li.active { border-color: var(--accent); color: #1d1d1f; font-weight: 600; }

/* Confirmación de envío */
.lg-sent-ico {
  width: 44px; height: 44px; border-radius: 50%; margin-bottom: 1rem;
  display: flex; align-items: center; justify-content: center; color: #fff; background: #34c759;
}
.lg-sent-ico svg { width: 22px; height: 22px; }
.lg-sent h4 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.02em; color: #1d1d1f; }
.lg-sent p { margin-top: .3rem; font-size: .9rem; line-height: 1.45; color: #6e6e73; }
.lg-sent-mail { margin-top: .35rem; font-size: .95rem; font-weight: 600; color: #1d1d1f; }
.lg-sent-mail:empty { display: none; }
.lg-sent-tips { margin: 1.25rem 0 0 1.1rem; display: grid; gap: .35rem; }
.lg-sent-tips li { font-size: .85rem; line-height: 1.45; color: #6e6e73; }

/* Fortaleza de contraseña (primer ingreso) */
.lg-strength { display: flex; align-items: center; gap: .7rem; margin: -.3rem 0 .95rem; }
.lg-strength-bars { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.lg-strength-bars span { height: 4px; border-radius: 99px; background: #e5e5ea; transition: background .2s; }
.lg-strength-label { font-size: .75rem; color: #86868b; min-width: 84px; text-align: right; }
.lg-strength[data-level="1"] .lg-strength-bars span:nth-child(-n+1) { background: #ff3b30; }
.lg-strength[data-level="2"] .lg-strength-bars span:nth-child(-n+2) { background: #ff9500; }
.lg-strength[data-level="3"] .lg-strength-bars span:nth-child(-n+3) { background: var(--accent); }
.lg-strength[data-level="4"] .lg-strength-bars span { background: #34c759; }
.lg-reqs { list-style: none; display: grid; gap: .35rem; margin-top: .2rem; }
.lg-reqs li { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: #86868b; transition: color .2s; }
.lg-reqs li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #c7c7cc; flex-shrink: 0; margin: 0 4px; transition: background .2s; }
.lg-reqs li.ok { color: #1d7d32; }
.lg-reqs li.ok::before { background: #34c759; }

/* ── Indicador de carga ── */
@keyframes lgspin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .lg-shake { animation: none; }
  .lg-fl label, .lg-modal, .lg-modal-card { transition: none; }
}

/* ── Adaptación a pantallas pequeñas ── */
@media (max-width: 940px) {
  .lg-main { flex-direction: column; }
  .lg-hero {
    flex: 0 0 auto; max-width: none; min-height: 220px;
    padding: calc(1.25rem + env(safe-area-inset-top)) 1.25rem 1.5rem;
  }
  .lg-hero-logo { width: 72px; margin-bottom: .6rem; }
  .lg-hero-name { font-size: 1.75rem; }
  .lg-hero-school { font-size: .7rem; letter-spacing: .22em; }
  .lg-hero-tagline { display: none; }
  .lg-hero-foot { display: none; }

  .lg-right {
    flex: 1 1 auto; justify-content: flex-start;
    padding: 2rem 1.4rem calc(1.5rem + env(safe-area-inset-bottom));
  }
  .lg-right-inner {
    max-width: 440px; margin: 0 auto;
    padding: 1.75rem 1.35rem 1.5rem; border-radius: 20px;
  }
  .lg-right { background: #f5f5f7; padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom)); }
  .lg-logo { display: none; }
  .lg-title { font-size: 1.7rem; }
  .lg-sub { margin-bottom: 1.6rem; }
  .lg-actions { flex-direction: column-reverse; align-items: stretch; gap: .6rem; margin-top: 1.6rem; }
  .lg-btn { width: 100%; height: 50px; font-size: 1rem; }
  .lg-link { align-self: center; }
  .lg-note { margin-top: 2rem; text-align: center; }
  .lg-bottom { position: static; margin-top: 1.5rem; }

  .lg-modal { align-items: flex-end; padding: 0; }
  .lg-modal-card {
    border-radius: 18px 18px 0 0; max-width: 100%; max-height: 92vh;
    transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom);
  }
  .lg-modal-hero { padding: 1.6rem 1.3rem 0; }
  .lg-modal-body { padding: 1.3rem 1.3rem 1.5rem; }
}
@media (max-width: 1024px) { .lg-fl input { font-size: 16px !important; } }

/* Código de verificación */
.lg-fl input.lg-code { font-size: 1.5rem; letter-spacing: .5em; font-weight: 600; text-align: center; }

/* ── Notebooks y pantallas bajas ──
   Centrado "seguro": si el formulario no cabe (error, recuperar clave, código), la página se desplaza
   en vez de cortar la parte de arriba. Y en pantallas de poca altura todo se compacta. */
@media (min-width: 941px) {
  .lg-right { justify-content: flex-start; overflow-y: auto; }
  .lg-right-inner { margin: auto 0; }
}
@media (min-width: 941px) and (max-height: 820px) {
  .lg-right { padding: 1.5rem 2rem 3.5rem; }
  .lg-right-inner { padding: 2rem 2.25rem 1.6rem; max-width: 420px; }
  .lg-logo { width: 40px; margin-bottom: 1rem; }
  .lg-title { font-size: 1.7rem; }
  .lg-sub { margin: .4rem 0 1.4rem; font-size: .95rem; }
  .lg-fl input { height: 52px; }
  .lg-hint { margin-bottom: 1.1rem; }
  .lg-note { margin-top: 1.6rem; padding-top: 1rem; }
  .lg-hero { padding: 1.5rem 1.75rem; }
  .lg-hero-logo { width: clamp(96px, 9vw, 130px); }
}
@media (min-width: 941px) and (max-height: 680px) {
  .lg-right-inner { padding: 1.6rem 2rem 1.3rem; }
  .lg-logo { display: none; }
  .lg-title { font-size: 1.55rem; }
  .lg-sub { margin-bottom: 1.1rem; }
  .lg-note { margin-top: 1.1rem; padding-top: .8rem; font-size: .8rem; }
  .lg-modal-hero { padding-top: 1.4rem; }
  .lg-modal-body { padding: 1.1rem 1.5rem 1.3rem; }
}

/* Ingreso pausado por Informática */
.lg-lock { display: flex; flex-direction: column; gap: .2rem; margin: -.5rem 0 1.25rem; padding: .8rem .95rem; border-radius: 12px; background: #fff7e6; border: 1px solid #f1cf87; color: #6b4a00; font-size: .9rem; line-height: 1.45; }
.lg-lock b { font-size: .95rem; color: #8a5a00; } .lg-lock small { font-size: .8rem; color: #8a6a2a; }
.lg-link.is-off { opacity: .45; text-decoration: line-through; cursor: not-allowed; }
