/* ============================================================
   login.css — Pantalla de inicio de sesión · Sistema Ñachec
   Escapa completamente del layout de base.html (header + sidebar)
   y cubre 100vw × 100vh sin franjas laterales.
   ============================================================ */

/* ── 1. ANULAR COMPLETAMENTE EL CHROME DE LA APP ── */
body.cp-auth .encabezado,
body.cp-auth .barra-nav,
body.cp-auth #btn-atajos-flotante {
  display: none !important;
}

/*
  El <main> de base.html tiene margin-left:260px, margin-top:70px y padding.
  Lo reseteamos todo para que el hero pueda ocupar 100vw × 100vh.
*/
body.cp-auth main,
body.cp-auth main.contenido,
body.cp-auth main.login-centro {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh !important;
  background: transparent !important;
  display: block !important;
  max-width: none !important;
  width: 100% !important;
}

body.cp-auth {
  overflow-x: hidden;
}

/* Mensajes flash flotantes */
body.cp-auth .messages {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 600px);
  z-index: 9999;
  margin: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
body.cp-auth .messages .alert {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border-radius: 0.65rem;
  border-left: 3px solid rgba(255, 255, 255, 0.4);
}

/* ── 2. HERO: ocupa todo el viewport ── */
.auth-hero {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #032038;
  overflow: hidden;
}

/* ── 3. FONDO ATMOSFÉRICO ── */
.auth-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  will-change: transform;
}
.auth-orb--1 {
  width: 65vw;
  height: 65vw;
  max-width: 800px;
  max-height: 800px;
  background: radial-gradient(circle, #1c5080 0%, #033161 70%);
  top: -25%;
  right: -15%;
  opacity: 0.7;
}
.auth-orb--2 {
  width: 40vw;
  height: 40vw;
  max-width: 500px;
  max-height: 500px;
  background: #b7004d;
  bottom: -15%;
  left: 20%;
  opacity: 0.12;
}
.auth-orb--3 {
  width: 35vw;
  height: 35vw;
  max-width: 420px;
  max-height: 420px;
  background: #38639c;
  top: 40%;
  left: -10%;
  opacity: 0.45;
}

.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(155, 127, 127, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 52px 52px;
}

/* ── 4. MINI-HEADER PROPIO DEL LOGIN ── */
.auth-topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.967);
}

.auth-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.auth-topbar-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.auth-topbar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.auth-topbar-name {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.auth-topbar-sup {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(180, 210, 255, 0.6);
  line-height: 1;
}
.auth-topbar-title {
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

/* Botón "Volver al portal" */
.auth-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(212, 227, 255, 0.85);
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
  white-space: nowrap;
}
.auth-back-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}
.auth-back-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
  transform: translateY(-1px);
}
.auth-back-btn:hover svg {
  transform: translateX(-2px);
}

/* ── 5. CUERPO CENTRAL: dos columnas ── */
.auth-body {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem 4rem;
}

.auth-inner {
  width: 100%;
  max-width: 1040px;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 4rem;
  align-items: center;
}

/* ── 6. COLUMNA IZQUIERDA: branding ── */
.auth-brand {
  max-width: 480px;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(180, 210, 255, 0.65);
  margin-bottom: 1.1rem;
}
.auth-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b7004d;
  flex-shrink: 0;
}

.auth-title {
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: clamp(2rem, 3.8vw, 3.1rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  color: #fff;
  line-height: 1.08;
  margin: 0 0 1.1rem;
}
.auth-title em {
  font-style: normal;
  color: #c5d9ff;
}

.auth-desc {
  font-size: 0.98rem;
  color: rgba(190, 215, 255, 0.72);
  line-height: 1.75;
  margin: 0 0 1.75rem;
  max-width: 42ch;
}

.auth-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.auth-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.82rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: rgba(205, 225, 255, 0.82);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* ── 7. COLUMNA DERECHA: card ── */
.auth-card {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-top-color: rgba(255, 255, 255, 0.2);
  border-radius: 1.4rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 28px 72px rgba(0, 0, 0, 0.55),
    0 4px 16px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 2.25rem 2.1rem 2.4rem;
}

.auth-card-hd {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.06) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  flex-shrink: 0;
}

.auth-card-titles h2 {
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}
.auth-card-titles p {
  margin: 0.22rem 0 0;
  font-size: 0.81rem;
  color: rgba(190, 215, 255, 0.58);
  line-height: 1.4;
}

/* ── 8. FORMULARIO ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.auth-field label {
  display: block;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: rgba(190, 215, 255, 0.58);
  margin-bottom: 0.52rem;
}

.auth-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 0.8rem;
  padding: 0 0.55rem 0 0.9rem;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22), 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.auth-input:focus-within {
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow:
    0 0 0 3px rgba(183, 0, 77, 0.22),
    0 2px 10px rgba(0, 0, 0, 0.22);
}

.auth-input-icon {
  display: flex;
  align-items: center;
  color: #9ca3af;
  flex-shrink: 0;
}
.auth-input-icon svg {
  width: 17px;
  height: 17px;
}

.auth-input input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: #111827;
  padding: 0.82rem 0;
  min-width: 0;
}
.auth-input input::placeholder {
  color: #cbd0d8;
  font-weight: 400;
}

.auth-input input:-webkit-autofill,
.auth-input input:-webkit-autofill:hover,
.auth-input input:-webkit-autofill:focus {
  -webkit-text-fill-color: #111827;
  transition: background-color 9999s ease-in-out 0s;
  box-shadow: 0 0 0 9999px rgba(255, 255, 255, 0.96) inset;
}

.auth-toggle {
  border: none;
  background: transparent;
  padding: 0.4rem 0.45rem;
  border-radius: 0.5rem;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}
.auth-toggle:hover {
  color: #374151;
  background: rgba(0, 0, 0, 0.06);
}

.auth-field .errorlist {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  font-size: 0.78rem;
  color: #fca5a5;
}

.errorlist.nonfield {
  display: block;
  background: rgba(183, 0, 77, 0.18);
  border: 1px solid rgba(255, 100, 140, 0.28);
  border-radius: 0.7rem;
  padding: 0.7rem 0.9rem;
  color: #fca5a5;
  font-size: 0.81rem;
  list-style: none;
  margin: 0;
}
.errorlist.nonfield li { list-style: none; }

/* ── 9. BOTÓN SUBMIT ── */
.auth-submit {
  margin-top: 0.3rem;
  width: 100%;
  border: none;
  border-radius: 0.8rem;
  background: var(--color-accent, #b7004d);
  color: #fff;
  font-family: var(--font-display, 'Sora', sans-serif);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 0.9rem;
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 22px rgba(183, 0, 77, 0.42);
  text-transform: uppercase;
}
.auth-submit:hover {
  background: var(--color-accent-hover, #de2264);
  transform: translateY(-1px);
  box-shadow: 0 6px 30px rgba(183, 0, 77, 0.55);
}
.auth-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(183, 0, 77, 0.35);
}

/* ── 10. FOOTER DE CARD ── */
.auth-card-footer {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  text-align: center;
  font-size: 0.75rem;
  color: rgba(180, 210, 255, 0.35);
}

/* ── 11. RESPONSIVE ── */
@media (max-width: 860px) {
  .auth-topbar { padding: 1rem 1.5rem; }
  .auth-body {
    padding: 2.5rem 1.5rem 3.5rem;
    align-items: flex-start;
  }
  .auth-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 460px;
    margin: 0 auto;
  }
  .auth-brand {
    max-width: 100%;
    text-align: center;
  }
  .auth-eyebrow { justify-content: center; }
  .auth-tags { justify-content: center; }
  .auth-desc {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }
  .auth-title { font-size: clamp(1.75rem, 5vw, 2.5rem); }
}

@media (max-width: 520px) {
  .auth-topbar { padding: 0.9rem 1.1rem; }
  .auth-topbar-sup { display: none; }
  .auth-back-btn span { display: none; }
  .auth-back-btn { padding: 0.45rem 0.65rem; }
  .auth-body { padding: 2rem 1.1rem 2.5rem; }
  .auth-inner { max-width: 100%; gap: 1.75rem; }
  .auth-card {
    padding: 1.65rem 1.35rem 1.85rem;
    border-radius: 1.1rem;
  }
  .auth-title { font-size: 1.75rem; }
  .auth-desc { font-size: 0.9rem; }
}

@media (max-width: 380px) {
  .auth-card { padding: 1.35rem 1.1rem 1.5rem; }
  .auth-input input { font-size: 0.9rem; padding: 0.72rem 0; }
}