/* ═══════════════════════════════════════════════
   BUCARE — login.css
   Página de inicio de sesión
   ═══════════════════════════════════════════════ */

:root {
  --pr: #a32260;
  --sec: #e75330;
  --acc: #b8738b;
  --ok: #cc94b4;
  --sc: #3d6b8c;
  --dark: #2c3e50;
  --bg: #f8f9fa;
  --white: #ffffff;
  --grad: linear-gradient(135deg, #a32260 0%, #e75330 100%);
  --grad2: linear-gradient(135deg, #b8738b 0%, #cc94b4 100%);
  --shadow: 0 10px 30px rgba(163, 34, 96, 0.15);
  --shadow-hover: 0 15px 35px rgba(163, 34, 96, 0.25);
  --tr: all 0.3s ease;
  --ff: 'Poppins', sans-serif;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--ff);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: #495057;
  overflow-x: hidden;
}

/* ─────────────────────────────
   LAYOUT PRINCIPAL
───────────────────────────── */
.login-wrapper {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ─────────────────────────────
   PANEL IZQUIERDO — Identidad
───────────────────────────── */
.login-brand {
  background: var(--grad);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

/* Círculos decorativos de fondo */
.login-brand::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  top: -150px;
  right: -150px;
}
.login-brand::after {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  bottom: -100px;
  left: -100px;
}

.brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  max-width: 420px;
}

.brand-logo-wrap {
  width: 130px;
  height: 130px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.brand-logo-wrap img {
  width: 95px;
  height: 95px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.brand-name {
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 0.3rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.brand-subtitle {
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.85;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 3rem;
  line-height: 1.5;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.brand-feature {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 0.85rem 1.2rem;
  text-align: left;
  backdrop-filter: blur(6px);
  transition: var(--tr);
}

.brand-feature:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(5px);
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.feature-text strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.feature-text span {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* ─────────────────────────────
   PANEL DERECHO — Formulario
───────────────────────────── */
.login-form-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  background: #fff;
  position: relative;
}

/* Línea decorativa izquierda */
.login-form-panel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 3px;
  background: var(--grad);
  border-radius: 0 3px 3px 0;
}

.form-container {
  width: 100%;
  max-width: 420px;
}

/* Cabecera del formulario */
.form-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.form-header .welcome-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(163, 34, 96, 0.08);
  color: var(--pr);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  margin-bottom: 1rem;
}

.form-header h1 {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.form-header h1 span {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-header p {
  color: #888;
  font-size: 0.9rem;
}

/* Alertas */
.alert-login {
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  font-size: 0.87rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-login.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.alert-login.success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.alert-login.info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Grupos de campo */
.field-group {
  margin-bottom: 1.4rem;
}

.field-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.5rem;
  letter-spacing: 0.3px;
}

.input-wrap {
  position: relative;
}

.input-wrap i.field-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #b8c0cc;
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.3s;
}

.input-wrap input {
  width: 100%;
  padding: 0.78rem 1rem 0.78rem 2.8rem;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-family: var(--ff);
  font-size: 0.92rem;
  color: var(--dark);
  background: #f8f9fa;
  transition: var(--tr);
  outline: none;
}

.input-wrap input:focus {
  border-color: var(--pr);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(163, 34, 96, 0.08);
}

.input-wrap input:focus + i.field-icon,
.input-wrap:focus-within i.field-icon {
  color: var(--pr);
}

/* Ojo de contraseña */
.toggle-pwd {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #b8c0cc;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.2rem;
  transition: color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toggle-pwd:hover {
  color: var(--pr);
}

/* Fila extra (recordar + recuperar) */
.form-row-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.check-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.83rem;
  color: #666;
  user-select: none;
}

.check-remember input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--pr);
  cursor: pointer;
}

.link-forgot {
  font-size: 0.83rem;
  color: var(--pr);
  text-decoration: none;
  font-weight: 600;
  transition: var(--tr);
}
.link-forgot:hover {
  color: var(--sec);
  text-decoration: underline;
}

/* Botón principal */
.btn-ingresar {
  width: 100%;
  padding: 0.9rem;
  background: var(--grad);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-family: var(--ff);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--tr);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
}

.btn-ingresar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.3s;
}

.btn-ingresar:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(163, 34, 96, 0.4);
}

.btn-ingresar:hover::after {
  background: rgba(255, 255, 255, 0.06);
}
.btn-ingresar:active {
  transform: translateY(0);
}

.btn-ingresar.loading {
  pointer-events: none;
  opacity: 0.85;
}

/* Spinner en botón */
.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.btn-ingresar.loading .btn-spinner {
  display: block;
}
.btn-ingresar.loading .btn-icon {
  display: none;
}
.btn-ingresar.loading .btn-text {
  opacity: 0.7;
}

/* Solicitar acceso */
.solicitar-acceso {
  margin-top: 1.5rem;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #f0f0f0;
}

.solicitar-acceso p {
  font-size: 0.83rem;
  color: #888;
  margin-bottom: 0.7rem;
}

.btn-solicitar {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  background: transparent;
  border: 2px solid var(--pr);
  border-radius: 10px;
  color: var(--pr);
  font-family: var(--ff);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--tr);
}

.btn-solicitar:hover {
  background: var(--pr);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(163, 34, 96, 0.3);
}

/* Footer inferior */
.login-footer {
  text-align: center;
  padding: 1.2rem;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  font-size: 0.78rem;
  color: #aaa;
}

.login-footer strong {
  color: var(--pr);
  font-weight: 600;
}

/* ─────────────────────────────
   RESPONSIVE
───────────────────────────── */
@media (max-width: 992px) {
  .login-wrapper {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-brand {
    padding: 3rem 2rem;
    min-height: 340px;
  }

  .brand-name {
    font-size: 2.4rem;
  }
  .brand-features {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .brand-feature {
    flex: 1 1 200px;
  }

  .login-form-panel::before {
    display: none;
  }
  .login-form-panel {
    padding: 2.5rem 1.5rem;
  }
}

@media (max-width: 576px) {
  .login-brand {
    padding: 2rem 1rem;
    min-height: 280px;
  }
  .brand-name {
    font-size: 2rem;
  }
  .brand-logo-wrap {
    width: 90px;
    height: 90px;
  }
  .brand-logo-wrap img {
    width: 65px;
    height: 65px;
  }
  .brand-features {
    display: none;
  }
  .login-form-panel {
    padding: 2rem 1rem;
  }
  .form-header h1 {
    font-size: 1.5rem;
  }
  .form-row-extras {
    flex-direction: column;
    align-items: flex-start;
  }
}
