/*
 * =====================================================
 *  LOGIN — Sistema de Gestión Documental
 *  Diseño moderno split-screen — Paleta Gob.pe
 *  Gobierno Local | Perú
 * =====================================================
 */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  display: block !important;
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #F6F9FC !important;
  min-height: 100vh;
}

/* =====================================================
   LAYOUT — Split screen
   ===================================================== */

.sgd-auth-screen {
  display: flex !important;
  flex-direction: row !important;
  min-height: 100vh;
  width: 100%;
}

/* =====================================================
   PANEL IZQUIERDO — Institucional
   ===================================================== */
.login-panel-left {
  flex: 1;
  background: linear-gradient(160deg, #0056AC 0%, #184397 50%, #0D1028 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 40px 32px;
  position: relative;
  overflow: hidden;
}

/* Círculos decorativos de fondo */
.login-panel-left::before {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  top: -120px;
  right: -100px;
}
.login-panel-left::after {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(220, 54, 46, 0.12);
  bottom: -80px;
  left: -60px;
}

.panel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.05), rgba(0,0,0,0.2));
  pointer-events: none;
}

.panel-content {
  position: relative;
  z-index: 1;
}

/* Logo en panel izquierdo */
.panel-logo {
  margin-bottom: 28px;
}
.panel-logo img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  padding: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  border: 3px solid rgba(255,255,255,0.3);
  display: block;
  pointer-events: none;
}

.panel-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.panel-desc {
  font-size: 1rem;
  color: rgba(255,255,255,0.75);
  margin: 0 0 24px;
  font-weight: 400;
}

.panel-divider {
  width: 48px;
  height: 3px;
  background: #DC362E;
  border-radius: 2px;
  margin-bottom: 24px;
}

/* Lista de características */
.panel-features {
  list-style: none;
  padding: 0;
  margin: 0;
}
.panel-features li {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  padding: 7px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel-features li i {
  color: #54B690;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Footer del panel */
.panel-footer {
  position: relative;
  z-index: 1;
  color: rgba(255,255,255,0.45);
  font-size: 0.78rem;
}

/* =====================================================
   PANEL DERECHO — Formulario
   ===================================================== */
.login-panel-right {
  width: 480px;
  min-width: 340px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  box-shadow: -4px 0 40px rgba(0, 86, 172, 0.08);
}

.login-form-wrapper {
  width: 100%;
  max-width: 360px;
}

/* Logo móvil (solo visible en pantallas pequeñas) */
.login-logo-mobile {
  display: none;
  text-align: center;
  margin-bottom: 20px;
}
.login-logo-mobile img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 50%;
  background: #EEF3FB;
  padding: 8px;
  pointer-events: none;
}

/* ---- Encabezado del formulario ---- */
.login-header {
  margin-bottom: 28px;
}
.login-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #26292E;
  margin: 0 0 4px;
}
.login-subtitle {
  font-size: 0.9rem;
  color: #555869;
  margin: 0;
  font-weight: 400;
}

/* =====================================================
   CAMPOS DEL FORMULARIO
   ===================================================== */
.login-form {
  margin-bottom: 20px;
}

.field-group {
  margin-bottom: 18px;
}

.field-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #26292E;
  margin-bottom: 6px;
}

.field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 13px;
  color: #979797;
  font-size: 0.88rem;
  pointer-events: none;
  z-index: 2;
  transition: color 0.2s;
}

.field-input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 38px;
  border: 1.5px solid #DEE3EA;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #26292E;
  background: #FAFBFC;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
  font-family: inherit;
}

.field-input:focus {
  border-color: #0056AC;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 86, 172, 0.12);
}

.field-input:focus + .field-icon,
.field-input-wrap:focus-within .field-icon {
  color: #0056AC;
}

.field-input::placeholder {
  color: #C5CDDA;
  font-weight: 400;
}

/* Botón mostrar/ocultar contraseña */
.field-toggle {
  position: absolute;
  right: 0;
  height: 44px;
  width: 42px;
  background: transparent;
  border: none;
  border-left: 1.5px solid #DEE3EA;
  border-radius: 0 8px 8px 0;
  color: #979797;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: color 0.2s, background 0.2s;
  z-index: 2;
}
.field-toggle:hover {
  color: #0056AC;
  background: #EEF3FB;
}

/* =====================================================
   CHECKBOX RECORDAR
   ===================================================== */
.login-remember {
  margin-bottom: 20px;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #555869;
  font-weight: 400;
  user-select: none;
}

.remember-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.remember-custom {
  width: 18px;
  height: 18px;
  border: 2px solid #DEE3EA;
  border-radius: 4px;
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.remember-label input[type="checkbox"]:checked ~ .remember-custom {
  background: #0056AC;
  border-color: #0056AC;
}
.remember-label input[type="checkbox"]:checked ~ .remember-custom::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

/* =====================================================
   BOTÓN INGRESAR
   ===================================================== */
.btn-ingresar {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, #1363D0 0%, #0056AC 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 4px 16px rgba(0, 86, 172, 0.30);
  font-family: inherit;
}
.btn-ingresar:hover {
  background: linear-gradient(135deg, #0056AC 0%, #184397 100%);
  box-shadow: 0 6px 20px rgba(0, 86, 172, 0.40);
  transform: translateY(-1px);
}
.btn-ingresar:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 86, 172, 0.25);
}
.btn-ingresar i {
  font-size: 1rem;
}

/* =====================================================
   BARRA DE AYUDA
   ===================================================== */
.login-help-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #555869;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid #EEF3FB;
}

.login-help-bar i.fas {
  color: #0056AC;
}

.login-help-bar a {
  color: #0056AC;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.8rem;
}
.login-help-bar a:hover {
  text-decoration: underline;
}

.wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #25D366;
  color: white !important;
  border-radius: 50%;
  font-size: 0.9rem;
  transition: transform 0.2s;
  text-decoration: none !important;
  margin-left: 2px;
}
.wa-btn:hover {
  transform: scale(1.15);
}

/* =====================================================
   RESPONSIVE — Móvil y tablet
   ===================================================== */
@media (max-width: 900px) {
  .sgd-auth-screen {
    flex-direction: column !important;
  }
  .login-panel-left {
    display: none;
  }
  .login-panel-right {
    width: 100%;
    min-width: 0;
    box-shadow: none;
    padding: 32px 20px;
  }
  .login-logo-mobile {
    display: block;
  }
}

@media (max-width: 480px) {
  .login-form-wrapper {
    max-width: 100%;
  }
  .login-title {
    font-size: 1.4rem;
  }
  .login-panel-right {
    padding: 24px 16px;
  }
}
