/* =================================================================
   login.css — Estilos de la pantalla de login
   I.E.S. Nº 8 · Sagrado Corazón FASTA
   ================================================================= */

/* ── Layout raíz ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: stretch;
  font-family: 'Mulish', sans-serif;
}

/* ── Panel izquierdo (decorativo) ────────────────────── */
.login-aside {
  width: 50%;
  background: linear-gradient(160deg, #1a3a5c 0%, #3d2b6e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.login-aside::before {
  content: '';
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  top: -120px; left: -120px;
}
.login-aside::after {
  content: '';
  position: absolute;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  bottom: -80px; right: -80px;
}

.aside-logo {
  width: 150px;
  margin-bottom: 28px;
  position: relative; z-index: 1;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.25));
}

.aside-title {
  color: #fff;
  xfont-size: 1.55rem;
  xfont-weight: 800;
  text-align: center;
  line-height: 1.3;
  position: relative; z-index: 1;
  margin: 0 0 10px;
}

.aside-sub {
  color: rgba(255,255,255,.72);
  font-size: .82rem;
  text-align: center;
  position: relative; z-index: 1;
  line-height: 1.6;
  max-width: 280px;
}

.aside-deco {
  position: absolute;
  bottom: 32px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 1;
}
.aside-deco span {
  width: 28px; height: 3px;
  border-radius: 4px;
  background: rgba(255,255,255,.3);
}
.aside-deco span.active { background: rgba(255,255,255,.85); width: 48px; }

/* ── Panel derecho (formulario) ──────────────────────── */
.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: #eaf4fb;
  position: relative;
  overflow: hidden;
}

.login-main::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(46, 109, 164, .08);
  top: -120px; right: -120px;
  pointer-events: none;
}

.login-main::after {
  content: '';
  position: absolute;
  width: 270px; height: 270px;
  border-radius: 50%;
  background: rgba(46, 109, 164, .06);
  bottom: -80px; left: -80px;
  pointer-events: none;
}

.main-deco-arc1 {
  position: absolute;
  width: 320px; height: 320px;
  border-radius: 50%;
  border: 22px solid rgba(46, 109, 164, .07);
  top: -60px; right: -60px;
  pointer-events: none;
}
.main-deco-arc2 {
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 16px solid rgba(26, 58, 92, .05);
  bottom: -40px; left: -40px;
  pointer-events: none;
}
.main-deco-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(46,109,164,.13) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 10%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 10%, transparent 100%);
}
.main-deco-line {
  position: absolute;
  width: 2px; height: 180px;
  background: linear-gradient(to bottom, transparent, rgba(46,109,164,.13), transparent);
  top: 50%; left: 8%;
  transform: translateY(-50%) rotate(18deg);
  pointer-events: none;
}
.main-deco-line2 {
  position: absolute;
  width: 2px; height: 120px;
  background: linear-gradient(to bottom, transparent, rgba(46,109,164,.09), transparent);
  top: 20%; right: 10%;
  transform: rotate(-15deg);
  pointer-events: none;
}

.login-box {
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
}

.login-box h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px;
}
.login-box .login-hint {
  font-size: .78rem;
  color: var(--text2);
  margin: 0 0 28px;
}

/* ── Campo de formulario ─────────────────────────────── */
.field-wrap {
  position: relative;
  margin-bottom: 16px;
}
.field-wrap .field-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text2);
  font-size: 1rem;
  pointer-events: none;
  transition: color .18s;
}
.field-wrap input {
  width: 100%;
  padding: 12px 44px 12px 40px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .88rem;
  font-family: 'Mulish', sans-serif;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.field-wrap input::placeholder { font-weight: 400; color: #b0b8c4; }
.field-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,58,92,.1);
}
.field-wrap .toggle-pass {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; padding: 0;
  color: var(--text2); cursor: pointer; font-size: 1rem;
  transition: color .18s;
}
.field-wrap .toggle-pass:hover { color: var(--primary); }

/* ── Botón principal ─────────────────────────────────── */
.btn-login {
  width: 100%; padding: 13px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 10px;
  font-size: .92rem; xfont-weight: 700;
  font-family: 'Mulish', sans-serif;
  cursor: pointer; margin-top: 6px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .18s, transform .12s, box-shadow .18s;
  box-shadow: 0 4px 14px rgba(26,58,92,.18);
}
.btn-login:hover  { background: var(--secondary); box-shadow: 0 6px 18px rgba(26,58,92,.22); }
.btn-login:active { transform: scale(.98); }
.btn-login:disabled { opacity: .65; cursor: not-allowed; transform: none; }

/* ── Link olvidé contraseña ──────────────────────────── */
.forgot-link {
  display: block; text-align: right;
  font-size: .73rem; font-weight: 700;
  color: var(--secondary); text-decoration: none;
  margin-top: -8px; margin-bottom: 18px;
  transition: color .15s;
}
.forgot-link:hover { color: var(--primary); text-decoration: underline; }

/* ── Mensaje de error ────────────────────────────────── */
.login-error {
  background: #fde8e8; border: 1.5px solid #f5b7b1;
  border-radius: 8px; padding: 10px 14px;
  font-size: .78rem; font-weight: 700; color: #7b241c;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
  animation: fadeIn .2s ease;
}
.login-error i { font-size: 1rem; flex-shrink: 0; }

/* ── Panel de selección de perfil ────────────────────── */
.perfil-panel { animation: fadeIn .25s ease; }
.perfil-panel .perfil-intro { margin-bottom: 16px; }
.perfil-panel .perfil-intro p { font-size: .82rem; color: var(--text2); margin: 0; }
.perfil-panel .perfil-intro strong {
  display: block; font-size: 1rem; font-weight: 800; color: var(--text);
  margin-bottom: 4px;
}

.perfil-list { display: flex; flex-direction: column; gap: 8px; }

.perfil-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .18s, background .18s, box-shadow .18s, transform .12s;
  font-family: 'Mulish', sans-serif;
  text-align: left;
  width: 100%;
}
.perfil-item:hover {
  border-color: var(--secondary);
  background: var(--soft);
  box-shadow: 0 3px 10px rgba(26,58,92,.1);
  transform: translateX(3px);
}
.perfil-item:active { transform: translateX(1px); }
.perfil-item .perfil-ico {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; flex-shrink: 0;
}
.perfil-item .perfil-info { flex: 1; }
.perfil-item .perfil-nombre {
  font-size: .88rem; font-weight: 800; color: var(--text); display: block;
}
.perfil-item .perfil-grupo {
  font-size: .7rem; color: var(--text2); font-weight: 600; display: block; margin-top: 1px;
}
.perfil-item .perfil-arrow { color: var(--text2); font-size: 1rem; transition: color .18s; }
.perfil-item:hover .perfil-arrow { color: var(--secondary); }

.btn-back {
  background: none; border: none;
  font-size: .75rem; font-weight: 700;
  color: var(--text2); cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  padding: 0; margin-bottom: 20px;
  font-family: 'Mulish', sans-serif;
  transition: color .15s;
}
.btn-back:hover { color: var(--primary); }

/* ── Spinner ─────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: none;
}
.btn-login.loading .spinner   { display: block; }
.btn-login.loading .btn-label { display: none; }

/* ── Toast ───────────────────────────────────────────── */
.toast-wrap {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--primary); color: #fff;
  padding: 10px 22px; border-radius: 30px;
  font-size: .8rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 9999; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.toast-wrap.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Indicador fortaleza contraseña ──────────────────── */
.pass-bar {
  height: 4px; flex: 1; border-radius: 4px;
  background: var(--border);
  transition: background .2s;
}
.pass-bar.weak   { background: #e74c3c; }
.pass-bar.fair   { background: #f39c12; }
.pass-bar.good   { background: #2ecc71; }
.pass-bar.strong { background: #27ae60; }

.pass-rules {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3px 10px;
}
.pass-rules li {
  font-size: .68rem; font-weight: 700; color: #b0b8c4;
  display: flex; align-items: center; gap: 4px;
  transition: color .18s;
}
.pass-rules li.ok   { color: #27ae60; }
.pass-rules li.ok i { color: #27ae60; }
.pass-rules li i    { font-size: .78rem; color: #e0e0e0; }

/* ── Animaciones ─────────────────────────────────────── */
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
@keyframes spin   { to { transform: rotate(360deg); } }

.login-box { animation: fadeIn .3s ease; }

/* ── Modo registro: scroll solo en vista "Crear cuenta" ── */
.login-main.modo-registro {
  overflow-y: auto;
  align-items: flex-start;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
  body { flex-direction: column; }
  .login-aside {
    width: 100%; min-height: 200px;
    padding: 32px 24px 24px;
    flex-direction: row; gap: 20px;
    justify-content: flex-start;
  }
  .login-aside::before, .login-aside::after { display: none; }
  .aside-logo { width: 56px; margin: 0; }
  .aside-title { font-size: 1.1rem; text-align: left; }
  .aside-sub, .aside-deco { display: none; }
  .login-main { padding: 28px 20px 48px; align-items: flex-start; }
  .main-deco-arc1, .main-deco-arc2,
  .main-deco-dots, .main-deco-line, .main-deco-line2 { display: none; }
}

/* ── Overlay spinner ──────────────────────────────────────────── */
@keyframes overlaySpinner { to { transform: rotate(360deg); } }
  #overlayWait { --secondary: #2e6da4; --text2: #5a7a9a; }